render_pgf: Set Output Hooks for knitr

Description Usage Default Chunk Options Output Hook Function Option Templates Hook for Table Output Sample Code Chunk See Also

Description

The function render_pgf can be used to set up output hooks for the use with knitr. It is based on the render_latex() function of the knitr package and should therefore only be used with LaTeX output format.

Usage

1

Default Chunk Options

The function render_pgf sets the chunk options error = FALSE and message = FALSE to prevent document generation with erroneous code.

Output Hook Function

The hook function output is extended by an additional boolean option skip_lines. If TRUE double line skips are removed and the line skip at the end of the output is removed to. This is used for the output of tables (which must not have an empty line at the end).

Option Templates

An option template pgfkey is defined. It can be used to output return of pgfvalue or pgfkeyvalue.

Hook for Table Output

The output hook-function pgfplotstable can be used to set input for tables using the LaTeX-command \pgfplotstableread. The argument to the hook is the name of the LaTeX command the table will be stored in.

Sample Code Chunk

The following code chunk can be used at the beginning of the document to initialize pgf-rendering.

1
2
3
<<setup, include = FALSE>>=
 render_pgf()
 @

See Also

pgfvalue, pgfkeyvalue for a definition of the respective S3 classes.

knit_print for printing method for pgfvalue and pgfkeyvalue class objects.


mlkornexl/pgfKeys documentation built on May 14, 2019, 2:17 p.m.