[Tex/LaTex] Exporting accented characters from org-mode to LaTeX

accentsemacsorg-mode

I'd like to export text from org-mode to LaTeX that contains accented characters. I am using curly brackets, following the guide from the top answer in this question.

# This:
Foo B{\"u}chi automaton bar.
# Exports to:
B\{$\backslash$"u\}chi automaton.

# Whilst this:
#+BEGIN_LATEX
Foo B{\"u}chi automaton bar.
#+END_LATEX
# Exports to:
B{\"u}chi automaton.

The question is either:

  1. How do I esacape the {\"} to avoid the conversion to {$\backslash$"u\} ?
  2. How do I use LaTeX inline, as `$x$ allows me to use math inline ?

Best Answer

Why don't you insert directly ü? Org exported LaTeX source loads inputenc package with utf8 option.

Org file:

title

äëïöü

Exported file:

\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fixltx2e}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{soul}
\usepackage{textcomp}
\usepackage{marvosym}
\usepackage{wasysym}
\usepackage{latexsym}
\usepackage{amssymb}
\usepackage{hyperref}
\tolerance=1000
\providecommand{\alert}[1]{\textbf{#1}}

\title{title}
\author{giordano}
\date{\today}
\hypersetup{
  pdfkeywords={},
  pdfsubject={},
  pdfcreator={Emacs Org-mode version 7.9.2}}

\begin{document}

\maketitle

\setcounter{tocdepth}{3}
\tableofcontents
\vspace*{1cm}

äëïöü

\end{document}

If you want to insert inline LaTeX, you can define a dummy macro:

#+LATEX_HEADER: \newcommand{\inlinelatex}[1]{#1}

title

\inlinelatex{Foo B{\"u}chi automaton bar.}