It would be nice to be able to render a LaTeX equation from the console for the purpose of testing an equation using Eqn()
before putting the result into a document. Presently, I'm using the Lagrida LaTeX Equation Editor.
The idea is to be able to do something like:
matX <- latexMatrix() renderMatrix(matX)
and see the result in an RStudio Viewer
panel. However, I note that (unless I'm mistaken)
Eqn()
now no longer has an option to return the result other than via cat()
.
kableExtra
to render a LaTeX tableSee result in a Viewer pane:
library(kableExtra) kable(head(mtcars), booktabs = T) |> kable_styling(latex_options = c("striped", "scale_down"))
Display latex code in console:
library(kableExtra) kable(mtcars, format = "latex", booktabs = T) |> kable_styling(latex_options = c("striped", "scale_down"))
For this, would need to look into the internals of kableExtra::kable()
to see how this is done.
TexLive
and the tinytex
package. I'm using MikTeX
and am
reluctant to switch to test this.if(!(require(texPreview))) install.packages("texPreview") library(texPreview) texPreview::check_requirements() texPreview::tex_preview(matX)
renderMatrix()
to: latexMatrix()
or Eqn()
into a document templateknitr
Preview result with browseURL()
LaTeX formula in Shiny panel shows use of a withMathJax()
function.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.