Skip to content

Commit

Permalink
vignette
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentarelbundock committed Jan 14, 2024
1 parent 9856a2c commit b0921f6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion vignettes/tutorial.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ tt(x, notes = list(a = "Blah.", b = "Blah blah."))

## Math

In LaTeX and MathJax (for HTML), there are two main ways to enclose mathematical expressions, either between dollar signs or escaped parentheses: `$...$` or `\(...\)`. The first strategy [is discouraged by MathJax,](https://docs.mathjax.org/en/latest/basic/mathematics.html) because dollar signs are very common in non-mathematical contexts, which can cause rendering errors. In that spirit, `tinytable` will not render dollar-enclosed expressions as mathematical expressions in HTML. Following the default MathJax settings, `tinytable` expects users to employ the escaped parentheses strategy:
In LaTeX and MathJax (for HTML), there are two main ways to enclose mathematical expressions, either between dollar signs or escaped parentheses: `$...$` or `\(...\)`. The first strategy [is discouraged by MathJax,](https://docs.mathjax.org/en/latest/basic/mathematics.html) because dollar signs are very common in non-mathematical contexts, which can cause rendering errors. In that spirit, `tinytable` will not render dollar-enclosed strings as mathematical expressions in HTML. Following the default MathJax settings, `tinytable` expects users to employ the escaped parentheses strategy:

```{r}
dat <- data.frame(Math = c("\\( x^2 + y^2 = z^2 \\)", "\\( \\frac{1}{2} \\)"))
Expand Down Expand Up @@ -302,6 +302,7 @@ The font size is specified in terms of `pt` units, where 1pt=1.333px:
tt(x) |> style_tt(j = "mpg|hp|qsec", fontsize = 18)
```

::: {.content-visible when-format="pdf"}
## Spanning cells

Sometimes, it can be useful to make a cell stretch across multiple colums, for example when we want to insert a label. To achieve this, we can use the `colspan` argument. Here, we make the 2nd cell of the 2nd row stretch across three columns:
Expand All @@ -320,6 +321,7 @@ Here is the original table for comparison:
```{r}
tt(x)
```
:::

## Headers

Expand Down

0 comments on commit b0921f6

Please sign in to comment.