emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Re: Bug: Re: Latex export: Differing behavior for symbols in h


From: Richard Lawrence
Subject: [Orgmode] Re: Bug: Re: Latex export: Differing behavior for symbols in headlines
Date: Sun, 24 Oct 2010 00:30:28 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Richard Lawrence <address@hidden> responds to himself:

>>> 2) If so, what's the right way to work around it?  If not, where should
>>> I look to try and fix it?
>>> 
>
> I'm still wondering about the latter question here.  This is important
> enough to me that I am willing to take a stab at fixing it, but my Elisp
> experience is basically limited to init file customizations.  Can anyone
> who knows the ins and outs of the LaTeX export code give me a few
> pointers about where to start?

OK, I've been reading the code in org-latex.el for a while now, and I
have at least come to understand why $'s in a headline are escaped when
the export is restricted to a subtree.

The explanation is this: within org-export-as-latex, the headline is
bound to `title', and passed to org-export-latex-make-header, which in
turn passes the value into org-export-latex-content, thusly:

;; org-latex.el, line 1283

     (format
      "\n\n\\title{%s}\n"
      ;; convert the title
      (org-export-latex-content
       title '(lists tables fixed-width keywords)))

org-export-latex-content works by performing a series of mutations on a
temporary buffer.  One of these mutations,
org-export-latex-special-chars, replaces "$" with "\$".  So that's
where the replacement is happening when the headline of a subtree is
used as the title for a LaTeX export.

(Actually, this begs the question: how should one export an Org file to
LaTeX if part of the title should be in math mode?  Is escaping $'s in
the document title really the best behavior?  My guess would be that
people need math mode in their document titles far more often than they
need a literal "$".)

Here's what I don't understand yet: when the entire Org file is
exported, rather than just a subtree, the headlines (which eventually
become the section titles in the output) are apparently *not* processed
this way, because then the $'s in such headlines pass through unescaped.
I'm not sure if this is because they never pass through
org-export-latex-content, or because $'s have had the org-protected
property set by the time they *do* pass through it.

Guidance would be much appreciated!

Best,
Richard




reply via email to

[Prev in Thread] Current Thread [Next in Thread]