Skip to content

Commit

Permalink
hook_rgl has been moved to the rgl package
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed Jan 6, 2016
1 parent 982b80a commit b696030
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 11 deletions.
3 changes: 2 additions & 1 deletion inst/examples/knitr-manual.Rnw
Original file line number Diff line number Diff line change
Expand Up @@ -631,9 +631,10 @@ The \textbf{knitr} package is ready for customization. Both the patterns
and hooks can be customized; see the package website for details.
Here I show an example on how to save \textbf{rgl} plots \citep{R-rgl}
using a customized hook function. First we define a hook named \texttt{rgl}
using the function \emph{hook\_rgl()} in \textbf{knitr}:
using the function \emph{hook\_rgl()} in \textbf{rgl}:

<<rgl-demo>>=
library(rgl)
knit_hooks$set(rgl = hook_rgl)
head(hook_rgl) # the hook function is defined as this
@
Expand Down
34 changes: 24 additions & 10 deletions inst/examples/knitr-manual.lyx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#LyX 2.0 created this file. For more info see http://www.lyx.org/
\lyxformat 413
#LyX 2.1 created this file. For more info see http://www.lyx.org/
\lyxformat 474
\begin_document
\begin_header
\textclass article
Expand All @@ -23,13 +23,13 @@ knitr
\font_roman palatino
\font_sans lmss
\font_typewriter lmtt
\font_math auto
\font_default_family default
\use_non_tex_fonts false
\font_sc true
\font_osf false
\font_sf_scale 100
\font_tt_scale 100

\graphics default
\default_output_format default
\output_sync 0
Expand All @@ -50,15 +50,24 @@ knitr
\pdf_quoted_options "pdfstartview={XYZ null null 1}"
\papersize default
\use_geometry true
\use_amsmath 1
\use_esint 1
\use_mhchem 1
\use_mathdots 1
\cite_engine natbib_authoryear
\use_package amsmath 1
\use_package amssymb 1
\use_package cancel 1
\use_package esint 1
\use_package mathdots 1
\use_package mathtools 1
\use_package mhchem 1
\use_package stackrel 1
\use_package stmaryrd 1
\use_package undertilde 1
\cite_engine natbib
\cite_engine_type authoryear
\biblio_style plainnat
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 1
\index Index
\shortcut idx
Expand Down Expand Up @@ -323,7 +332,7 @@ qplot(speed, dist, data=cars)+geom_smooth()
\end_layout

\begin_layout Plain Layout
\begin_inset Caption
\begin_inset Caption Standard

\begin_layout Plain Layout
\begin_inset CommandInset label
Expand Down Expand Up @@ -2599,7 +2608,7 @@ hook_rgl()
\emph default
in
\series bold
knitr
rgl
\series default
:
\end_layout
Expand All @@ -2615,6 +2624,11 @@ status open

\begin_layout Plain Layout

library(rgl)
\end_layout

\begin_layout Plain Layout

knit_hooks$set(rgl = hook_rgl)
\end_layout

Expand Down

0 comments on commit b696030

Please sign in to comment.