0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-08-27 19:02:52 +00:00
org-mode/lisp
Carsten Dominik c6fd49726f LaTeX export: Fix some problems with protection of inline latex commands
Scot Becker writes:

>  Prompted by Chris Gray's request for org markup in Latex
>  environment, I thought I'd submit a note (for his sake and
>  others') about a few quirks of org-latex-export's handling
>  of embedded Latex markup in org documents.  I have been
>  puzzling with these for a while but only discovered the
>  problem triggers (and workarounds) this morning just before
>  Chris' mail arrived.  These are both about inline Latex
>  commands:
>
>  I use a few custom commands \mycommand{like this}, and
>  occasionally have to invoke the odd bit of standard LaTeX
>  markup, for example /when \textbf{embedding bold text}
>  inside italics/.  For the most part, these work fine, but
>  I've discovered the following two 'gotchas' that happen when
>  exporting to LaTeX.
>
>  1.  Inline Latex commands get their final curly brace
>  escaped with a slash (and therefore don't work) if they
>  spill over into another line, i.e. if they contain one or
>  more newlines.  This is true also for standard LaTeX
>  commands like \textbf{} and \emph{}.
>
>  ----------------SAMPLE------------------------
>  \mycommand{So, for example this
>  wrapped setence gets a slash added just after the
>  final period and before the curly brace.}  Org is quite
>  helpfully escaping the slash for LaTeX, apparently.
>
>  \mycommand{no trouble if it's all on one line}
>  ------------------END-------------------------
>
>  The workaround of putting all such commands on one line is
>  no hardship for me, since I use visual-line-mode in Emacs 23
>  and keep my paragraphs as single logical lines.  It might be
>  harder for those accustomed to hard-wrapping their
>  paragraphs.
>
>
>  2.  If you have two inline Latex commands on the same
>  logical line, org's latex export doesn't treat the text
>  between them in its usual manner.  Italics get processed,
>  but not the latexification of quotes.  ("this" --> ``this'')
>  For example:
>
>  ----------------SAMPLE------------------------
>  I have a short custom command to tell Latex to invoke a
>  Hebrew-language right-to-left environment when I want to refer to a
>  Hebrew phrase like this: \heb{phrase here}.  But then if I "quote
>  something,"  and follow that by another \heb{phrase}, the inner
>  quotation marks don't get processed.  Oddly enough, this problem is
>  only triggered when there is an inline Latex command both before and
>  after the  quoted material on the same logical line.
>
>  Now if you put a footnote in between those two inline Latex commands,
>  the output is really nutty:
>
>  And \heb{phrase here} with a footnote[fn:: Footnote here.]  I'm not
>  sure what funky org commands get invoked, but again, only when
>  bookended by an inline Latex command like \heb{phrase here}.
>  ------------------END-------------------------
>
>  The nutty output is a number in square brackets like
>  this[1], with the following at the bottom of the document:
>
>  \$\^{}{1}\$ Footnote here.
>
>  This has a the opposite work-around: break the lines so
>  those elements are not all on the same logical line. Put in
>  a few newlines.  Latex, of course doesn't care.  Do take
>  care not to start a newline with the org-footnote, like this
>  [fn:: Org doesn't parse a footnote command which starts on
>  its own line.]
>
>  This is just "for what it's worth" to those who use org-mode
>  as a front-end to writing for LaTeX.

These problems were caused by a regular expression for
matching latex macros with arguments, that did not allow any
newlines.  Now we have a much better regexp, that even
allows for three levels of nested braces.
2009-04-16 14:17:51 +02:00
..
ChangeLog LaTeX export: Fix some problems with protection of inline latex commands 2009-04-16 14:17:51 +02:00
ChangeLog.01 Split ChangeLog file into parts. 2008-05-08 08:16:38 +02:00
org-agenda.el Dependencies: New property NOBLOCKING 2009-04-08 17:01:54 +02:00
org-archive.el Version number pushed to 6.25trans 2009-04-07 18:43:42 +02:00
org-ascii.el HTML export: moved functions to separate file. 2009-04-07 20:00:31 +02:00
org-attach.el Version number pushed to 6.25trans 2009-04-07 18:43:42 +02:00
org-bbdb.el Version number pushed to 6.25trans 2009-04-07 18:43:42 +02:00
org-bibtex.el Version number pushed to 6.25trans 2009-04-07 18:43:42 +02:00
org-clock.el Jump to selected clock task when starting the clock 2009-04-16 06:02:13 +02:00
org-colview-xemacs.el Version number pushed to 6.25trans 2009-04-07 18:43:42 +02:00
org-colview.el Version number pushed to 6.25trans 2009-04-07 18:43:42 +02:00
org-compat.el Feeds: Avoid problems with sha1.el in Emacs 22 2009-04-14 18:02:41 +02:00
org-docbook.el Export: Start paragraphs after the end of literal examples. 2009-04-09 09:09:34 +02:00
org-exp.el Fix the previous fix. 2009-04-12 20:00:39 +02:00
org-faces.el Version number pushed to 6.25trans 2009-04-07 18:43:42 +02:00
org-feed.el Don't make org-feed-alist and autoload variable. 2009-04-15 17:23:58 +02:00
org-footnote.el Version number pushed to 6.25trans 2009-04-07 18:43:42 +02:00
org-gnus.el Version number pushed to 6.25trans 2009-04-07 18:43:42 +02:00
org-html.el Export: Fix bug with time stamps missing a space. 2009-04-15 14:42:56 +02:00
org-icalendar.el iCalendar and XOXO export: Functions moved to new files. 2009-04-07 19:08:24 +02:00
org-id.el Version number pushed to 6.25trans 2009-04-07 18:43:42 +02:00
org-info.el Version number pushed to 6.25trans 2009-04-07 18:43:42 +02:00
org-inlinetask.el Version number pushed to 6.25trans 2009-04-07 18:43:42 +02:00
org-irc.el Version number pushed to 6.25trans 2009-04-07 18:43:42 +02:00
org-jsinfo.el HTML export: moved functions to separate file. 2009-04-07 20:00:31 +02:00
org-latex.el LaTeX export: Fix some problems with protection of inline latex commands 2009-04-16 14:17:51 +02:00
org-list.el Version number pushed to 6.25trans 2009-04-07 18:43:42 +02:00
org-mac-message.el org-mac-message: More fixes, and growl integration 2009-04-08 15:05:48 +02:00
org-macs.el Reverse the adding of the intangible property - this seems to be an 2009-04-14 12:35:32 +02:00
org-mew.el Version number pushed to 6.25trans 2009-04-07 18:43:42 +02:00
org-mhe.el Version number pushed to 6.25trans 2009-04-07 18:43:42 +02:00
org-mouse.el Version number pushed to 6.25trans 2009-04-07 18:43:42 +02:00
org-plot.el Version number pushed to 6.25trans 2009-04-07 18:43:42 +02:00
org-protocol.el Version number pushed to 6.25trans 2009-04-07 18:43:42 +02:00
org-publish.el Version number pushed to 6.25trans 2009-04-07 18:43:42 +02:00
org-remember.el Minor fix. 2009-04-15 18:25:28 +02:00
org-rmail.el Version number pushed to 6.25trans 2009-04-07 18:43:42 +02:00
org-table.el Tables: Allow standard references in remote references. 2009-04-15 15:16:05 +02:00
org-timer.el Version number pushed to 6.25trans 2009-04-07 18:43:42 +02:00
org-vm.el Version number pushed to 6.25trans 2009-04-07 18:43:42 +02:00
org-w3m.el Version number pushed to 6.25trans 2009-04-07 18:43:42 +02:00
org-wl.el Version number pushed to 6.25trans 2009-04-07 18:43:42 +02:00
org-xoxo.el iCalendar and XOXO export: Functions moved to new files. 2009-04-07 19:08:24 +02:00
org.el Call org-reveal after refiling 2009-04-16 06:01:50 +02:00