Skip to content

Commit

Permalink
mathjax delimiters
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentarelbundock committed Jan 14, 2024
1 parent 1e0b63b commit 093066c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
18 changes: 12 additions & 6 deletions inst/templates/bootstrap.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
</style>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<script>
MathJax = {
tex: {
inlineMath: [['$', '$'], ['\\(', '\\)']]
},
svg: {
fontCache: 'global'
}
};
</script>
</head>

<body>
Expand All @@ -24,12 +36,6 @@
</div>

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script>
function styleCell(i, j, css_id) {
var table = document.getElementById("$tinytable_TABLE_ID");
Expand Down
2 changes: 1 addition & 1 deletion vignettes/tutorial.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ tt(x, notes = list(a = "Blah.", b = "Blah blah."))
You can render equations inside tables using the common `$...$` syntax:

```{r}
dat <- data.frame(Math = c("$x^2 + y^2 = z^2$", "$\\frac{1}{2}$"))
dat <- data.frame(Math = c("\\(x^2 + y^2 = z^2\\)", "\\(\\frac{1}{2}\\)"))
tt(dat)
```

Expand Down

0 comments on commit 093066c

Please sign in to comment.