From: Richard Lawrence <richard.lawrence@berkeley.edu>
To: emacs-orgmode@gnu.org
Subject: Re: Avoid escaping braces in LaTeX export?
Date: Sat, 08 Jun 2013 10:45:58 -0700 [thread overview]
Message-ID: <87a9n0h4x5.fsf@berkeley.edu> (raw)
In-Reply-To: 877gi4n009.fsf@ucl.ac.uk
Eric S Fraga <e.fraga@ucl.ac.uk> writes:
> Richard Lawrence <richard.lawrence@berkeley.edu> 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!
--
Best,
Richard
next prev parent reply other threads:[~2013-06-08 17:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-07 17:26 Avoid escaping braces in LaTeX export? Richard Lawrence
2013-06-07 18:45 ` Marcin Borkowski
2013-06-07 21:27 ` Richard Lawrence
2013-06-08 14:35 ` Eric S Fraga
2013-06-08 17:45 ` Richard Lawrence [this message]
2013-06-09 7:37 ` Nicolas Goaziou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a9n0h4x5.fsf@berkeley.edu \
--to=richard.lawrence@berkeley.edu \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).