
我想將文字從 org-mode 匯出到包含重音字元的 LaTeX。我正在使用大括號,遵循頂部答案的指南這個問題。
# 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.
問題是:
- 如何轉義
{\"}
以避免轉換為{$\backslash$"u\}
? - 我如何使用 LaTeX 內聯,因為 `$x$ 允許我使用內聯數學?
答案1
為什麼不直接插入呢ü
? Org 匯出的 LaTeX 來源載入inputenc
帶有選項的套件utf8
。
組織文件:
title
äëïöü
匯出的文件:
\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}
如果你想插入內嵌 LaTeX,你可以定義一個虛擬巨集:
#+LATEX_HEADER: \newcommand{\inlinelatex}[1]{#1}
title
\inlinelatex{Foo B{\"u}chi automaton bar.}
答案2
為了避免使用 unicode 文件(如果您的系統中沒有 unicode 包,或未配置為有效插入 unicode),您也可以使用 Org 模式特殊符號:http://orgmode.org/manual/Special-symbols.html
您可以透過檢查 org-entities 變數來查看預先定義的符號:
C-h v RET org-entities RET
在您的情況下,此清單包含以下形式的條目:
("uuml" "\\\"{u}" nil "ü" "ue" "ü" "ü")
然後透過寫入\uuml
組織模式緩衝區,您將獲得所需的匯出。