根据FAQ.7和Example.038,我应该能够通过全局选项options(width=40)或块选项来控制我的宽度tidy.opts(width.cutoff=40).然而,文本仍然在灰色框中运行,在我目前的情况下,我有两列beamer幻灯片.源代码进入下一列.除了关闭整洁tidy=FALSE并在我的代码中手动设置中断之外,还有什么我可以做的吗?
最小的工作示例:
\documentclass[8pt]{beamer}
\begin{document}
\begin{frame}[fragile]
<<>>=
library(reshape2)
options(width=38)
@
\begin{columns}[t]
\column{.5\textwidth}
<<>>=
dataframe <- data.frame(Column1=1:10,Column2=1:10,Variable=1:10,Value=1:10)
@
\column{.5\textwidth}
<<>>=
dataframe <- melt(dataframe,
id.vars=c("Column1","Column2"),
variable.name="Variable",
value.name="Value")
@
\end{columns}
\end{frame}
\end{document}
Run Code Online (Sandbox Code Playgroud)
输出(问题是列一起运行):

选项应该像这样传递:
<<echo=FALSE>>=
opts_chunk$set(comment="", message=FALSE,tidy.opts=list(keep.blank.line=TRUE, width.cutoff=120),options(width=100), cache=TRUE,fig.align='center',fig.height=6, fig.width=10,fig.path='figure/beamer-',fig.show='hold',size='footnotesize', cache=TRUE)
@
Run Code Online (Sandbox Code Playgroud)
在这里,您指定width.cutoff代码和widthr结果.