emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Multiple underscores crash org latex export; other exporters sur


From: Scott Otterson
Subject: Re: [O] Multiple underscores crash org latex export; other exporters survive
Date: Mon, 12 Dec 2016 16:18:09 +0100

Thanks to Nicolas and Scott for your painstaking efforts.  At least for me, a fine stopgap measure is to simply avoid Latex crashes for orgmode contents that are not explicitly Latex.  Sometime after that, it would be ideal to produce similar output for all export types, insofar as that's possible.

I thought I'd see what ox-pandoc does.  As I'm sure you know, pandoc converts all input formats to a master markup language, and then converts that to whatever output format is desired -- a design that makes output uniformity easier to obtain.  Orgmode is already halfway there, since the master markup language is orgmode itself.  

Here's what pandoc does in the three cases I've recently posted about: 

1.) Multiple underscores (the subject of this thread):  Pandoc doesn't crash and it exports the same thing for either html or latex: everything after the first underscore is subscripted and all underscores are deleted.  I don't love that behavior but it's consistent.

2.) Plain lists with more than four sublevels: For html export, pandoc and orgmode do what you'd expect: produce a deeply nested html list.  For (Windows) latex export, pandoc and orgmode also do the same thing: crash. Ideally, pandoc would have generated valid Latex for deep list nesting, but at least it's not completely ornery; it snips out the part of the original Latex error message that points to the cause.  

Perhaps pandoc latex export wouldn't crash in Linux, just as orgmode latex export doesn't crash in Linux (from Nicolas).  This is still a mystery. Nicolas's Linux-produced tex file is essentially the same as the one I got in Windows, and it crashes Windows latexmk just like mine does.  Nicolas, could it be that you're not running latexmk on your exports?

3.) Web link with a '#' in the URL: Pandoc never crashes and it exports nearly the same thing for html or latex pdf:  In either case, clicking on the link sends you to the right web page, and the only difference is that, in the output pdf, the link text isn't highlighted; instead there's a tooltip popup.   

The reason pandoc latex export doesn't crash but orgmode does (in Windows) is that pandoc escapes the '#'.  In the example I posted last week, orgmode does this:

\section{Some section  \href{http://orgmode.org/manual/Column-groups.html#Column-groups}{A random link}}

while pandoc does this:

\section{\texorpdfstring{Some section \href{http://orgmode.org/manual/Column-groups.html\#Column-groups}{A random link}}{Some section A random link}}

I don't understand why the escape prevents Windows crashes but doesn't appear to be needed for Linux.  Nevertheless, it looks like pandoc does something special to prevent this crash.

Scott



reply via email to

[Prev in Thread] Current Thread [Next in Thread]