Search code examples
latexorg-modebeamer

Is there a way to override org-mode default exporting behavior?


I write my Beamer presentations for class in org-mode which I then export via the built in exporter to a LaTeX beamer presentation.

I know the default org-mode markup characteristics:

*bold* = \alert{bold}
/italics/ = \emph{italics}
+strike+ = \sout{strike}
=code= = \texttt{code}
~code~ = \texttt{code}

(Yes I am aware that ~ and = do different things, but they export identically for LaTeX purposes.)

What I would like is some way to either override one of the ~ or = syntax to export to \textcolor{example}{an example} Or perhaps to have another character that I can use for quick inline word or phrase size examples. Blocks I am happy to do with the #+BEGIN_EXAMPLE or similar syntax.

Is there an easy way to have that expand from a nice simple org-mode markup syntax?


Solution

  • The variable org-latex-text-markup-alist defines what happens when org exports the emphasised text. You can change specific markers to do what you want. For instance, I have customized this variable to be

    '(org-latex-text-markup-alist
       '((bold . "\\textbf{%s}")
         (code . protectedtexttt)
         (italic . "\\emph{%s}")
         (strike-through . "\\hl{%s}")
         (underline . "\\uline{%s}")
         (verbatim . protectedtexttt)))
    

    where I have strike-through changed to highlight the text instead of striking it through.