From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Avoid escaping braces in LaTeX export? Date: Sun, 09 Jun 2013 09:37:41 +0200 Message-ID: <874nd7wx8a.fsf@gmail.com> References: <87bo7hkf20.fsf@berkeley.edu> <20130607204548.6fabee8f@aga-netbook> <87r4gdehmp.fsf@berkeley.edu> <877gi4n009.fsf@ucl.ac.uk> <87a9n0h4x5.fsf@berkeley.edu> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41276) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UlaBz-0004Xe-ES for emacs-orgmode@gnu.org; Sun, 09 Jun 2013 03:37:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UlaBy-000190-AY for emacs-orgmode@gnu.org; Sun, 09 Jun 2013 03:37:35 -0400 Received: from mail-we0-x234.google.com ([2a00:1450:400c:c03::234]:54679) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UlaBy-00018u-4L for emacs-orgmode@gnu.org; Sun, 09 Jun 2013 03:37:34 -0400 Received: by mail-we0-f180.google.com with SMTP id w56so4017137wes.39 for ; Sun, 09 Jun 2013 00:37:33 -0700 (PDT) In-Reply-To: <87a9n0h4x5.fsf@berkeley.edu> (Richard Lawrence's message of "Sat, 08 Jun 2013 10:45:58 -0700") 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Richard Lawrence Cc: emacs-orgmode@gnu.org Hello, Richard Lawrence writes: > Eric S Fraga writes: > >> Richard Lawrence writes: >> Org is not latex, for better or for worse. However, it does allow you >> to mix the two in various ways. The inline approach is limited to >> {text} that is on the same line. You could try using visual-line-mode >> and have all paragraphs be single lines. >> >> Alternative, you could try (untested): >> >> blah blah blah >> #+LATEX: \ic{ >> some text for the inline comment >> #+LATEX: } >> more blah > > Thanks, Eric; that works, too. > > I think for now the best thing is for me to put longer comments in a > custom environment. Then I can use Org's block syntax, and have other > export backends do the right thing, if I ever use them instead of LaTeX. > > I did dig into the exporter code a bit, so in case anyone is bitten by a > similar issue that doesn't have a ready workaround, the places to look > seem to be: > - org-element.el:org-element-latex-or-entity-successor. This is where > LaTeX fragments are identified. (As Eric notes, multi-line commands > will not have their arguments parsed as part of a latex-fragment; > instead, the argument and surrounding braces are parsed as text in > the surrounding paragraph.) > - ox-latex.el:org-latex-plain-text. This is where special characters > that don't get parsed as part of a LaTeX fragment are > protected/escaped. > > I still think it might be nice if each of the protections in > org-latex-plain-text could be toggled via an #+OPTIONS keyword, since > more often than not, I find that characters are escaped in LaTeX export > when I would prefer they weren't. But that might be a peculiar fact > about how I use Org. Since for now I don't require this behavior, I'm > not going to try to implement it myself, but if anyone else would also > find it useful, let me know and I will take a stab at writing a patch. > > Thanks, all, for the help! As Eric said, Org format is not LaTeX, and I would add that Org mode is not Auctex mode. You can already write raw LaTeX code with appropriate markers. There's no point in allowing more LaTeX code without markers. Regards, -- Nicolas Goaziou