Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pweave using results='tex' in chunk headers creates empty lines in the tex file #147

Open
steven-omaha opened this issue Jan 31, 2020 · 0 comments

Comments

@steven-omaha
Copy link

Consider the following file input.texw:

\documentclass{standalone}
\begin{document}
<<results='tex', echo=False>>=
print(1)
@
\end{document}

Running pweave -f tex input.texw creates the following input.tex:

\documentclass{standalone}
\begin{document}


1

\end{document}

This creates problems when the user wants to print python-results inline in tex files. Example:

\documentclass{standalone}
\usepackage{siunitx}
\begin{document}
\SI{%
<<results='tex', echo=False>>=
print(1)
@
}{\meter}
\end{document}

This compiles to

\documentclass{standalone}
\usepackage{siunitx}
\begin{document}
\SI{%


1

}{\meter}
\end{document}

which cannot be processed by pdflatex input.tex:

Runaway argument?
{
! Paragraph ended before \SI  was complete.
<to be read again>
                   \par
l.5

!  ==> Fatal error occurred, no output PDF file produced!

The expected input.tex file would have been this:

\documentclass{standalone}
\usepackage{siunitx}
\begin{document}
\SI{%
1
}{\meter}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant