View source: R/ltx_print_tbl.R
ltx_print_tbl | R Documentation |
The ltx_print_tbl
function prints a LaTeX table or text to the console and
copies the content to the system clipboard. This is useful for quickly
copying and pasting LaTeX code into a document while also optionally printing
it to the console.
ltx_print_tbl(x, print = FALSE)
x |
A character string representing LaTeX table or text that you wish to print and copy to the clipboard. |
print |
Logical. If |
The function is designed to streamline the process of working with LaTeX
tables or other formatted text. When print
is set to TRUE
, the function
prints the content of x
to the console with line breaks around the table
or text for visual clarity. It also copies the content to the system
clipboard using utils::writeClipboard()
, making it easy to paste directly
into LaTeX documents.
The function does not return any value. It performs the side effects of
printing to the console (if print
is TRUE
) and copying x
to the
clipboard.
utils::writeClipboard()
## Not run:
# Example LaTeX table string
tbl <- "\\begin{tabular}{|c|c|}\n\\hline\nA & B \\\\\n\\hline\n1 & 2 \\\\\n\\hline\n\\end{tabular}"
# Print and copy the table to clipboard
ltx_print_tbl(tbl, print = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.