]> git.lyx.org Git - lyx.git/blobdiff - lib/examples/knitr.lyx
Merge branch 'master' of git.lyx.org:lyx
[lyx.git] / lib / examples / knitr.lyx
index ddbfe017f9393965eb65da83ee660558178d9d95..49cc2620143f966884ab219732224820d244631a 100644 (file)
@@ -1,7 +1,9 @@
-#LyX 2.1 created this file. For more info see http://www.lyx.org/
-\lyxformat 424
+#LyX 2.3 created this file. For more info see http://www.lyx.org/
+\lyxformat 544
 \begin_document
 \begin_header
+\save_transient_properties true
+\origin /systemlyxdir/examples/
 \textclass article
 \use_default_options true
 \begin_modules
@@ -12,16 +14,18 @@ knitr
 \language_package default
 \inputencoding auto
 \fontencoding global
-\font_roman palatino
-\font_sans lmss
-\font_typewriter lmtt
+\font_roman "palatino" "default"
+\font_sans "lmss" "default"
+\font_typewriter "lmtt" "default"
+\font_math "auto" "auto"
 \font_default_family default
 \use_non_tex_fonts false
 \font_sc false
 \font_osf false
-\font_sf_scale 100
-\font_tt_scale 100
-
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures false
 \graphics default
 \default_output_format default
 \output_sync 0
@@ -33,13 +37,17 @@ knitr
 \papersize default
 \use_geometry true
 \use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
 \use_package esint 1
 \use_package mathdots 1
-\use_package mathtools 0
+\use_package mathtools 1
 \use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
 \use_package undertilde 1
 \cite_engine basic
-\cite_engine_type numerical
+\cite_engine_type default
 \biblio_style plain
 \use_bibtopic false
 \use_indices false
@@ -47,6 +55,7 @@ knitr
 \suppress_date false
 \justification true
 \use_refstyle 1
+\use_minted 0
 \index Index
 \shortcut idx
 \color #008000
@@ -59,7 +68,10 @@ knitr
 \tocdepth 3
 \paragraph_separation indent
 \paragraph_indentation default
-\quotes_language english
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
 \papercolumns 1
 \papersides 1
 \paperpagestyle default
@@ -73,7 +85,8 @@ knitr
 \begin_body
 
 \begin_layout Title
-Using knitr with LyX
+Using knitr with \SpecialChar LyX
+
 \end_layout
 
 \begin_layout Author
@@ -89,6 +102,7 @@ LatexCommand href
 name "xie@yihui.name"
 target "xie@yihui.name"
 type "mailto:"
+literal "false"
 
 \end_inset
 
@@ -118,8 +132,8 @@ knitr
 \series default
  is an alternative tool to Sweave based on a different design with more
  features.
- LyX has native support to Sweave since version 2.0.0, and the support to
+ \SpecialChar LyX
+ has native support to Sweave since version 2.0.0, and the support to 
 \series bold
 knitr
 \series default
@@ -133,9 +147,10 @@ Sweave
 status open
 
 \begin_layout Plain Layout
-read the LyX/Sweave manual from 
+read the \SpecialChar LyX
+/Sweave manual from 
 \family sans
-Help\SpecialChar \menuseparator
+Help\SpecialChar menuseparator
 Specific Manuals
 \end_layout
 
@@ -145,14 +160,15 @@ Specific Manuals
 \end_layout
 
 \begin_layout Enumerate
-Open a new LyX document;
+Open a new \SpecialChar LyX
+ document;
 \end_layout
 
 \begin_layout Enumerate
 Go to 
 \family sans
-Document\SpecialChar \menuseparator
-Settings\SpecialChar \menuseparator
+Document\SpecialChar menuseparator
+Settings\SpecialChar menuseparator
 Modules
 \family default
  and insert the module named 
@@ -165,8 +181,9 @@ Rnw (knitr)
 \begin_layout Enumerate
 Then insert R code in the document with either 
 \family sans
-Insert\SpecialChar \menuseparator
-TeX Code
+Insert\SpecialChar menuseparator
+\SpecialChar TeX
+ Code
 \family default
  or the 
 \family sans
@@ -182,7 +199,7 @@ status collapsed
 
 \begin_layout Plain Layout
 
-http://yihui.github.com/knitr
+http://yihui.name/knitr
 \end_layout
 
 \end_inset
@@ -191,7 +208,27 @@ http://yihui.github.com/knitr
 \series bold
 knitr
 \series default
-; many of the examples have links to the LyX source documents.
+; many of the examples have links to the \SpecialChar LyX
+ source documents.
+\end_layout
+
+\begin_layout Standard
+Since \SpecialChar LyX
+ 2.3, it is necessary to enable the use of 
+\emph on
+needauth
+\emph default
+ converters in
+\family sans
+ Preferences\SpecialChar menuseparator
+File Handling\SpecialChar menuseparator
+Converters
+\family default
+ in order to compile with 
+\series bold
+knitr
+\series default
+.
 \end_layout
 
 \begin_layout Standard
@@ -205,32 +242,37 @@ knitr
 \end_layout
 
 \begin_layout Standard
-\begin_inset ERT
+\begin_inset Flex Chunk
 status open
 
 \begin_layout Plain Layout
 
-<<show-off>>=
-\end_layout
+\begin_inset Argument 1
+status open
 
 \begin_layout Plain Layout
 
-rnorm(5)
+show-off
+\end_layout
+
+\end_inset
+
+
 \end_layout
 
 \begin_layout Plain Layout
 
-df=data.frame(y=rnorm(100), x=1:100)
+rnorm(5)
 \end_layout
 
 \begin_layout Plain Layout
 
-summary(lm(y~x, data=df))
+df=data.frame(y=rnorm(100), x=1:100)
 \end_layout
 
 \begin_layout Plain Layout
 
-@
+summary(lm(y~x, data=df))
 \end_layout
 
 \end_inset