Skip to content

Instantly share code, notes, and snippets.

@EmilHvitfeldt
Created February 4, 2021 09:50

Revisions

  1. EmilHvitfeldt created this gist Feb 4, 2021.
    54 changes: 54 additions & 0 deletions xaringancolor-latex-example
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,54 @@
    ---
    output:
    xaringan::moon_reader:
    lib_dir: libs
    nature:
    highlightStyle: github
    ratio: "7:5"
    highlightLines: true
    countIncrementalSlides: false
    ---

    <div style = "position:fixed; visibility: hidden">
    $$\require{color}\definecolor{yellow}{rgb}{1, 0.8, 0.16078431372549}$$
    $$\require{color}\definecolor{orange}{rgb}{0.96078431372549, 0.525490196078431, 0.203921568627451}$$
    $$\require{color}\definecolor{green}{rgb}{0, 0.474509803921569, 0.396078431372549}$$
    </div>

    <script type="text/x-mathjax-config">
    MathJax.Hub.Config({
    TeX: {
    Macros: {
    yellow: ["{\\color{yellow}{#1}}", 1],
    orange: ["{\\color{orange}{#1}}", 1],
    green: ["{\\color{green}{#1}}", 1]
    },
    loader: {load: ['[tex]/color']},
    tex: {packages: {'[+]': ['color']}}
    }
    });
    </script>

    <style>
    .yellow {color: #FFCC29;}
    .orange {color: #F58634;}
    .green {color: #007965;}
    </style>

    ```{r flair_color, echo=FALSE}
    library(flair)
    yellow <- "#FFCC29"
    orange <- "#F58634"
    green <- "#007965"
    ```

    # Simple Linear Model

    We remember that

    $$\yellow{Y_i} = \beta_0 + \beta_1 \orange{X_i} + \green{\varepsilon_i}$$
    with

    - .yellow[reponse variable]
    - .orange[predictor variable]
    - .green[error term]