NOTE: Markdown does not support well for mathematical equations. And
some equations not displayed properly in this page, such as
$\frac{x}{y}$
, $\sqrt[y]{x}$
and $\prod_{i = 1}^{n} x_i$
, . See
the html
vignette
for all the correct displayed equations.
Tools for converting R expressions to latex mathematical equations. This project is scratch from the section 21.3 transforms mathematically R code into its LaTeX equivalent.
library(rlatexmath)
translate_latexmath(pi)
π
# quoted object
translate_latexmath_(quote(pi))
π
| R expression | latex math | |-------------------------------|---------------------------------------------| | Binary operators | | | x + y | x + y | | x - y | x − y | | x * y | xy | | x / y | x/y | | x %+-% y | x ± y | | x %/% y | x ÷ y | | x %*% y | x × y | | x %.% y | x ⋅ y | | x[i] | xi | | x^i | xi | | Grouping | | | (x + y) | (x+y) | | {x y} | x + y | | Juxtaposition | | | paste(x, y, z) | xyz | | Comma separated lists | | | list(x + y, z) | x + y, z | | Fractions | | | frac(x, y) | $\frac{x}{y}$ | | atop(x, y) | $x \atop y$ | | Ellipsis | | | list(x[1], cdots, x[2]) | x1, ⋯, x2 | | list(x[1], ldots, x[2]) | x1, …, x2 | | Radicals | | | sqrt(x) | $\sqrt[]{x}$ | | sqrt(x, y) | $\sqrt[y]{x}$ | | Relation | | | x == y | x = y | | x != y | x ≠ y | | x < y | x < y | | x > y | x > y | | x >= y | x ≥ y | | x <= y | x ≤ y | | x %==% y | x ≡ y | | x %\~\~% y | x ≈ y | | x %=\~% y | x ≅ y | | x %prop% y | x ∝ y | | Set</> | | | x %supset% y | x ⊃ y | | x %supseteq% y | x ⊇ y | | x %subset% y | x ⊂ y | | x %notsubset% y | x ⊄ y | | x %subseteq% y | x ⊆ y | | x %in% y | x ∈ y | | x %notin% y | x ∉ y | | Arrow | | | x %<->% y | x ↔ y | | x %<-% y | x ← y | | x %up% y | x ↑ y | | x %->% y | x → y | | x %down% y | x ↓ y | | x %<=>% y | x ⇔ y | | x %<=% y | x ⇐ y | | x %dblup% y | x ⇑ y | | x %=>% y | x ⇒ y | | x %dbldown% y | x ⇓ y | | Accent | | | tilde(x) | x̃ | | hat(x) | x̂ | | widetilde(x) | x̃ | | widehat(x) | x̂ | | bar(x) | x̄ | | Operators | | | sum(x[i]) | ∑xisum(x[i], i==1, n) | | prod(x[i]) | ∏xi | | prod(x[i], i==1, n) | $\prod_{i = 1}^{n} x_i$ | | integral(f(x)*{dx}, a, b) | ∫abf(x)dx | | union(A[i], i==1, n) | $\bigcup_{i = 1}^{n} A_i$ | | intersect(A[i], i==1, n) | $\bigcup_{i = 1}^{n} A_i$ | | lim(f(x), x %->% infty) | limx → ∞f(x) | | min(f(x), x >= 0) | minx ≥ 0f(x) | | max(f(x), x >= 0) | maxx ≥ 0f(x) | | Typeface | | | plain(x) | x | | bold(x) | x | | italic(x) | x | | bolditalic(x) | x | | Delimiters | | | group(“(”, list(a,b), “]”) | (a, b] | | bgroup(“[", frac(a,b), "]”) | $\left [ \frac{a}{b} \right ]$ | | abs(x) | \|x\| |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.