Title: | Support for Knitr (Quarto/Rmd) |
---|---|
Description: | Provide support functions for Quarto and Rmd documents. |
Authors: | Pascal Burkhard [aut, cre] |
Maintainer: | Pascal Burkhard <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.1.0 |
Built: | 2024-12-26 06:17:00 UTC |
Source: | https://github.com/Nenuial/geovizr |
Install book files
book_skeleton(path)
book_skeleton(path)
path |
The path to intall the ressources to |
TRUE
book_skeleton("./")
book_skeleton("./")
eng_center_text(options)
eng_center_text(options)
options |
Chunk options |
# Not run: knitr engine for Rmd/Quarto documents eng_center_text(list(code = "Some text"))
# Not run: knitr engine for Rmd/Quarto documents eng_center_text(list(code = "Some text"))
eng_classic_box(options)
eng_classic_box(options)
options |
Chunk options |
# Not run: knitr engine for Rmd/Quarto documents eng_classic_box(list(code = "Some text"))
# Not run: knitr engine for Rmd/Quarto documents eng_classic_box(list(code = "Some text"))
eng_document_ref(options)
eng_document_ref(options)
options |
Chunk options |
A string
# Not run: knitr engine for Rmd/Quarto documents eng_document_ref(list(type = "article", author = "Some author", code = "Some text"))
# Not run: knitr engine for Rmd/Quarto documents eng_document_ref(list(type = "article", author = "Some author", code = "Some text"))
Use quarto extension with solution filter.
eng_exam_questions(options)
eng_exam_questions(options)
options |
Chunk options |
# Not run: knitr engine for Rmd/Quarto documents eng_exam_questions(code = "Some text")
# Not run: knitr engine for Rmd/Quarto documents eng_exam_questions(code = "Some text")
eng_image_legend(options)
eng_image_legend(options)
options |
Chunk options |
# Not run: knitr engine for Rmd/Quarto documents eng_image_legend(list( img.cap = "Image caption", img.width = 80, img.author = "Someone" ))
# Not run: knitr engine for Rmd/Quarto documents eng_image_legend(list( img.cap = "Image caption", img.width = 80, img.author = "Someone" ))
Raw LaTeX
eng_latex_raw(options)
eng_latex_raw(options)
options |
Chunk options Only the code part is used |
# Not run: knitr engine for Rmd/Quarto documents eng_latex_raw(list(code = "Some text with \\emph{emphasis}"))
# Not run: knitr engine for Rmd/Quarto documents eng_latex_raw(list(code = "Some text with \\emph{emphasis}"))
Create paralist
eng_legal_list(options)
eng_legal_list(options)
options |
Chunk options |
# Not run: knitr engine for Rmd/Quarto documents eng_legal_list(code = "Some text")
# Not run: knitr engine for Rmd/Quarto documents eng_legal_list(code = "Some text")
eng_wrap_figure(options)
eng_wrap_figure(options)
options |
Chunk options |
# Not run: knitr engine for Rmd/Quarto documents eng_wrap_figure(list( fig.cap = "Image caption", out.width = "80%", wrap.width = "20%" ))
# Not run: knitr engine for Rmd/Quarto documents eng_wrap_figure(list( fig.cap = "Image caption", out.width = "80%", wrap.width = "20%" ))
Plot theme for knitted documents
ggeo_knit_theme(..., theme = "doc", mode = "light")
ggeo_knit_theme(..., theme = "doc", mode = "light")
... |
Arguments passed on to
|
theme |
Name of the theme to use. One of "ghibli_mononoke", "islamic_samarquand", "pomological_green", "pomological_red", "nord_blue", "swiss_red", "purple", "doc" or "oc_exams" |
mode |
One of |
A ggplot2 theme
cars |> ggplot2::ggplot(ggplot2::aes(x = speed, y = dist)) + ggplot2::geom_point() + ggeo_knit_theme()
cars |> ggplot2::ggplot(ggplot2::aes(x = speed, y = dist)) + ggplot2::geom_point() + ggeo_knit_theme()
Book pdf
gvz_book(..., metadata = c())
gvz_book(..., metadata = c())
... |
Arguments passed on to
|
metadata |
Additional pandoc metadata |
# Not run: should be used as Rmd format in yaml frontmatter # # format: geovizir::gvz_book
# Not run: should be used as Rmd format in yaml frontmatter # # format: geovizir::gvz_book
Get the path for the book resources
gvz_book_resources()
gvz_book_resources()
A full path with the book resources, defaults to project root
# Not run: should be used in a book project gvz_book_resources()
# Not run: should be used in a book project gvz_book_resources()
Book website
gvz_bs4_book(...)
gvz_bs4_book(...)
... |
Arguments passed on to
|
# Not run: should be used as Rmd format in yaml frontmatter # # format: geovizir::gvz_bs4_book
# Not run: should be used as Rmd format in yaml frontmatter # # format: geovizir::gvz_bs4_book
Document ggeo theme
gvz_doc_theme(...)
gvz_doc_theme(...)
... |
Arguments passed on to
|
A ggplot2 theme
cars |> ggplot2::ggplot(ggplot2::aes(x = speed, y = dist)) + ggplot2::geom_point() + gvz_doc_theme()
cars |> ggplot2::ggplot(ggplot2::aes(x = speed, y = dist)) + ggplot2::geom_point() + gvz_doc_theme()
Standard pdf document
gvz_document(..., metadata = c())
gvz_document(..., metadata = c())
... |
Arguments passed on to
|
metadata |
Additional pandoc metadata |
# Not run: should be used as Rmd format in yaml frontmatter # # format: geovizir::gvz_document
# Not run: should be used as Rmd format in yaml frontmatter # # format: geovizir::gvz_document
Set useful global chunk options.
gvz_global_opts_chunk()
gvz_global_opts_chunk()
gvz_global_opts_chunk()
gvz_global_opts_chunk()
Select output depending on format
gvz_html_or_pdf(html_output, pdf_output)
gvz_html_or_pdf(html_output, pdf_output)
html_output |
Output for html format |
pdf_output |
Output for pdf format |
The selected output
# Not run: for use in Rmd/Quarto documents gvz_html_or_pdf("The <b>HTML</b> output", "The \\textbf{LaTex} output")
# Not run: for use in Rmd/Quarto documents gvz_html_or_pdf("The <b>HTML</b> output", "The \\textbf{LaTex} output")
Knit child for MF oral exams
gvz_knit_child_matu_oraux(...)
gvz_knit_child_matu_oraux(...)
... |
Data that is passed to the fragment Must have ID, Name, Subject and Question |
Knitted document
Generate latex code for table from tibble
gvz_latex_table(tbl, md_cols = c())
gvz_latex_table(tbl, md_cols = c())
tbl |
A tibble |
md_cols |
Columns to treat as markdown |
A collapsed string to use asis
# Not run: use in Rmd/Quarto document table |> gvz_latex_table()
# Not run: use in Rmd/Quarto document table |> gvz_latex_table()
LDDR pdf letter
gvz_letter(..., metadata = c())
gvz_letter(..., metadata = c())
... |
Arguments passed on to |
metadata |
Additional pandoc metadata |
# Not run: should be used as Rmd format in yaml frontmatter # # format: geovizir::gvz_letter
# Not run: should be used as Rmd format in yaml frontmatter # # format: geovizir::gvz_letter
Examen matu LDDR
gvz_matu(..., metadata = c())
gvz_matu(..., metadata = c())
... |
Arguments passed on to
|
metadata |
Additional pandoc metadata |
# Not run: should be used as Rmd format in yaml frontmatter # # format: geovizir::gvz_matu
# Not run: should be used as Rmd format in yaml frontmatter # # format: geovizir::gvz_matu
Oraux matu fédérale
gvz_matu_oraux(..., metadata = c())
gvz_matu_oraux(..., metadata = c())
... |
Arguments passed on to
|
metadata |
Additional pandoc metadata |
# Not run: should be used as Rmd format in yaml frontmatter # # format: geovizir::gvz_matu_oraux
# Not run: should be used as Rmd format in yaml frontmatter # # format: geovizir::gvz_matu_oraux
Helper to convert from Markdown to LaTeX
gvz_md_to_latex(content)
gvz_md_to_latex(content)
content |
String to convert |
A string in LaTeX
gvz_md_to_latex("Some text with **bold** and *italic* markup")
gvz_md_to_latex("Some text with **bold** and *italic* markup")
Gets presentation yaml file from GeoKey
gvz_quarto_get_presentation_yaml(path, prefix)
gvz_quarto_get_presentation_yaml(path, prefix)
path |
Path where the yaml file gets downloaded to |
prefix |
Prefix for the path on GeoKey |
# Not run: only work in quarto projects gvz_quarto_get_presentation_yaml("Presentations/", "DF")
# Not run: only work in quarto projects gvz_quarto_get_presentation_yaml("Presentations/", "DF")
Make a simple yaml file for all presentations
gvz_quarto_make_presentation_yaml()
gvz_quarto_make_presentation_yaml()
# Not run: only work in quarto projects gvz_quarto_make_presentation_yaml()
# Not run: only work in quarto projects gvz_quarto_make_presentation_yaml()
Set useful chunk options in Quarto documents.
gvz_quarto_setup()
gvz_quarto_setup()
gvz_quarto_setup()
gvz_quarto_setup()
Render all tikz diagram in PDF format
gvz_render_diagrams(source, out)
gvz_render_diagrams(source, out)
source |
Source file with tikz chunks |
out |
Path for diagram's to export to |
# Not run: needs a file with tikz chunks gvz_render_diagrams("file.Rmd", "out/directory/")
# Not run: needs a file with tikz chunks gvz_render_diagrams("file.Rmd", "out/directory/")
Render multiple files
gvz_render_multiple(data, template, output_dir, merge = FALSE)
gvz_render_multiple(data, template, output_dir, merge = FALSE)
data |
A tibble Each row will generate a new document, the data in the columns is passed as variables to be used in the template. |
template |
A quarto template |
output_dir |
The directory to render the files to |
merge |
If a string, merges the multiple document in document with the corresponding name. Default is false. |
Generate pdf files
# Read a file containing the data used in the template readr::read_csv("data_file.csv") |> gvz_render_multiple("template.qmd", "./")
# Read a file containing the data used in the template readr::read_csv("data_file.csv") |> gvz_render_multiple("template.qmd", "./")
Theme function for reveal presentations
gvz_reveal_theme(...)
gvz_reveal_theme(...)
... |
Arguments passed on to
|
A ggplot2 theme
cars |> ggplot2::ggplot(ggplot2::aes(x = speed, y = dist)) + ggplot2::geom_point() + gvz_reveal_theme()
cars |> ggplot2::ggplot(ggplot2::aes(x = speed, y = dist)) + ggplot2::geom_point() + gvz_reveal_theme()
Ski camp pdf document
gvz_ski(..., metadata = c())
gvz_ski(..., metadata = c())
... |
Arguments passed on to
|
metadata |
Additional pandoc metadata |
# Not run: should be used as Rmd format in yaml frontmatter # # format: geovizir::gvz_ski
# Not run: should be used as Rmd format in yaml frontmatter # # format: geovizir::gvz_ski
Test pdf
gvz_test(..., metadata = c())
gvz_test(..., metadata = c())
... |
Arguments passed on to
|
metadata |
Additional pandoc metadata |
# Not run: should be used as Rmd format in yaml frontmatter # # format: geovizir::gvz_test
# Not run: should be used as Rmd format in yaml frontmatter # # format: geovizir::gvz_test
Test with cover page pdf
gvz_test_folder(..., metadata = c())
gvz_test_folder(..., metadata = c())
... |
Arguments passed on to
|
metadata |
Additional pandoc metadata |
# Not run: should be used as Rmd format in yaml frontmatter # # format: geovizir::gvz_test_folder
# Not run: should be used as Rmd format in yaml frontmatter # # format: geovizir::gvz_test_folder
Knit all Rmd files in the Project
knit_all(path = here::here())
knit_all(path = here::here())
path |
The path to start at |
# Not run: use in Rmd project knit_all()
# Not run: use in Rmd project knit_all()
Custom knit function for multiple letters
knit_letters(input, ...)
knit_letters(input, ...)
input |
The input file |
... |
Unused, for compatibility in yaml frontmatter |
# Not run: this function is for use in Rmd yaml frontmatter # # knit: geovizir::knit_letters
# Not run: this function is for use in Rmd yaml frontmatter # # knit: geovizir::knit_letters
Custom Knit function for RStudio
knit_quiet(input, ...)
knit_quiet(input, ...)
input |
Input file |
... |
Unused, for compatibility in yaml frontmatter |
# Not run: this function is for use in Rmd yaml frontmatter # # knit: geovizir::knit_quiet
# Not run: this function is for use in Rmd yaml frontmatter # # knit: geovizir::knit_quiet
Get the path for the tikz template stub
tikz()
tikz()
A full path to the tikz template stub
tikz()
tikz()