Function called in the output section of the YAML header (see examples
below), instructing knitr to use the standard Schola PDF document format.
If you run into any problem using the Czech language, consult this function
details first.
Usage
schola_pdf(
num_format = NULL,
number_sections = FALSE,
toc = TRUE,
template = find_resource("schola_pdf", "schola_template.tex"),
latex_engine = "xelatex",
fig_crop = FALSE,
document_class = "report",
...
)Arguments
- num_format
Character, if
cs, Czech number formatting is used. Other values are currently ignored and will result in default options.- number_sections
Logical,
TRUEto number headings. Defaults toFALSE.- toc
Logical,
TRUE(default) to include a table of contents. The title is set withpandocvariabletoc-titlein YAML header.- template
Character, path to the
.textemplate used by the format. Defaults to standard Schola template bundled in the package. Changes discouraged.- latex_engine
Character, engine used for
.mdto.pdfconversion. Onlyxelatex(the default) andlualatexare supported because of custom fonts. Changes discouraged.- fig_crop
logical, whether to crop PDF figures. Defaults to
FALSE. Requires the toolspdfcropandghostscriptto be installed, ifTRUE.- document_class
Character, one of standard LaTeX document class. Defaults to
report. Changes discouraged.- ...
Arguments passed on to
rmarkdown::pdf_documenttoc_depthDepth of headers to include in table of contents
fig_widthDefault width (in inches) for figures
fig_captionTRUEto render figures with captionsdf_printMethod to be used for printing data frames. Valid values include "default", "kable", "tibble", and "paged". The "default" method uses a corresponding S3 method of
print, typicallyprint.data.frame. The "kable" method uses theknitr::kablefunction. The "tibble" method uses the tibble package to print a summary of the data frame. The "paged" method creates a paginated HTML table (note that this method is only valid for formats that produce HTML). In addition to the named methods you can also pass an arbitrary function to be used for printing data frames. You can disable thedf_printbehavior entirely by setting the optionrmarkdown.df_printtoFALSE. See Data frame printing section in bookdown book for examples.highlightSyntax highlighting style passed to Pandoc.
Supported built-in styles include "default", "tango", "pygments", "kate", "monochrome", "espresso", "zenburn", "haddock", and "breezedark".
Two custom styles are also included, "arrow", an accessible color scheme, and "rstudio", which mimics the default IDE theme. Alternatively, supply a path to a .theme file to use a custom Pandoc style. Note that custom theme requires Pandoc 2.0+.
Pass
NULLto prevent syntax highlighting.keep_texKeep the intermediate tex file used in the conversion to PDF. Note that this argument does not control whether to keep the auxiliary files (e.g.,
.aux) generated by LaTeX when compiling.texto.pdf. To keep these files, you may setoptions(tinytex.clean = FALSE).keep_mdKeep the markdown file generated by knitting.
citation_packageThe LaTeX package to process citations,
natbiborbiblatex. Usedefaultif neither package is to be used, which means citations will be processed via the commandpandoc-citeproc.includesNamed list of additional content to include within the document (typically created using the
includesfunction).md_extensionsMarkdown extensions to be added or removed from the default definition of R Markdown. See the
rmarkdown_formatfor additional details.output_extensionsPandoc extensions to be added or removed from the output format, e.g.,
"-smart"means the output format will belatex-smart.pandoc_argsAdditional command line options to pass to pandoc
extra_dependenciesA LaTeX dependency
latex_dependency(), a list of LaTeX dependencies, a character vector of LaTeX package names (e.g.c("framed", "hyperref")), or a named list of LaTeX package options with the names being package names (e.g.list(hyperef = c("unicode=true", "breaklinks=true"), lmodern = NULL)). It can be used to add custom LaTeX packages to the .tex header.
Value
A modified bookdown::pdf_document2 with the standard Schola
formatting.
Package babel hyphenation warning
You may encounter a following warning when your document is being "compiled"
to .pdf format:
Warning: Package babel Warning: No hyphenation patterns were preloaded for
Warning: (babel) the language 'Czech' into the format.
Warning: (babel) Please, configure your TeX system to add them and
Warning: (babel) rebuild the format. Now I will use the patterns
Warning: (babel) preloaded for \language=0 instead on input line 53.This usually solves by calling tinytex::tlmgr_install("hyphen-czech") (if
you are a {tinytex} user).
See also
Other Report templates and formats:
copy_schola_template(),
open_schola_template(),
schola_word(),
schola_word2()