2
votes

In Emacs 24.5 using org mode 20150706 I want to export a line like:

* foo\bar

to LaTeX as:

\item foo\textbackslash{}bar

and to HTML as

<li>foo\bar
</li>

I get the html I want, but the LaTeX is

\item foo\bar

which wrongly it invokes the "\bar" command.

Using the verbatim format coding:

* foo=\=bar

produces wrong results, where the LaTeX is

\item foo=$\backslash$=bar

and the html is

<li>foo=\=bar
</li>

How should I get the desired effect?

1

1 Answers

2
votes

Using verbatim coding is correct, but it is incorrectly applied. Instead of only coding the backslash, code the whole expression:

* =foo\bar=

Then the LaTeX is

\item \texttt{foo\textbackslash{}bar}

and the HTML is

<li><code>foo\bar</code>
</li>