Skip to main content
6 of 8
added report of my effort
Empty_Mind
  • 1.4k
  • 12
  • 27

Exporting unicode characters to pdf using latex from org mode

Hello Good people of Emacs!

I'm having trouble exporting unicode math symbols from buffer (org-mode) to pdf file.

1. Problem Description:

Symbols are inserted to the buffer as unicode characters (via TEX input method or company-math)

Here is source code demonstration:

#+TITLE: Unicode characters export test 
#+AUThor: 
#+date:
Unicode characters:

ℝ ℤ ℕ ⇒ ∈ ∀ 

Same symbols in latex format:

$$\Bbb{R} \Bbb{Z} \Bbb{N} \Rightarrow \in \forall$$

Produced .tex file includes unicode symbols:

% Created 2016-03-04 Pá 21:01
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fixltx2e}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{textcomp}
\usepackage{marvosym}
\usepackage{wasysym}
\usepackage{amssymb}
\usepackage{hyperref}
\tolerance=1000
\date{}
\title{Unicode characters export test}
\hypersetup{
  pdfkeywords={},
  pdfsubject={},
  pdfcreator={Emacs 24.4.1 (Org mode 8.2.10)}}
\begin{document}

\maketitle
\tableofcontents

Unicode characters:

ℝ ℤ ℕ ⇒ ∈ ∀ 

Same symbols in latex format:

$$\Bbb{R} \Bbb{Z} \Bbb{N} \Rightarrow \in \forall$$
% Emacs 24.4.1 (Org mode 8.2.10)
\end{document}

Pdf file does not :

enter image description here

2. Things I have tried so far:

Xelatex and unicode-math: This is included in answer from Rasmus. Here I have to admit: I'm not using development version of org-mode he's mentioning. (failed to install it) I've tried xelatex adn unicode-math anyway. My version of Org mode is 8.2.10.

#+latex_compiler: xelatex
#+latex_header: \usepackage{libertine}
#+latex_header: \usepackage{unicode-math}

Including this in file introduces not so lovely message instead pdf file.

org-latex-compile: PDF file ./unicode_export_test.pdf wasn't produced: [package error]

I have checked for correct unicode-math installation:

~ $ kpsewhich unicode-math.sty
/usr/share/texlive/texmf-dist/tex/latex/unicode-math/unicode-math.sty

Installation of Xelatex is the newest version:

~ $ sudo apt-get install texlive-xetex
Reading package lists... Done
Building dependency tree       
Reading state information... Done
texlive-xetex is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 16 not upgraded.

I have failed to install development version of org-mode. Following How do I keep current with bleeding edge development? - tutorial I have been able (I think) download it and compile it. Since I have no idea how to tell to Emacs run this version, Emacs runs Org-mode version 8.2.10 (release_8.2.10 @ /usr/local/share/emacs/24.4/lisp/org/). I have tried to add following lines to my config.

(add-to-list 'load-path (expand-file-name "~/elisp/org-mode/lisp"))
(remove 'load-path (expand-file-name "/usr/local/share/emacs/24.4/lisp/org/"))
(add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" . org-mode))
(require 'org)

Without pleasing result.

3. Question: How to export unicode characters from org-mode to pdf?

  • Do I have to configure some org-mode variable?
  • Compile with different Latex interpreter?
  • Any other ideas?
  • If development version fixes this.... How can I install it?
Empty_Mind
  • 1.4k
  • 12
  • 27