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

TeX produced cannot be converted to PDF #4946

Closed
jdfreder opened this issue Jan 29, 2014 · 8 comments · Fixed by #5380
Closed

TeX produced cannot be converted to PDF #4946

jdfreder opened this issue Jan 29, 2014 · 8 comments · Fixed by #5380
Assignees
Milestone

Comments

@jdfreder
Copy link
Member

This issue needs to be verified as fixed before it can be closed. See the notebook provided below.

Migrated from https://github.com/ipython/nbconvert/issues/118
Original author @yoavram


I either convert ipynb to tex file and try to convert it to PDF with pandoc or TeXworks, or I try to convert ipynb directly to pdf, I always get this error:

Runaway argument?
{Extended Introduction to Computer Science with Python,
! Paragraph ended before @SecT was complete.

\par
l.129 Tel-Aviv University, Spring 2013}
for this input https://raw.github.com/yoavram/CS1001.py/master/recitation4.ipynb.
I'm using the latest nbconvert (I do git pull before running) - commit 670c867.

Thanks

@jakobgager
Copy link
Contributor

For me, this notebook compiles fine with ipython 1.1.0.
With current master, there are some minor issues (html escapes...). I've tested with pandoc 1.12.0.

The given error does not appear for both versions.

@yoavram
Copy link

yoavram commented Jan 30, 2014

Tried it again, IPython V. 1.1.0. Windows 7 64-bit. Python 2.7.
I run ipython nbconvert recitation4.ipynb --to latex --post PDF.
I get this error.

@jakobgager
Copy link
Contributor

@yoavram which pandoc version do you use? Can you provide the .tex file as well?

@yoavram
Copy link

yoavram commented Jan 31, 2014

Pandoc:

pandoc 1.11.1
Compiled with citeproc-hs 0.3.8, texmath 0.6.1.3, highlighting-kate 0.5.3.8.

Here's the text file

@RobertCoop
Copy link

I've just run into a similar problem. For Markdown cells, NBConvert/Pandoc appears to insert newlines into the TEX output depending on where breaks occur in the rendered cell. However, the newlines do not take into account what is going on in the TEX output. So, for cells that have an HTML link which spans lines, the TEX output contains (an example from when I hit the error):

does much of this for us. Here's a link to

\href{http://deeplearning.net/tutorial/mlp.html}{Theano's Neural Network
tutorial}. (The type of neural network described here is also called a

Multi-Layer Perceptron (MLP), which is the term Theano uses.)

LaTeX does not allow a line break within this tag, and produces this error:

Runaway argument?
{Theano's Neural Network 
! Paragraph ended before \href@split was complete.
<to be read again> 
                   \par 

Similar errors seem to appear all over the place, within \paragraph and \subsection tags as well.

@jdfreder jdfreder self-assigned this Mar 3, 2014
@jdfreder
Copy link
Member Author

Hi @RobertCoop I'm unable to reproduce the newline problem, that sounds like something which was fixed a couple months ago in master. Please try with the latest IPython master and a copy Pandoc version 1.12 or later (I think 1.12 is the latest).

I used this gist, maybe it's missing something: https://gist.github.com/jdfreder/9606024

@yoavram I can't get the same error, but I'm getting an error:

! LaTeX Error: Command \ttfamily invalid in math mode.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.30 |
      f(x)| \le M|g(x)| \; \forall x>x_{0}
? q

Which I tracked down as a minimum failing latex example:

\documentclass{article}
\usepackage{fancyvrb} % verbatim replacement that allows latex

% commands and environments needed by pandoc snippets
% extracted from the output of `pandoc -s`
\DefineShortVerb[commandchars=\\\{\}]{\|}

% Document parameters
\title{recitation4}    
\begin{document}

$$
|f(x)| \le M|g(x)| \; \forall x>x_{0}
$$

\end{document}

@jdfreder
Copy link
Member Author

Same error as jgm/pandoc#469 , maybe we can just remove that DefineShortVerb line from our template... hm

@jdfreder
Copy link
Member Author

The only error I was able to reproduce while trying to convert the linked notebook is solved by #5380 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants