You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(I asked this question on SO as well but after digging more into it I think a more appropriate question may be here).
I have a problem similar to #713 but I cannot just change the order of my documentclass lines. I'd like to include an example of complete LaTeX code inside an Rnw document that is parsed using knitr.
My .Rnw file is shown here (I really want to include a bunch of R code as well but this minimal example shows my problem)
When I run knitr test.Rnw I get a .tex file where the second documentclass is replaced (see below, where the top of the .tex file is shown). I'm pretty sure that this is knitr that replaces the litaral string \documentclass with its own macro that and it does not realize that it shouldn't be parsen when inside the verbatim environment.
\documentclass{article}
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\begin{document}
Recursiveness, see
\begin{verbatim}
\documentclass{article}\usepackage[]{graphicx}\usepackage[]{color}
%% maxwidth is the original width if it is less than linewidth
%% otherwise use linewidth (to make sure the graphics do not exceed the margin)
\makeatletter
\def\maxwidth{ %
\ifdim\Gin@nat@width>\linewidth
\linewidth
\else
\Gin@nat@width
\fi
}
\makeatother
Is it possible to circumvent this? I tried to insert a zero-width space character in the middle of documentclass but that gave me a bunch of headaches with the parsing.
The text was updated successfully, but these errors were encountered:
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.
Hi,
(I asked this question on SO as well but after digging more into it I think a more appropriate question may be here).
I have a problem similar to #713 but I cannot just change the order of my
documentclass
lines. I'd like to include an example of complete LaTeX code inside an Rnw document that is parsed using knitr.My .Rnw file is shown here (I really want to include a bunch of R code as well but this minimal example shows my problem)
When I run knitr test.Rnw I get a .tex file where the second documentclass is replaced (see below, where the top of the .tex file is shown). I'm pretty sure that this is knitr that replaces the litaral string \documentclass with its own macro that and it does not realize that it shouldn't be parsen when inside the verbatim environment.
Is it possible to circumvent this? I tried to insert a zero-width space character in the middle of documentclass but that gave me a bunch of headaches with the parsing.
The text was updated successfully, but these errors were encountered: