write_tex | R Documentation |
This function writes a character vector to a .tex file. It ensures the specified path has a .tex extension, checks for directory existence, and allows for overwriting existing files with user feedback.
write_tex(x, path, verbose = TRUE)
x |
A character vector to write to the file. |
path |
A character string specifying the file path. Should be a valid path for a .tex file. |
verbose |
A logical value indicating whether to print messages and warnings. Default is TRUE. |
The function returns the input character vector invisibly.
## Not run:
# Write a simple LaTeX document
write_tex(c("\\documentclass{article}", "\\begin{document}", "Hello, world!", "\\end{document}"),
"output/document.tex")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.