[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Avoid escaping braces in LaTeX export?
From: |
Nicolas Goaziou |
Subject: |
Re: [O] Avoid escaping braces in LaTeX export? |
Date: |
Sun, 09 Jun 2013 09:37:41 +0200 |
Hello,
Richard Lawrence <address@hidden> writes:
> Eric S Fraga <address@hidden> writes:
>
>> Richard Lawrence <address@hidden> 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