On 12/05/2016 03:36 AM, Scott Otterson wrote: > Yes, there's a general question of how to escape multiple underscores. > > But there's a bigger question too: Should an org-doc that runs fine in > other exporters cause a messy-to-debug crash when it's exported to > Latex? Is that the Pandoc-like behavior that orgmode seems to be aiming > for? > > I love org-mode. For years, I've used it as a project organizer, > brainstorming tool, and extremely versatile notekeeper. I've already > got a big investment in it, so I'll spend the time to track down this > kind of problem. > > But I'd guess that such unexpected Latex crashes have driven new users > back to Word or whatever.
I don't think you can blame Org for the crashes you've experienced. Org exports the string "a_variable_deleteThisAndItWorks" to "a\(_{\text{variable}}_{\text{deleteThisAndItWorks}}\)" which is not a valid LaTeX expression. This invalid output is not the fault of Org, it is the fault of the input string. Since there are different ways of interpreting "a_variable_deleteThisAndItWorks," you have to tell Org which interpretation you want it to make when you export to LaTeX. This means additional markup of the string is required. That the exported LaTeX file crashes your installation of pdfTeX (or whatever TeX engine you use) when you process it is not the fault of Org. The exported LaTeX file contains an invalid LaTeX expression that came from a ambiguous string, so pdfTeX shows an error when processing the LaTeX file. Using additional markup of the string so that Org exports it as a valid LaTeX expression is the solution to the problem. Scott Randby