The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.
The goal of parseLatex
is to provide a parser for a
subset of LaTeX syntax that is more complete than what is handled by the
tools::parseLatex()
parser.
Perhaps some day it will handle all LaTeX inputs, but that’s not
likely. For now, I’m aiming to handle anything that
knitr::kable()
and the kableExtra
functions
will produce, plus related code.
A website describing the current state is here: https://dmurdoch.github.io/parseLatex/ .
You can install the development version of parseLatex from GitHub with:
# install.packages("pak")
::pak("dmurdoch/parseLatex") pak
This is a basic example.
library(parseLatex)
library(kableExtra)
<- kbl(mtcars[1:2, 1:2], format = "latex")
latex cat(latex)
#>
#> \begin{tabular}[t]{l|r|r}
#> \hline
#> & mpg & cyl\\
#> \hline
#> Mazda RX4 & 21 & 6\\
#> \hline
#> Mazda RX4 Wag & 21 & 6\\
#> \hline
#> \end{tabular}
<- parseLatex(latex)
parsed # This is a blank followed by a table; drop the blank
<- parsed[[find_env(parsed, "tabular")]]
table # Get the alignment options from the content
brace_options(get_contents(table))
#> {l|r|r}
tableCell(table, 2,2) # The title counts!
#> 21
tableCell(table, 2,2) <- "Changed!"
table#> ENVIRONMENT: \begin{tabular}[t]{l|r|r}
#> \hline
#> & mpg & cyl\\
#> \hline
#> Mazda RX4 & Changed! & 6\\
#> \hline
#> Mazda RX4 Wag & 21 & 6\\
#> \hline
#> \end{tabular}
kableExtra
does with tables, and try to make
that easier.These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.