| 1 |
The cmap package is intended to make the PDF files generated by |
| 2 |
pdflatex "searchable and copyable" in acrobat reader and other |
| 3 |
compliant PDF viewers. |
| 4 |
|
| 5 |
Just put the line \usepackage{cmap} at the beginning of your preamble, |
| 6 |
and it will pre-load the needed CMap translations for the fonts used |
| 7 |
in the document, provided that there exists the file <encoding>.cmap |
| 8 |
for the font encoding. |
| 9 |
|
| 10 |
Current version of the CMap package includes CMap files for the |
| 11 |
following LaTeX font encodings: T1, T2A, T2B, T2C, T5, OT1, OT1tt, |
| 12 |
OT6, LGR, LAE, LFE. |
| 13 |
|
| 14 |
Adding support for other font encoding does not require the change in |
| 15 |
the cmap.sty package: just create the <encoding>.cmap file and make it |
| 16 |
visible to TeX by putting it into the appropriate directory. |
| 17 |
|
| 18 |
As of version 1.0f, the package detects the monospace (typewriter) |
| 19 |
fonts (by checking whether \fontdimen3=0, \fontdimen4=0 and widths of |
| 20 |
letters "W" and "i" are the same). If a monospace font is detected, |
| 21 |
and a file <encoding>tt.cmap exists, it will be used for this font |
| 22 |
instead of <encoding>.cmap. This is useful for encodings such as OT1 |
| 23 |
where there are variants in mapping between "normal" and "typewriter" |
| 24 |
fonts. |
| 25 |
|
| 26 |
To force loading of the CMap files even for fonts such as cmr10 which |
| 27 |
are normally preloaded into the pdflatex format file, add an option |
| 28 |
[resetfonts]. This will undefine those fonts and load the CMap for |
| 29 |
them (if they will be used in the document). |
| 30 |
|
| 31 |
It works for Type 1 fonts, and also for Type 3 fonts (including the PK |
| 32 |
fonts which are preloaded as Type 3 fonts into PDF) with recent |
| 33 |
versions of pdftex. |
| 34 |
|
| 35 |
The main limitation currently is inability to work with virtual fonts, |
| 36 |
and this is because of limitation of pdftex, and may be resolved in a |
| 37 |
future versions of pdftex. |
| 38 |
|
| 39 |
It is possible to work around this limitation by creating a Type 3 |
| 40 |
font which implements instructions contained in the virtual font. |
| 41 |
|
| 42 |
================================================================== |
| 43 |
|
| 44 |
TODO: |
| 45 |
add *.cmap files for other font encodings (contributions are welcome): |
| 46 |
TS1, OT1, OT2, LY1, IL2, OML, OMS, ... |
| 47 |
support dvips? |
| 48 |
|
| 49 |
History: |
| 50 |
|
| 51 |
2003/03/07 private version |
| 52 |
2003/03/11 version 1.0: first public version |
| 53 |
2003/03/13 version 1.0a: |
| 54 |
change error to warning for non-pdftex |
| 55 |
added warnings if cmap is loaded after fontenc or babel |
| 56 |
added t5.cmap - thanks to Han The Thanh |
| 57 |
2003/03/19 version 1.0b: |
| 58 |
minor refinements |
| 59 |
2003/05/22 version 1.0c: |
| 60 |
fixed a typo due to which the package had no effect at all |
| 61 |
2004/06/16 version 1.0d (wl): |
| 62 |
add support for subfonts as used in the CJK package |
| 63 |
2005/05/03 version 1.0e: |
| 64 |
do not fail under pdftex with \pdfoutput=0 (thanks to Robin Fairbairns) |
| 65 |
2006/12/24 |
| 66 |
added files lae.cmap and lfe.cmap for the Arabic and Farsi encodings, |
| 67 |
contributed by Youssef JABRI <[email protected]> |
| 68 |
2007/04/25 version 1.0f: |
| 69 |
added files ot1.cmap and ot1tt.cmap, contributed by Oleg Katsitadze. |
| 70 |
added "dotless j" mapping to T1, T2A, T2B, T2C; this character |
| 71 |
appeared in unicode 4.1 (noticed by Oleg Katsitadze). |
| 72 |
cmap.sty: added support for loading "typewriter" variant of CMap. |
| 73 |
If a font is monospaced (which is tested by \fontdimen3=0 and |
| 74 |
\fontdimen4=0 and width of "W" = width of "i"), and a file |
| 75 |
<encoding>tt.cmap exists, it will be used for this font instead of |
| 76 |
<encoding>.cmap. |
| 77 |
Added package option "resetfonts" to undefine standard preloaded fonts. |
| 78 |
2007/04/25 version 1.0g: |
| 79 |
fixed a typo |
| 80 |
2008/03/06 version 1.0h: |
| 81 |
added greek mapping (lgr.cmap), contributed by Werner Lemberg |
| 82 |
added armenian mapping (ot6.cmap) |
| 83 |
bugfix - running \usepackage[resetfonts]{cmap} in DVI mode was giving an error |
| 84 |
because the endinput was run too early, and option was not declared - thanks |
| 85 |
to Werner Lemberg |
| 86 |
suppress `Missing character' warnings when testing for monowidth fonts (which may |
| 87 |
not include W and/or i, e.g. some CJK fonts) - thanks to Werner Lemberg |
| 88 |
{t1,t2a,t2b,t2c}.cmap: change mapping of <7F> from <002D> (hyphen-minus) to |
| 89 |
<00AD> (soft hyphen) as, it appears, acrobat reader in this case |
| 90 |
allows to search hyphenated words, ignoring the hyphenation character. |
| 91 |
(this requires redefining the \defaulthyphenchar to 127). This |
| 92 |
change was inspired by discussion with Alexey Kuligin and Alexey Vikhlinin. |
| 93 |
2021/01/29 version 1.0i: |
| 94 |
suppress cmaps automatically generated by pdfTeX for all handled fonts |
| 95 |
2021/02/06 version 1.0j: |
| 96 |
Don't fail if \pdfnobuiltintounicode primitive is missing |
| 97 |
Add support for LuaTeX without luatex85 |