Skip to contents

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, TRUE to number headings. Defaults to FALSE.

toc

Logical, TRUE (default) to include a table of contents. The title is set with pandoc variable toc-title in YAML header.

template

Character, path to the .tex template used by the format. Defaults to standard Schola template bundled in the package. Changes discouraged.

latex_engine

Character, engine used for .md to .pdf conversion. Only xelatex (the default) and lualatex are supported because of custom fonts. Changes discouraged.

fig_crop

logical, whether to crop PDF figures. Defaults to FALSE. Requires the tools pdfcrop and ghostscript to be installed, if TRUE.

document_class

Character, one of standard LaTeX document class. Defaults to report. Changes discouraged.

...

Arguments passed on to rmarkdown::pdf_document

toc_depth

Depth of headers to include in table of contents

fig_width

Default width (in inches) for figures

fig_caption

TRUE to render figures with captions

df_print

Method 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, typically print.data.frame. The "kable" method uses the knitr::kable function. 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 the df_print behavior entirely by setting the option rmarkdown.df_print to FALSE. See Data frame printing section in bookdown book for examples.

highlight

Syntax 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 NULL to prevent syntax highlighting.

keep_tex

Keep 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 .tex to .pdf. To keep these files, you may set options(tinytex.clean = FALSE).

keep_md

Keep the markdown file generated by knitting.

citation_package

The LaTeX package to process citations, natbib or biblatex. Use default if neither package is to be used, which means citations will be processed via the command pandoc-citeproc.

includes

Named list of additional content to include within the document (typically created using the includes function).

md_extensions

Markdown extensions to be added or removed from the default definition of R Markdown. See the rmarkdown_format for additional details.

output_extensions

Pandoc extensions to be added or removed from the output format, e.g., "-smart" means the output format will be latex-smart.

pandoc_args

Additional command line options to pass to pandoc

extra_dependencies

A 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_word2(), schola_word()

Author

Jan Netik

Examples

if (FALSE) {
# in YAML header ------
output:
reschola::schola_pdf:
toc:false
}