View source: R/ltx_placement.R
ltx_placement | R Documentation |
This function modifies the placement specifier of LaTeX tables within a provided text. It allows for verbose feedback during execution and the option to selectively replace specific table environments.
ltx_placement(
x,
tbl_placement = NULL,
print_tbl = FALSE,
verbose = TRUE,
replace_idx = NULL
)
x |
A character vector containing LaTeX code that includes
|
tbl_placement |
A string specifying the desired table placement
(e.g., |
print_tbl |
A logical indicating whether to print the modified LaTeX table to the console. Default is FALSE. |
verbose |
A logical indicating whether to provide feedback during execution. Default is TRUE. |
replace_idx |
An integer specifying which occurrence of the
|
The modified LaTeX code as a character vector, invisibly.
## Not run:
# Example LaTeX code with table environments
latex_code <- c(
"\\begin{table}",
"\\centering",
"\\begin{tabular}{cc}",
"A & B \\\\",
"1 & 2 \\\\",
"\\end{tabular}",
"\\end{table}",
"\\begin{table}",
"\\begin{tabular}{cc}",
"A & B \\\\",
"1 & 2 \\\\",
"\\end{tabular}",
"\\end{table}"
)
# Replace all table placements with '!htbp'
ltx_placement(latex_code, tbl_placement = "!htbp")
# Replace only the first table placement with 'H'
ltx_placement(latex_code, tbl_placement = "H", replace_idx = 1)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.