gpt4 book ai didi

r - 没有 knitrout 和逐字环境的 block 输出

转载 作者:行者123 更新时间:2023-12-02 04:52:41 25 4
gpt4 key购买 nike

<<newChunk,echo=FALSE,comment=NA,background=NA>>=
x <- "\\includegraphics[width=\\maxwidth]{figure/Kompetenz1.pdf}"
cat(x)
@

如果我在我的 .Rnw 文件中运行这个 r 代码,我将在我的 .tex 文件中得到以下输出:
\begin{knitrout}
\definecolor{shadecolor}{rgb}{1, 1, 1}\color{fgcolor}\begin{kframe}
\begin{verbatim}
\includegraphics[width=\maxwidth]{figure/Kompetenz1.pdf}
\end{verbatim}
\end{kframe}
\end{knitrout}

在我的 .tex 文件中没有任何环境的情况下,如何仅获取\includegraphics{...} ?

最佳答案

我不确定你为什么首先使用 Knitr。看起来您只是想在您的 latex 文档中包含一个 PDF。为此,我将使用以下命令:

\includepdf[pages=-]{figure/Kompetenz1.pdf}

或者
\includegraphics[width=\maxwidth]{figure/Kompetenz1.pdf}

在您的 Rnw 文件中。这里不需要 Knitr block 。

关于r - 没有 knitrout 和逐字环境的 block 输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26400959/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com