Merge branch 'ja_knitr_sweave_updates'

This merges updates from Koji Yokota, and adapts the ctests
accordingly.
This commit is contained in:
Scott Kostyshak 2018-01-15 17:01:28 -05:00
commit 299b730318
3 changed files with 201 additions and 107 deletions

View File

@ -54,6 +54,11 @@ export/.*/zh_CN/.*texF
# see also INVERTED.TODO_export/export/latex/ja_wrong_auto_encoding_(dvi|pdf(|3)).* # see also INVERTED.TODO_export/export/latex/ja_wrong_auto_encoding_(dvi|pdf(|3)).*
# For a discussion of alternatives for Japanese with LaTeX , see also # For a discussion of alternatives for Japanese with LaTeX , see also
# http://www.preining.info/blog/2014/12/writing-japanese-in-latex-part-1-introduction/ # http://www.preining.info/blog/2014/12/writing-japanese-in-latex-part-1-introduction/
#
# Exception: ja knitr.lyx and sweave.lyx support only XeLaTeX with system fonts
# because they use the "bxjsarticle" class
!export/.*/ja/(knitr|sweave).*_(lyx.*|xhtml|pdf4_systemF)
export/.*/ja/(knitr|sweave).*
export/.*/ja/.*_(pdf[245]|dvi3).* export/.*/ja/.*_(pdf[245]|dvi3).*
# These files are not expected to compile, they use math-macros # These files are not expected to compile, they use math-macros

View File

@ -4,7 +4,7 @@
\begin_header \begin_header
\save_transient_properties true \save_transient_properties true
\origin /systemlyxdir/examples/ja/ \origin /systemlyxdir/examples/ja/
\textclass article \textclass bxjsarticle
\use_default_options true \use_default_options true
\begin_modules \begin_modules
knitr knitr
@ -12,14 +12,14 @@ knitr
\maintain_unincluded_children false \maintain_unincluded_children false
\language japanese \language japanese
\language_package default \language_package default
\inputencoding auto \inputencoding utf8-platex
\fontencoding global \fontencoding global
\font_roman "palatino" "default" \font_roman "palatino" "default"
\font_sans "lmss" "default" \font_sans "lmss" "default"
\font_typewriter "lmtt" "default" \font_typewriter "lmtt" "default"
\font_math "auto" "auto" \font_math "auto" "auto"
\font_default_family default \font_default_family default
\use_non_tex_fonts false \use_non_tex_fonts true
\font_sc false \font_sc false
\font_osf false \font_osf false
\font_sf_scale 100 100 \font_sf_scale 100 100
@ -210,6 +210,25 @@ knitr
ソース文書へのリンクがあります。 ソース文書へのリンクがあります。
\end_layout \end_layout
\begin_layout Standard
\SpecialChar LyX
2.3以降、
\series bold
knitr
\series default
を使ってコンパイルするためには
\family sans
設定\SpecialChar menuseparator
ファイル処理\SpecialChar menuseparator
変換子
\family default
\emph on
needauth
\emph default
変換子の使用を可能にする必要があります。
\end_layout
\begin_layout Standard \begin_layout Standard
\series bold \series bold
@ -220,12 +239,22 @@ knitr
\end_layout \end_layout
\begin_layout Standard \begin_layout Standard
\begin_inset ERT \begin_inset Flex Chunk
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
<<show-off>>= \begin_inset Argument 1
status open
\begin_layout Plain Layout
show-off
\end_layout
\end_inset
\end_layout \end_layout
\begin_layout Plain Layout \begin_layout Plain Layout
@ -243,11 +272,6 @@ df=data.frame(y=rnorm(100), x=1:100)
summary(lm(y~x, data=df)) summary(lm(y~x, data=df))
\end_layout \end_layout
\begin_layout Plain Layout
@
\end_layout
\end_inset \end_inset

View File

