emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [Orgmode] [PATCH] Distinguish = and ~ delimiters in LaTeX export


From: Thomas S. Dye
Subject: Re: [Orgmode] [PATCH] Distinguish = and ~ delimiters in LaTeX export
Date: Sun, 30 Jan 2011 08:23:47 -1000


On Jan 30, 2011, at 5:30 AM, Carsten Dominik wrote:

Aloha Tom,

On Jan 29, 2011, at 7:40 PM, Thomas S. Dye wrote:

Aloha all,

The default value of org-export-latex-emphasis-alist treats the = and ~ delimiters as \\verb. Both settings are ignored because org- export-latex-use-verb is nil by default. The = and ~ delimiters produce \texttt{} instead of \verb. This patch distinguishes = and ~ by changing the default for = to \\texttt{%s}.

The docstring has also been changed to refer to org-export-latex- use-verb.

With this patch, users exporting to LaTeX will be able to use = for \texttt text in LaTeX moving environments and ~ for \verb text in places where it is safe to use this construct.

This is a pretty good patch, but I think we should still modify it.
Org users traditionally use =stuff= to mark code pieces, and I think
it is still important to escape special characters like ^ and ~ and others.

The modified patch below does the following:

- Like your patch, it makes Org use \\verb for the ~...~ emphasis.
- For =...= emphasis, it uses a new keyword \\protectedtexttt.
 This will protect special characters and then do texttt.  And I
have extended the protection to include multiple hyphens by converting
 "--" to "-{}-".

Do you agree with this solution?

- Carsten


Aloha Carsten,

Yes, I do. Your patch works here for the use cases I had in mind. I'm pleased that you were able to make the patch work for other use cases as well. Also, I like having org-export-latex-use-verb default to t instead of nil. It is nice to have the \verb command immediately at hand.

Thanks for looking into this.

All the best,
Tom



reply via email to

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