[tex-live] Default font of pdflatex with latin1 characters

Heiko Oberdiek oberdiek at uni-freiburg.de
Wed Jul 29 09:13:44 CEST 2009


On Tue, Jul 28, 2009 at 09:50:37AM +0200, Martin Monperrus wrote:

> pdflatex produces low-quality documents with the default settings. Let's
> consider novice and intermediate users who write texts with accents (e.g.
> French or German):
> 
> \documentclass{article}
> \usepackage[latin1]{inputenc}
> \begin{document}
> à l'âge de la science, les systèmes techniques sont issus des découvertes.
> \end{document}
> 
> If you try to copy/paste the resulting document, you obtain:
> a a
> ` l'^ge de la science, les syst`mes techniques sont issus des d??couvertes
>                                e                               e
> 
> The PDF file is of low quality:
> * one can not search accented words in it
> * one can not copy/paste accented words from it
> * it can not be correctly indexed by search engines
> 
> I suggest that pdflatex should be configured to choose by default cm-super
> or lmodern's versions of Computer Modern, without adding
> \usepackage[T1]{fontenc} & \usepackage{lmodern} or tweaking updmap.

LaTeX2e is frozen, thus it's too late to change defaults. :-(

But you are free to create your own format, e.g.

%%% cut %%% mmlatex.ini %%% cut %%%
% Hack to get cmap work during format generation.
% \pdfobj is delayed using \everyjob.
\let\OrgPdfObj\pdfobj
\def\pdfobj{%
  \write-1{}% cancel \immediate
  \OrgPdfObj reserveobjnum\relax
  \GetPdfObj
}
\def\GetPdfObj#1#{%
  \GetPdfObjI{#1}%
}
\def\GetPdfObjI#1#2{%
  \begingroup
    \edef\x{\endgroup
      \global\everyjob{%
        \the\everyjob
        \immediate\noexpand\pdfobj useobjnum \the\pdflastobj\space#1{#2}%
      }%
    }%
  \x
}
\RequirePackage{cmap}
\RequirePackage[T1]{fontenc}
\RequirePackage{lmodern}
\let\pdfobj\OrgPdfObj
\dump
%%% cut %%% mmlatex.ini %%% cut %%%

Then generate a format, e.g. (bash syntax):
  pdflatex -ini \&pdflatex mmlatex.ini

And call it with test.tex as your example file:
  pdflatex \&mmlatex test

Yours sincerely
  Heiko <oberdiek at uni-freiburg.de>


More information about the tex-live mailing list