]> git.lyx.org Git - lyx.git/blobdiff - lib/examples/sweave.lyx
update FUNs.lyx
[lyx.git] / lib / examples / sweave.lyx
index b668753e0132b546a88ed21def6729ab40d00c7b..ccf0f070cadf6ef4ca96c2f050e942126a0c0f6f 100644 (file)
@@ -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 462
 \begin_document
 \begin_header
 \textclass article
@@ -27,13 +27,13 @@ sweave
 \font_roman palatino
 \font_sans lmss
 \font_typewriter lmtt
+\font_math auto
 \font_default_family default
 \use_non_tex_fonts false
 \font_sc false
 \font_osf false
 \font_sf_scale 100
 \font_tt_scale 100
-
 \graphics default
 \default_output_format default
 \output_sync 0
@@ -44,15 +44,23 @@ sweave
 \use_hyperref false
 \papersize default
 \use_geometry true
-\use_amsmath 1
-\use_esint 1
-\use_mhchem 1
-\use_mathdots 1
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 0
+\use_package mhchem 1
+\use_package stackrel 0
+\use_package stmaryrd 0
+\use_package undertilde 0
 \cite_engine basic
+\cite_engine_type numerical
+\biblio_style plain
 \use_bibtopic false
 \use_indices false
 \paperorientation portrait
 \suppress_date false
+\justification true
 \use_refstyle 0
 \index Index
 \shortcut idx
@@ -197,19 +205,7 @@ Since LyX 2.0, Sweave can be used out of the box with any document class
 \family sans
 Sweave
 \family default
- module, which means we no longer need to modify the 
-\family sans
-preferences
-\family default
- file manually or add special layouts such as 
-\family sans
-literate-article.layout
-\family default
- and 
-\family sans
-literate-book.layout
-\family default
- like we did before.
+ module.
  We can add the 
 \family sans
 Sweave
@@ -765,7 +761,7 @@ sideways false
 status open
 
 \begin_layout Plain Layout
-\begin_inset Caption
+\begin_inset Caption Standard
 
 \begin_layout Plain Layout
 Quantiles of the first four variables in the 
@@ -895,12 +891,23 @@ status open
 
 \begin_layout Plain Layout
 \align center
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+Both eps and pdf are set to true so that both latex and pdflatex work.
+ In practice, you would probably just choose one.
+\end_layout
+
+\end_inset
+
+
 \begin_inset ERT
 status open
 
 \begin_layout Plain Layout
 
-<<iris-pairs,fig=TRUE,width=4.5,height=4.5>>=
+<<iris-pairs,fig=TRUE,width=4.5,height=4.5,eps=TRUE,pdf=TRUE>>=
 \end_layout
 
 \begin_layout Plain Layout
@@ -919,7 +926,7 @@ pairs(iris, col = iris$Species)
 \end_layout
 
 \begin_layout Plain Layout
-\begin_inset Caption
+\begin_inset Caption Standard
 
 \begin_layout Plain Layout
 Scatter plot matrix of the 
@@ -959,7 +966,7 @@ status open
 
 \begin_layout Plain Layout
 
-<<iris-boxplots,fig=TRUE,width=7,height=2,keep.source=F>>=
+<<iris-boxplots,fig=TRUE,width=7,height=2,keep.source=F,eps=T,pdf=T>>=
 \end_layout
 
 \begin_layout Plain Layout
@@ -983,7 +990,7 @@ boxplot(Sepal.Length~Species,data=iris,horizontal=TRUE,xlab='Sepal.Length')
 \end_layout
 
 \begin_layout Plain Layout
-\begin_inset Caption
+\begin_inset Caption Standard
 
 \begin_layout Plain Layout
 Boxplots of sepal length grouped by species.
@@ -1507,43 +1514,24 @@ How to use Sweave with beamer?
 \end_layout
 
 \begin_layout Standard
-You will end up with LaTeX errors if you use Sweave in beamer slides in
- LyX; the reason is the beamer frame that contains verbatim R code and output
- must have the 
+You will end up with LaTeX errors if you use Sweave in normal beamer slides
+ in LyX; the reason is the beamer frame that contains verbatim R code.
+ The solution is to use a 
+\emph on
+FragileFrame
+\emph default
+ instead of a normal 
+\emph on
+Frame
+\emph default
+, or to pass the option 
 \family typewriter
 fragile
 \family default
- option.
- However, currently there is no straightforward way to do this.
- One way is to write raw TeX code, and the other is to use the 
-\family sans
-beamer-fragile.module
-\family default
- discussed in 
-\begin_inset CommandInset href
-LatexCommand href
-name "#7273"
-target "http://www.lyx.org/trac/ticket/7273"
-
-\end_inset
-
- (put this file under the 
-\family sans
-layouts
-\family default
- directory of LyX user directory and reconfigure LyX).
- After including this module in your document, you should be able to use
+ to the frame title via 
 \family sans
 Insert\SpecialChar \menuseparator
-Custom Insets\SpecialChar \menuseparator
-FragileFrame
-\family default
-, which is essentially 
-\family typewriter
-
-\backslash
-begin{frame}[fragile]
+Frame Options
 \family default
 .
 \end_layout