Description Usage Default Chunk Options Output Hook Function Option Templates Hook for Table Output Sample Code Chunk See Also
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.
1 |
The function render_pgf
sets the chunk options error = FALSE
and message = FALSE
to prevent document generation with erroneous
code.
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).
An option template pgfkey
is defined. It can be used to output
return of pgfvalue
or pgfkeyvalue
.
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.
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()
@
|
pgfvalue
, pgfkeyvalue
for a definition
of the respective S3 classes.
knit_print
for printing method for
pgfvalue
and pgfkeyvalue
class objects.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.