5

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 ?
Rob Stewart
  • 409
  • 3
  • 8

2 Answers2

6

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.}
giordano
  • 8,486
2

To avoid working with unicode documents (in case the unicode package is not in your system, or this is not configured to insert unicode efficiently) you can also use the Org-mode special symbols: http://orgmode.org/manual/Special-symbols.html

You can view the predefined symbols by inspecting the org-entities variable:

C-h v RET org-entities RET

In your case this list contains an entry of the form:

("uuml" "\\\"{u}" nil "ü" "ue" "ü" "ü")

Then by writting \uuml in your org-mode buffer you'll get the desired export.