TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

After many search, I have found how to have a pretty good UTF8 mapping (which give no bad result on Acrobat Pro accessibility checking) for lmodern and amsfonts. The code needed is in the minimal example below (Maybe some of you maybe interested so I commented it a little).

But now, I decided to change my font to the one of the fourier package and I have some difficulties to figure how to get proper UTF8 encoding in the output pdf with this font.

Normally I should add commands like the following:


But I don't know where to find what I have called call the <IdentifierSymbol> and <UTF8Code>. I have done many test but without success.

I would greatly appreciate your help.

Here is the minimal example to show the difference of UTF8 mapping when using Fourier fonts instead of Latin Modern font. You can see the difference by copy-pasting the content or by an accessibility check if you have Acrobat Pro.


%PdfTeX settings for a correct UTF 8 Mapping
\ifpdf    \input{glyphtounicode.tex}    %Part of modern distribution
      %%%\input{glyphtounicode-cmr.tex}     %Additionnal glyph: You must grab it from pdfx package
\else  %Place here the settings for other compilator

%Encoding + cmap (to get proper UTF8 mapping)

%     You can see this on Acrobat Pro with acessibility checking or simply by copy-pasting the content.
%     Of course copy paste is not perfect in both case but it is better with lmodern

%AMS Math + UTF8 mapping of ams symbols
\usepackage{amssymb} % I load it after Fourier else I have more incorrect utf8 mapping (with \geqslant for example)
%Correct UTF8 mapping for ams fonts
\ifdefined\pdffontattr% \ifdefined is part of the e-TeX extension, which is part of any modern LaTeX compiler. 
    \immediate\pdfobj stream file {umsa.cmap}
    {\usefont{U}{msa}{m}{n}\pdffontattr\font{/ToUnicode \the\pdflastobj\space 0 R}}
    \immediate\pdfobj stream file {umsb.cmap}
    {\usefont{U}{msb}{m}{n}\pdffontattr\font{/ToUnicode \the\pdflastobj\space 0 R}}

%Start document

Issue with mapsto : ${\mathcal F} : \boldsymbol{\eta} \in {\mathbb{R}}^{np}\ \mapsto {\mathcal F}\left(\boldsymbol{\eta} \right)\in \mathbb{R}$

Issue with sqrt : $\sqrt{X}$

Issue with parenthesis : $X \geqslant \left(\frac{1}{2}\right)^2$

Issue with sum : $\sum_{n=0}^\infty X^n$

share|improve this question

closed as too localized by Kurt, lockstep, Thorsten, Qrrbrbirlbel, Stefan Kottwitz Nov 1 '12 at 20:13

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

This is most likely much easier with XeTeX and LuaTeX. Why do you insist on using pdfTeX? – Martin Schröder Oct 23 '11 at 11:16
Mainly because I have more than 200 tikZ figures and XeTeX don't seem to handle tikZ as well as pdfTeX (Perhaps I am wrong). I like also the mycrotype package which work only on pdfTeX for now. And finally because I guess I will have to solve many other problems/conflicts and I don't have many time for this (it's my PhD thesis and I should finish it soon). – youyou Oct 23 '11 at 17:31
The latest version of microtype works with LuaTeX. But I understand that you want to finish your thesis first. :-) – Martin Schröder Oct 23 '11 at 22:10
Thanks. Since I change font from Latin Modern to Fourier, the microtype package makes my documents very slow to compile. I heard the beta version solves some performance issue and I just wanted to install it. Perhaps you can also help me on this. I just have post a new question for the occasion. – youyou Oct 23 '11 at 23:08