# Exporting Org to PDF while displaying Regex literal strings

I've been searching for the past couple of days to a solution to an issue I'm having. Hoping somebody who is more apt with emacs/exporting could provide some insight.

Upon exporting an .org file (C-cC-elo/p) to LaTeX followed by PDF, my Regex text within the PDF document is handled (assuming) as a math equation. E.g. instead of displaying [^ABC] within the PDF, it is displayed as [ABC].

I have attempted to use \usepackage{verbatim}, with something like \verb/[^ABC]/, but I get different results. E.g. [(^{\text{ABC}})].

Is there a specific reason I'm missing that could be causing this? Or, something that I have not included within my init.el? For reference, here is the section of my init.el that is handling org-latex-classes:

(add-to-list 'org-latex-classes
"\\documentclass{article}
\\usepackage[utf8]{inputenc}
\\usepackage{verbatim}
\\usepackage[T1]{fontenc}
\\usepackage{graphicx}
\\usepackage{longtable}
\\usepackage{hyperref}
\\usepackage{natbib}
\\usepackage{amssymb}
\\usepackage{amsmath}
\\usepackage{geometry}
\\geometry{a4paper,left=2.5cm,top=2cm,right=2.5cm,bottom=2cm,marginparsep=7pt, marginparwidth=.6in}"
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}")))


Edit: As suggested, wrapping expressions with '=' seems to do the trick for cases such as [^ABC] and \u{FFFF}.

• Have you tried wrapping the offending text in '=' markup? Seems to do the right thing here at least for '^' – rpluim Sep 27 '19 at 15:46
• @rpluim No clue how I didn't find any information on this - I did try it with a couple of expressions and it seems to do the trick! Thank you for the suggestion. – jetblackpope Sep 27 '19 at 15:56
• Using #+BEGIN_EXAMPLE / #+END_EXAMPLE blocks works as well for bigger chunks – rpluim Sep 27 '19 at 15:57
• This is great information, and both seem to be suitable use cases for what I'm going for. Thanks again! If you'd like to answer directly so I can mark as complete, that would be great. – jetblackpope Sep 27 '19 at 16:04

Org can be told to treat text as verbatim either by wrapping it in '=' markup (for words), or in a #+BEGIN_EXAMPLE/#+END_EXAMPLE block. See Emphasis-and-Monospace and Literal-Examples for details.