Home > pdftex > Proper use of cmap and mmap

Proper use of cmap and mmap

July 23Hits:2
Advertisement

I am curious about the differences between

  • \usepackage{cmap}
  • \usepackage[resetfonts]{cmap}
  • \usepackage{mmap} (= \usepackage[useTeX]{mmap})
  • \usepackage[noTeX]{mmap}

What are their precise differences? (I am not familiar with (La)TeX internals, so a beginner's explanation would be very helpful.) If this matters: I am using \usepackage[T3,T1]{fontenc} (with T3 being necessitated by the tipa-package), which is important in my case (but might not be important for a fully general answer to this question).

((Also, I am assuming that each of these commands would need to be loaded after loading package fixltx2e but before loading packages times and fontenc. Is that right?))

Update: Kurt's starter code is great. I have uncommented the tipa-lines, saved the file in UTF-8 (and modified the input encoding line to \usepackage[utf8]{inputenc}, and went through all different cmap/mmap-options. However, I see no difference in the text that is pasted from the output pdf-file (perhaps because the MWE uses virtual fonts (by default?)?). Ideally, perhaps someone could help (both of us have tried a lot) to find a minimal example that shows five different output pasting behaviors when the only difference is whether no cmap/mmap or one of the 4 cmap/mmap options is loaded. Ideally that example would also specify the encoding the file is saved in to make this work (remember to not use a BOM for UTF-8; more importantly I don't know whether all input encodings lead to identical behavior (assuming correct escaping of accented characters in input encodings that don't offer a particular character)).

Answers

The package mmap does a little bit more than cmap, it also works for mathematical symbols in your pdf.

So if your pdf does not use mathematics use \usepackage{cmap}. If you have problems with ligatures further on with computer modern use \usepackage[resetfonts]{cmap}. With mathemtic symbols use \usepackage{mmap}. If you have still problems use \usepackage[noTeX]{mmap}.

The differences are:

  • \usepackage{cmap}: accepted preloaded fonts without reloading.
  • \usepackage[resetfonts]{cmap}: as you can read in the README of cmap this forces the reloading of preloaded fonts (Computer Modern).
  • \usepackage[useTeX]{mmap} and \usepackage{mmap}: does everything cmap does plus correcting mathematical symbols in your pdf; uses new -m.cmap files ("uses ascii strings for the macro-names").
  • \usepackage[noTeX]{mmap}: does everything cmap does plus correcting mathematical symbols in your pdf; uses the cmap files (unicode).

Load cmap or mmap first, then fontenc and babel.

The documentation of fixltx2e does only say "load in the preamble". I had no problems loading it after fontenc, babel and the used fonts.

To do your own experiments use the follwing MWE:

\listfiles                      % shows used files
\documentclass[12pt]{scrartcl}
%\usepackage{cmap}              % pure T1 fonts
%\usepackage[resetfonts]{cmap}  % pure T1 fonts, reset CM
%\usepackage{mmap}              % cmap + mathematics (ASCII)
%\usepackage[noTeX]{mmap}       % cmap + mathematics (Unicode)

 \usepackage[Latin9]{inputenc}  % or utf-8
 \usepackage[T1]{fontenc}       % font encription
%\usepackage[T3,T1]{fontenc}    % T3 for package tipa
%\usepackage{tipa}              % Phonetic alphabet
 \usepackage[ngerman]{babel}    % neue deutsche Rechtschreibung

%\usepackage{lmodern}           % Latin Modern
%\usepackage{tgpagella}         % has no virtual fonts
%\usepackage[osf]{mathpazo}     % Minuskelziffern okay

%\usepackage{libertine}         % Libertine Legacy (with virtual fonts)
 \usepackage[osf]{libertine}    % mit Medivalziffern bzw. Minuskelziffern

\newcommand*{\III}{\libertineGlyph{Threeroman}}
\newcommand*{\IV}{\libertineGlyph{Fourroman}}

\begin{document}

Römische Zahlen: \III, \IV.

\textsc{Ligaturen}: auffliegen auffinden finden Auflage Schifffahrt.

\textsc{Korrekt}: auf\/fliegen auf\/finden finden Auf\/lage Schiff\/fahrt.

Ziffern: 0123456789.

Donau Donaudampfschiff Donaudampfschifffahrt Donaudampfschifffahrtskapitän
Donaudampfschifffahrtskapitän
Donaudampfschifffahrtskapitän Donaudampfschifffahrtskapitän
Donaudampfschifffahrtskapitän Donaudampfschifffahrtskapitän

%\textipa{[\!b] [\:r] [\;B]}

\end{document}

Set or delete the comment sign to test cmap and mmap with or without fontenc and different fonts.

BTW: "Donaudampfschifffahrtskapitän" is a German word, good to get hyphenations.

Related Articles

  • Proper use of cmap and mmapJuly 23

    I am curious about the differences between \usepackage{cmap} \usepackage[resetfonts]{cmap} \usepackage{mmap} (= \usepackage[useTeX]{mmap}) \usepackage[noTeX]{mmap} What are their precise differences? (I am not familiar with (La)TeX internals, so a be

  • Search and find an old style numeral in a pdfJune 5

    I am compiling this tex file \documentclass{article} \usepackage{hfoldsty} \begin{document} 1 $1$ \end{document} with pdflatex and open the resulting pdf with evince. If I search the digit one (1), it finds only the second one which is in upper case

  • Warning: No -m.map found for TS1November 2

    I'm using the cmap package, the mmap package and the textcomp package along with them and I'm getting the following error when trying to include the \copyright symbol: Package mmap Warning: !!! No -m.cmap file found for TS1 !!! I have a pretty basic

  • What are good ways to make pdflatex output copy-and-pasteable?July 21

    One frequent aspect of pdflatex output that could be improved is to what extent one can select text output from the generated pdf-file and copy-and-paste it. This is essentially an issue of having the right output encoding. There are at least two imp

  • How can I get a PDF with copyable text if I need to use \usepackage[T1]{fontenc}? July 21

    One frequent aspect of pdflatex output that could be improved is to what extent one can select text output from the generated pdf-file and copy-and-paste it. This is essentially an issue of having the right output encoding. There are at least two imp

  • Problems With Text Encoding While Cutting July 21

    One frequent aspect of pdflatex output that could be improved is to what extent one can select text output from the generated pdf-file and copy-and-paste it. This is essentially an issue of having the right output encoding. There are at least two imp

  • PDFLaTeX encoding problem July 21

    One frequent aspect of pdflatex output that could be improved is to what extent one can select text output from the generated pdf-file and copy-and-paste it. This is essentially an issue of having the right output encoding. There are at least two imp

  • Not possible to search for umlaute in LaTeX July 21

    One frequent aspect of pdflatex output that could be improved is to what extent one can select text output from the generated pdf-file and copy-and-paste it. This is essentially an issue of having the right output encoding. There are at least two imp

  • Cannot copy text from the simplest PDF file?

    Cannot copy text from the simplest PDF file?May 19

    Consider the following code: \documentclass{article} \begin{document} We define multiplication by $$v_1x = 0,\quad v_2x = v_1,\quad v_1y = -v_1,\quad v_2y = v_1$$ \end{document} which looks like this It's as simple as it gets, but when I copy the con

  • mmap/cmap problem: text in equations is not properly copy-pastableDecember 11

    \documentclass[12pt,a4paper]{article} \usepackage[noTeX]{mmap} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \begin{document} $(A\to B)\vdash B$ sample text \end{document} The text copied from the resulted pdf is no

  • Does anyone know what a cmap file has to look likeApril 18

    This may be an off-topic fringe case, but I need it for pdftex... I made an encoding QS7 for ASCII+Greek and now the only thing missing is a CMAP file to enable copying text from acroread. I made the following file qs7.cmap by trying to mimic the oth

  • mmap system call returning -14(-EFAULT??)February 12

    I am implementing mmap function using system call.(I am implementing mmap manually because of some reasons.) But I am getting return value -14 (-EFAULT, I checked with GDB) whith this message: WARN Nar::Mmap: Memory allocation failed. Here is functio

  • Convert "ção" and other portuguese characters into proper characters November 10

    I'm setting up a new server, and want to support UTF-8 fully in my web application. I have tried in the past on existing servers and always seem to end up having to fall back to ISO-8859-1. Where exactly do I need to set the encoding/charsets? I'm aw

  • How to set svn:auto-props for repository April 2

    Hi I was wondering if there is a way for the SVN server to automatically assign the svn:needs-lock property on any file that is binary and not textual. We have a rather small developers team but resting on everyone to remember to set this property on

  • What configuration items do you track for proper configuration management? May 26

    As a professional system administrator, what configuration items do you consider it essential to track to perform proper configuration or change management? For example, in Windows, do you track registry changes in addition to hardware or software? I

  • T1 and proper DNS/Network setupJune 16

    I have a T1 coming into one of my offices now, I would like to do some hosting from some boxes on location. My rudimentary setup was to use my domain registrar to add A-records pointing towards my T1's IP (one of the 5 we get) The A-record works but

  • Subversion - Can I set auto-props on the server side?June 22

    I'm maintaining a SVN server and on user needs to commit many adobe illustrator files (ie *.ai). I can use the auto-props in their config to set it as a binary file so that it won't be in the mailing list commits. However I'd like to make this as eas

  • Proper way to create a zfs off an existing directory?July 13

    Lets say I have an rpool with etc/ as a regular directory within it and now I want to create a separate zfs rpool/etc, obviously inheriting all the data I had in original /etc. What would be the most proper and safe way to do so? --------------Soluti

  • SQL Server 2005: Proper Backup ScheduleJuly 18

    I'm a .NET Developer and I know how to write SQL but am clueless at doing any form of database maintenance scheduling yadda So, I've recently taken over a project from a previous client. The site is hosted with Rackspace. Anyway, the previous client

  • Proper syntax for generating an SSL certificate CSR to protect an Exchange 2007 serverJuly 30

    I need help generating a CSR for a Subject Alternative Name (SAN) SSL certificate to protect a new Exchange 2007 server. My main requirements are that Outlook Anywhere and OWA must work without any errors or warnings. It would be nice if the Outlook

Copyright (C) 2017 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.426 s.