Directory macros/latex/contrib/cmap
README
The cmap package is intended to make the PDF files generated by pdflatex "searchable and copyable" in acrobat reader and other compliant PDF viewers. Just put the line \usepackage{cmap} at the beginning of your preamble, and it will pre-load the needed CMap translations for the fonts used in the document, provided that there exists the file <encoding>.cmap for the font encoding. Current version of the CMap package includes CMap files for the following LaTeX font encodings: T1, T2A, T2B, T2C, T5, OT1, OT1tt, OT6, LGR, LAE, LFE. Adding support for other font encoding does not require the change in the cmap.sty package: just create the <encoding>.cmap file and make it visible to TeX by putting it into the appropriate directory. As of version 1.0f, the package detects the monospace (typewriter) fonts (by checking whether \fontdimen3=0, \fontdimen4=0 and widths of letters "W" and "i" are the same). If a monospace font is detected, and a file <encoding>tt.cmap exists, it will be used for this font instead of <encoding>.cmap. This is useful for encodings such as OT1 where there are variants in mapping between "normal" and "typewriter" fonts. To force loading of the CMap files even for fonts such as cmr10 which are normally preloaded into the pdflatex format file, add an option [resetfonts]. This will undefine those fonts and load the CMap for them (if they will be used in the document). It works for Type 1 fonts, and also for Type 3 fonts (including the PK fonts which are preloaded as Type 3 fonts into PDF) with recent versions of pdftex. The main limitation currently is inability to work with virtual fonts, and this is because of limitation of pdftex, and may be resolved in a future versions of pdftex. It is possible to work around this limitation by creating a Type 3 font which implements instructions contained in the virtual font. ================================================================== TODO: add *.cmap files for other font encodings (contributions are welcome): TS1, OT1, OT2, LY1, IL2, OML, OMS, ... support dvips? History: 2003/03/07 private version 2003/03/11 version 1.0: first public version 2003/03/13 version 1.0a: change error to warning for non-pdftex added warnings if cmap is loaded after fontenc or babel added t5.cmap - thanks to Han The Thanh 2003/03/19 version 1.0b: minor refinements 2003/05/22 version 1.0c: fixed a typo due to which the package had no effect at all 2004/06/16 version 1.0d (wl): add support for subfonts as used in the CJK package 2005/05/03 version 1.0e: do not fail under pdftex with \pdfoutput=0 (thanks to Robin Fairbairns) 2006/12/24 added files lae.cmap and lfe.cmap for the Arabic and Farsi encodings, contributed by Youssef JABRI <yjabri@ensa.univ-oujda.ac.ma> 2007/04/25 version 1.0f: added files ot1.cmap and ot1tt.cmap, contributed by Oleg Katsitadze. added "dotless j" mapping to T1, T2A, T2B, T2C; this character appeared in unicode 4.1 (noticed by Oleg Katsitadze). cmap.sty: added support for loading "typewriter" variant of CMap. If a font is monospaced (which is tested by \fontdimen3=0 and \fontdimen4=0 and width of "W" = width of "i"), and a file <encoding>tt.cmap exists, it will be used for this font instead of <encoding>.cmap. Added package option "resetfonts" to undefine standard preloaded fonts. 2007/04/25 version 1.0g: fixed a typo 2008/03/06 version 1.0h: added greek mapping (lgr.cmap), contributed by Werner Lemberg added armenian mapping (ot6.cmap) bugfix - running \usepackage[resetfonts]{cmap} in DVI mode was giving an error because the endinput was run too early, and option was not declared - thanks to Werner Lemberg suppress `Missing character' warnings when testing for monowidth fonts (which may not include W and/or i, e.g. some CJK fonts) - thanks to Werner Lemberg {t1,t2a,t2b,t2c}.cmap: change mapping of <7F> from <002D> (hyphen-minus) to <00AD> (soft hyphen) as, it appears, acrobat reader in this case allows to search hyphenated words, ignoring the hyphenation character. (this requires redefining the \defaulthyphenchar to 127). This change was inspired by discussion with Alexey Kuligin and Alexey Vikhlinin. 2021/01/29 version 1.0i: suppress cmaps automatically generated by pdfTeX for all handled fonts 2021/02/06 version 1.0j: Don't fail if \pdfnobuiltintounicode primitive is missing Add support for LuaTeX without luatex85
Download the contents of this package in one zip archive (14.8k).
cmap – Make PDF files searchable and copyable
The cmap package provides character map tables, which make PDF files generated by pdfLaTeX both searchable and copy-able in acrobat reader and other compliant PDF viewers. Encodings supported are OT1, OT6, T1, T2A, T2B, T2C and T5, together with LAE (Arabic), LFE (Farsi) and LGR (Greek) and a variant OT1tt for cmtt-like fonts.
The package’s main limitation currently is the inability to work with virtual fonts, because of limitations of pdfTeX. This restriction may be resolved in a future version of pdfTeX.
Package | cmap |
Version | 1.0j 2021-02-06 |
Licenses | The LaTeX Project Public License |
Copyright | 2003–2021 Vladimir Volovich |
Maintainer | Marcel Krüger Vladimir Volovich |
Contained in | TeX Live as cmap MiKTeX as cmap |
Topics | PDF features |
See also | pdftex mmap |