@ -4,7 +4,7 @@
\begin_header \begin_header
\save_transient_properties true \save_transient_properties true
\origin /systemlyxdir/examples/ja/ \origin /systemlyxdir/examples/ja/
\textclass jarticle \textclass bxjsarticle
\begin_preamble \begin_preamble
%% maxwidth is the original width if it's less than linewidth %% maxwidth is the original width if it's less than linewidth
%% otherwise use linewidth (to make sure the graphics do not exceed the margin) %% otherwise use linewidth (to make sure the graphics do not exceed the margin)
@ -31,7 +31,7 @@ sweave
\font_typewriter "lmtt" "default" \font_typewriter "lmtt" "default"
\font_math "auto" "auto" \font_math "auto" "auto"
\font_default_family default \font_default_family default
\use_non_tex_fonts false \use_non_tex_fonts true
\font_sc false \font_sc false
\font_osf false \font_osf false
\font_sf_scale 100 100 \font_sf_scale 100 100
@ -303,12 +303,22 @@ bin
\end_layout \end_layout
\begin_layout Standard \begin_layout Standard
\begin_inset ERT \begin_inset Flex Chunk
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
<<where-is-R-bin,eval=FALSE>>= \begin_inset Argument 1
status open
\begin_layout Plain Layout
where-is-R-bin,eval=FALSE
\end_layout
\end_inset
\end_layout \end_layout
\begin_layout Plain Layout \begin_layout Plain Layout
@ -316,11 +326,6 @@ status open
R.home('bin') R.home('bin')
\end_layout \end_layout
\begin_layout Plain Layout
@
\end_layout
\end_inset \end_inset
@ -355,12 +360,22 @@ Sweave.sty
\end_layout \end_layout
\begin_layout Standard \begin_layout Standard
\begin_inset ERT \begin_inset Flex Chunk
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
<<sweave-sty,eval=FALSE>>= \begin_inset Argument 1
status open
\begin_layout Plain Layout
sweave-sty,eval=FALSE
\end_layout
\end_inset
\end_layout \end_layout
\begin_layout Plain Layout \begin_layout Plain Layout
@ -368,11 +383,6 @@ status open
file.path(R.home('share'), 'texmf', 'tex', 'latex') file.path(R.home('share'), 'texmf', 'tex', 'latex')
\end_layout \end_layout
\begin_layout Plain Layout
@
\end_layout
\end_inset \end_inset
@ -463,12 +473,22 @@ useFancyQuotes
\end_layout \end_layout
\begin_layout Standard \begin_layout Standard
\begin_inset ERT \begin_inset Flex Chunk
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
<<setup, keep.source=TRUE>>= \begin_inset Argument 1
status open
\begin_layout Plain Layout
setup, keep.source=TRUE
\end_layout
\end_inset
\end_layout \end_layout
\begin_layout Plain Layout \begin_layout Plain Layout
@ -481,14 +501,28 @@ status open
options(width = 70, useFancyQuotes = FALSE, digits = 4) options(width = 70, useFancyQuotes = FALSE, digits = 4)
\end_layout \end_layout
\begin_layout Plain Layout \end_inset
@
\end_layout \end_layout
\begin_layout Standard
\begin_inset Flex Chunk
status open
\begin_layout Plain Layout \begin_layout Plain Layout
<<sweave-manual, eval=FALSE, keep.source=TRUE>>= \begin_inset Argument 1
status open
\begin_layout Plain Layout
sweave-manual, eval=FALSE, keep.source=TRUE
\end_layout
\end_inset
\end_layout \end_layout
\begin_layout Plain Layout \begin_layout Plain Layout
@ -501,9 +535,23 @@ options(width = 70, useFancyQuotes = FALSE, digits = 4)
vignette("Sweave", package = "utils") vignette("Sweave", package = "utils")
\end_layout \end_layout
\end_inset
下記は、どのSエンジンでも動作する単純な例です。
\end_layout
\begin_layout Standard
\begin_inset Flex Chunk
status open
\begin_layout Plain Layout \begin_layout Plain Layout
@ \begin_inset Argument 1
status open
\begin_layout Plain Layout
print-integers, keep.source=TRUE
\end_layout \end_layout
\end_inset \end_inset
@ -511,19 +559,6 @@ vignette("Sweave", package = "utils")
\end_layout \end_layout
\begin_layout Standard
下記は、どのSエンジンでも動作する単純な例です。
\end_layout
\begin_layout Standard
\begin_inset ERT
status open
\begin_layout Plain Layout
<<print-integers, keep.source=TRUE>>=
\end_layout
\begin_layout Plain Layout \begin_layout Plain Layout
## 1から10までの整数は ## 1から10までの整数は
@ -534,14 +569,28 @@ status open
1:10 1:10
\end_layout \end_layout
\begin_layout Plain Layout \end_inset
@
\end_layout \end_layout
\begin_layout Standard
\begin_inset Flex Chunk
status open
\begin_layout Plain Layout \begin_layout Plain Layout
<<hide-results, results=hide>>= \begin_inset Argument 1
status open
\begin_layout Plain Layout
hide-results, results=hide
\end_layout
\end_inset
\end_layout \end_layout
\begin_layout Plain Layout \begin_layout Plain Layout
@ -554,9 +603,23 @@ status open
print(1:20) print(1:20)
\end_layout \end_layout
\end_inset
単純な計算機をエミュレートすることもできます。
\end_layout
\begin_layout Standard
\begin_inset Flex Chunk
status open
\begin_layout Plain Layout \begin_layout Plain Layout
@ \begin_inset Argument 1
status open
\begin_layout Plain Layout
calculator
\end_layout \end_layout
\end_inset \end_inset
@ -564,19 +627,6 @@ print(1:20)
\end_layout \end_layout
\begin_layout Standard
単純な計算機をエミュレートすることもできます。
\end_layout
\begin_layout Standard
\begin_inset ERT
status open
\begin_layout Plain Layout
<<calculator>>=
\end_layout
\begin_layout Plain Layout \begin_layout Plain Layout
1 + pi 1 + pi
@ -587,11 +637,6 @@ status open
sin(pi/6) sin(pi/6)
\end_layout \end_layout
\begin_layout Plain Layout
@
\end_layout
\end_inset \end_inset
@ -602,12 +647,22 @@ sin(pi/6)
\end_layout \end_layout
\begin_layout Standard \begin_layout Standard
\begin_inset ERT \begin_inset Flex Chunk
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
<<rnorm>>= \begin_inset Argument 1
status open
\begin_layout Plain Layout
rnorm
\end_layout
\end_inset
\end_layout \end_layout
\begin_layout Plain Layout \begin_layout Plain Layout
@ -630,11 +685,6 @@ print(x)
t1 <- t.test(x) t1 <- t.test(x)
\end_layout \end_layout
\begin_layout Plain Layout
@
\end_layout
\end_inset \end_inset
@ -728,12 +778,22 @@ iris
\end_layout \end_layout
\begin_layout Standard \begin_layout Standard
\begin_inset ERT \begin_inset Flex Chunk
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
<<iris-summary>>= \begin_inset Argument 1
status open
\begin_layout Plain Layout
iris-summary
\end_layout
\end_inset
\end_layout \end_layout
\begin_layout Plain Layout \begin_layout Plain Layout
@ -741,11 +801,6 @@ status open
summary(iris[,-5]) summary(iris[,-5])
\end_layout \end_layout
\begin_layout Plain Layout
@
\end_layout
\end_inset \end_inset
@ -782,16 +837,22 @@ name "tab:xtable-demo"
\begin_layout Plain Layout \begin_layout Plain Layout
\align center \align center
\begin_inset ERT \begin_inset Flex Chunk
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
\end_layout \begin_inset Argument 1
status open
\begin_layout Plain Layout \begin_layout Plain Layout
<<xtable-demo,results=tex,echo=FALSE>>= xtable-demo,results=tex,echo=FALSE
\end_layout
\end_inset
\end_layout \end_layout
\begin_layout Plain Layout \begin_layout Plain Layout
@ -810,11 +871,6 @@ print(xtable(sapply(iris[,-5], quantile)), floating=FALSE)
)') )')
\end_layout \end_layout
\begin_layout Plain Layout
@
\end_layout
\end_inset \end_inset
@ -889,12 +945,22 @@ epsとpdfの両方をtrueにして、latexとpdflatexの両方を動作するよ
\end_inset \end_inset
\begin_inset ERT \begin_inset Flex Chunk
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
<<iris-pairs,fig=TRUE,width=4.5,height=4.5,eps=TRUE,pdf=TRUE>>= \begin_inset Argument 1
status open
\begin_layout Plain Layout
iris-pairs,fig=TRUE,width=4.5,height=4.5,eps=TRUE,pdf=TRUE
\end_layout
\end_inset
\end_layout \end_layout
\begin_layout Plain Layout \begin_layout Plain Layout
@ -902,11 +968,6 @@ status open
pairs(iris, col = iris$Species) pairs(iris, col = iris$Species)
\end_layout \end_layout
\begin_layout Plain Layout
@
\end_layout
\end_inset \end_inset
@ -948,12 +1009,22 @@ status open
\begin_layout Plain Layout \begin_layout Plain Layout
\align center \align center
\begin_inset ERT \begin_inset Flex Chunk
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
<<iris-boxplots,fig=TRUE,width=7,height=2,keep.source=F,eps=T,pdf=T>>= \begin_inset Argument 1
status open
\begin_layout Plain Layout
iris-boxplots,fig=TRUE,width=7,height=2,keep.source=F,eps=T,pdf=T
\end_layout
\end_inset
\end_layout \end_layout
\begin_layout Plain Layout \begin_layout Plain Layout
@ -966,11 +1037,6 @@ par(mar=c(4,5,.1,.3), las=1)
boxplot(Sepal.Length~Species,data=iris,horizontal=TRUE,xlab='Sepal.Length') boxplot(Sepal.Length~Species,data=iris,horizontal=TRUE,xlab='Sepal.Length')
\end_layout \end_layout
\begin_layout Plain Layout
@
\end_layout
\end_inset \end_inset
@ -1409,7 +1475,7 @@ reference "tab:xtable-demo"
\end_layout \end_layout
\begin_layout Standard \begin_layout Standard
The user manual of Sweave is at Sweaveの利用者の手引きは
\begin_inset Flex URL \begin_inset Flex URL
status collapsed status collapsed
@ -1420,8 +1486,7 @@ https://stat.ethz.ch/R-manual/R-devel/library/utils/doc/Sweave.pdf
\end_inset \end_inset
にあります。 The CRAN task view on 「Reproducible Research」にあるCRANタスクビューには、便利と思われるSweav にあります。「Reproducible Research」にあるCRANタスクビューには、便利と思われるSweave関連パッケージの一覧があります。
e関連パッケージの一覧があります。
\begin_inset Flex URL \begin_inset Flex URL
status collapsed status collapsed