In org-mode Emacs, exporting a latex string of a literal string containing "\ __" giving problems

I am trying to export a literal string from Emacs Org-mode to Latex for later export to pdf. Literal line:

str1\__str2

I tried the following input in an Org file:

\verb+str1\__str2+

The following code is generated in the .tex file:

\verb+str1\hspace{3ex}str2+

I was expecting the following code in a .tex file:

\verb+str1\__str2+

I also tried the following in an Org file:

\begin{verbatim}
str1\__str2
\end{verbatim}

The result is the following code in the .tex file:

\begin{verbatim}
str1\hspace{3ex}str2
\end{verbatim}

Including the following option in the Org file does not affect the output:

#+OPTIONS:     ^:{}

Any help would be greatly appreciated.

Thank.

Charade

+5
source share
3 answers

, , , :

#+BEGIN_EXAMPLE
   str1\__str2
#+END_EXAMPLE

:

\begin{verbatim}
str1\__str2
\end{verbatim}
+2

:

| str1\textbackslash{}\_\_str2  |

, HTML.

+1

You can use org-entities-userto create your own objects with different translations when exporting.

Installing it, for example, (("textbackslash" "\\textbackslash" nil "\\" "\\" "\\" "\\"))converts \textbackslashto \textbackslashLaTeX output and \for all other outputs.

+1
source

All Articles