RStudio
によって生成されたlatex
ファイルを編集しようとしていますが、RStudio
で生成されたファイルはそのままコンパイルされません。ここで RStudioで生成されたlatexファイルをコンパイルする
---
title: "Untitled"
author: "SN248"
date: "April 17, 2016"
output:
beamer_presentation:
keep_tex: true
theme: "CambridgeUS"
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## R Markdown
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
Some code
```{r eval=FALSE, echo=TRUE}
install.packages("mypackage")
library(mypackage)
```
## Including Plots
You can also embed plots, for example:
```{r pressure, echo=TRUE}
plot(pressure)
```
Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.
注意を私は中間tex
ファイルを取得するためにkeep_tex: true
を追加したこと、(私は私のスライドのコードを表示したいと少し編集した)で、生成されたtex
ファイルは以下に貼り付けられます:
\begin{frame}[fragile]{R Markdown}
This is an R Markdown document. Markdown is a simple formatting syntax
for authoring HTML, PDF, and MS Word documents. For more details on
using R Markdown see \url{http://rmarkdown.rstudio.com}.
Some code
\begin{Shaded}
\begin{Highlighting}[]
\KeywordTok{install.packages}\NormalTok{(}\StringTok{"mypackage"}\NormalTok{)}
\KeywordTok{library}\NormalTok{(mypackage)}
\end{Highlighting}
\end{Shaded}
\end{frame}
\begin{frame}[fragile]{Including Plots}
You can also embed plots, for example:
\begin{Shaded}
\begin{Highlighting}[]
\KeywordTok{plot}\NormalTok{(pressure)}
\end{Highlighting}
\end{Shaded}
\includegraphics{Untitled_files/figure-beamer/pressure-1.pdf}
Note that the \texttt{echo\ =\ FALSE} parameter was added to the code
chunk to prevent printing of the R code that generated the plot.
\end{frame}
私は、生成さtex
ファイルは、箱から出してコンパイルされないことに気づきました。それは
\documentclass[hyperref={pdfpagelabels=false}]{beamer}
\usepackage{lmodern}
\usepackage{listings}
\usetheme{CambridgeUS}
\begin{document}
...
\end{document}
をコンパイルするようので、私はコンパイルされません、私はまだ少しbegin{Shaded}
としてこのtex
ファイルをコンパイルすることはできませんよ必要なビット(コードハイライトするためのすなわち、パッケージlistings
)を加え、私は次のエラーを取得します:
LaTeX Error: Environment Shaded undefined
私の質問は、箱から出してコンパイルRStudio
からtex
ファイルを生成する方法、です。そうでない場合は、パッケージには、私はただ、いくつかのコンテキストを与えること
\begin{Shaded}
\begin{Highlighting}[]
\KeywordTok{install.packages}\NormalTok{(}\StringTok{"mypackage"}\NormalTok{)}
\KeywordTok{library}\NormalTok{(mypackage)}
\end{Highlighting}
\end{Shaded}
の下に示す(特にハイライトとコードを表示するように)tex
コードをコンパイルするために使用すべき、私はセクションを追加できるようにtex
ファイルをコンパイルしようとしていますとtex
コードのサブセクション、私はファイルでそれを行う方法がわかりません。
ありがとうございました。
SN248