Functions related to parsing LaTeX tables
Value
is_Tabular()
returns boolean indicating if this is
a tabular-like environment.
find_tabular()
returns the index of the first
tabular-like environment, or NA
if none is found.
Examples
latex <- kableExtra::kbl(mtcars[1:2, 1:2], format = "latex")
parsed <- parseLatex(latex)
is_Tabular(parsed[[2]])
#> [1] TRUE
find_tabular(parsed)
#> [1] 2
table <- parsed[[find_tabular(parsed)]]
table
#> ENVIRONMENT: \begin{tabular}[t]{l|r|r}
#> \hline
#> & mpg & cyl\\
#> \hline
#> Mazda RX4 & 21 & 6\\
#> \hline
#> Mazda RX4 Wag & 21 & 6\\
#> \hline
#> \end{tabular}