针织 Rnw latex : how to obtain a figure and caption in landscape mode that's full page width

标签 knitr pdflatex rnw

我正在尝试在横向模式下制作一个整页图以及标题。如果我省略“fig.cap='Caption Trial'”,下面的 Rnw 文件可以正常工作,但如果使用了标题,则不行。任何帮助将不胜感激。

\documentclass{article}
\usepackage{fullpage}
\usepackage{pdflscape}
\begin{document}

\begin{landscape}
<<test, out.width='1\\linewidth', fig.width=7, fig.height=4, fig.cap='Caption Trial'>>=
par(mar=c(4, 4, .1, .1)); plot(1:10)
@
\end{landscape}

\end{document}

最佳答案

试试这个:

\documentclass{article}
\usepackage{fullpage}
\usepackage{pdflscape}
\begin{document}

\begin{landscape}
\begin{figure}
<<test, out.width='1\\linewidth', fig.width=7, fig.height=4>>=
par(mar=c(4, 4, .1, .1)); plot(1:10)
@
\caption{Caption Trial}
\end{figure}
\end{landscape}

\end{document}

关于针织 Rnw latex : how to obtain a figure and caption in landscape mode that's full page width,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23713540/

相关文章:

r - 用knitr为R代码输入行号

r - .md中的xtable,然后在rstudio中以pdf形式显示,显示%注释

r - 缩进而不在RMarkdown中添加项目符号点或数字

r - 在 RMarkdown PDF 中,将章节编号从 "X Section"更改为 "Section X"

r - 编织为pdf时ggplot2条形图中不需要的条纹

r - !尝试在 RMD 中编织时包 inputenc 错误 : Unicode character λ (U+03BB) (inputenc) not set up for use with LaTeX.

r - knitr kable 中的 LaTeX 数学表达式 (Sweave)

c - 使用 pdflatex 在 C 代码中编译 LaTeX 文件

Latex 使用不同的背景颜色突出显示引用部分中的引文

r - 打印 <0.001 的 p 值