Learn R Programming

psychmeta (version 2.7.0)

metabulate_rmd_helper: Add metabulate equation commands and LaTeX dependencies

Description

metabulate requires several lines of code to correctly render meta-analysis results table column headings and footnotes. If metabulate is used to render files directly, these are added to the internal RMarkdown document. If you use metabulate output in a larger RMarkdown document, use this function to automatically add the necessary lines of code based on your chosen output format.

Usage

metabulate_rmd_helper(latex = TRUE, html = TRUE, word_proc = TRUE)

Value

Requested commands are printed to the console.

Arguments

latex

Should required commands be included when converting to PDF, LaTeX, and related formats?

html

Should required commands be included when converting to HTML and related formats?

word_proc

Should required commands be included when converting to Word, ODT, and related formats?

PDF and LaTeX output

If latex is TRUE and you render to PDF, LaTeX, or other output formats requiring LaTeX (e.g., beamer_presentation, see knitr::is_latex_output), a YAML metadata block with a header-includes argument calling the required unicode-math LaTeX package is printed.

An RMarkdown file can only include one header-includes metadata entry. If your document already has one, set latex to FALSE and manually add add the unicode-math package to your LaTeX header instead.

(Note that header-includes is generally discouraged in favor of adding an include argument to specific output formats, see https://bookdown.org/yihui/rmarkdown/pdf-document.html#includes.)

HTML output

If html is TRUE and you render to HTML (or related formats, see knitr::is_html_output, the following LaTeX math commands are defined:

  • symit

  • symup

  • symbfit

  • symbfup

If you define your own LaTeX or MathJax macros for these commands, set html to FALSE.

Microsoft Office and LibreOffice output

If word_proc is TRUE and you render to Word or ODT (or related formats such as PowerPoint), the following LaTeX math commands are defined:

  • symit

  • symup

  • symbfit

  • symbfup

If you define your own LaTeX, Office, or OpenDocument macros for these commands, set word_proc to FALSE.

See Also

Other output functions: generate_bib(), metabulate()

Examples

Run this code
## Include this line as 'asis' output in your RMarkdown document:
metabulate_rmd_helper()

## If you've already included \usepackage{unicode-math} in your RMarkdown header
## for PDF (and related formats) header, set latex to FALSE:
metabulate_rmd_helper(latex = FALSE)

Run the code above in your browser using DataLab