From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Randby Subject: Re: Multiple underscores crash org latex export; other exporters survive Date: Mon, 5 Dec 2016 20:33:57 -0500 Message-ID: References: <49b70a0c-f81b-660b-e2f5-9921ab488d65@gmail.com> <50e77033-c13c-c0be-5d4a-ec5c107e93ae@gmail.com> <87bmwsatox.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55088) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cE4dy-0001Gn-B1 for emacs-orgmode@gnu.org; Mon, 05 Dec 2016 20:34:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cE4dx-0002gF-83 for emacs-orgmode@gnu.org; Mon, 05 Dec 2016 20:34:06 -0500 Received: from mail-io0-x22f.google.com ([2607:f8b0:4001:c06::22f]:33980) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cE4dx-0002fx-1u for emacs-orgmode@gnu.org; Mon, 05 Dec 2016 20:34:05 -0500 Received: by mail-io0-x22f.google.com with SMTP id c21so579836127ioj.1 for ; Mon, 05 Dec 2016 17:34:04 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Scott Otterson , "Emacs-orgmode@gnu.org" 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