T he pdfT EX user manual

bj <<
/Font << /F52 5 0 R >>
/ProcSet [ /PDF /Text ]
>> endobj
7 0 obj <<
/Type /Encoding
/Differences [ 0 /.notdef 1/dotaccent/fi/fl
/fraction/hungarumlaut/Lslash/lslash/ogonek
/ring 10/.notdef 11/breve/minus 13/.notdef
14/Zcaron/zcaron/caron/dotlessi/dotlessj/ff
/ffi/ffl 22/.notdef 30/grave/quotesingle
/space/exclam/quotedbl/numbersign/dollar
/percent/ampersand/quoteright/parenleft
/parenright/asterisk/plus/comma/hyphen
/period/slash/zero/one/two/three/four/five
/six/seven/eight/nine/colon/semicolon/less
/equal/greater/question/at/A/B/C/D/E/F/G/H
/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z
/bracketleft/backslash/bracketright
/asciicircum/underscore/quoteleft/a/b/c/d
/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x
/y/z/braceleft/bar/braceright/asciitilde
127/.notdef 130/quotesinglbase/florin
/quotedblbase/ellipsis/dagger/daggerdbl
/circumflex/perthousand/Scaron
/guilsinglleft/OE 141/.notdef 147
/quotedblleft/quotedblright/bullet/endash
/emdash/tilde/trademark/scaron
/guilsinglright/oe 157/.notdef 159
/Ydieresis 160/.notdef 161/exclamdown
/cent/sterling/currency/yen/brokenbar
/section/dieresis/copyright/ordfeminine
/guillemotleft/logicalnot/hyphen/registered
/macron/degree/plusminus/twosuperior
/threesuperior/acute/mu/paragraph
/periodcentered/cedilla/onesuperior
/ordmasculine/guillemotright/onequarter
/onehalf/threequarters/questiondown/Agrave
/Aacute/Acircumflex/Atilde/Adieresis/Aring
/AE/Ccedilla/Egrave/Eacute/Ecircumflex
/Edieresis/Igrave/Iacute/Icircumflex
/Idieresis/Eth/Ntilde/Ograve/Oacute
/Ocircumflex/Otilde/Odieresis/multiply
/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis
/Yacute/Thorn/germandbls/agrave/aacute
/acircumflex/atilde/adieresis/aring/ae
/ccedilla/egrave/eacute/ecircumflex
/edieresis/igrave/iacute/icircumflex
/idieresis/eth/ntilde/ograve/oacute
/ocircumflex/otilde/odieresis/divide
/oslash/ugrave/uacute/ucircumflex
/udieresis/yacute/thorn/ydieresis]
>> endobj
5 0 obj <<
/Type /Font
/Subtype /Type1
/Encoding 7 0 R
/BaseFont /Times-Roman
>> endobj
6 0 obj <<
/Type /Pages
/Count 1
/Kids [2 0 R]
>> endobj
8 0 obj <<
/Type /Catalog
/Pages 6 0 R
>> endobj
9 0 obj <<
/Producer (pdfTeX-1.20a)
/Creator (TeX)
/CreationDate (D:20040915112757+0200)
/PTEX.Fullbanner (This is pdfeTeX,
Version 3.141592-1.20a-rc7.2-2.1
(Web2c 7.5.3) kpathsea version )
>> endobj
xref
0 10
0000000004 65535 f
0000000303 00000 n
0000000194 00000 n
0000000009 00000 n
0000000000 00000 f
0000002159 00000 n
0000002247 00000 n
0000000371 00000 n
0000002304 00000 n
0000002353 00000 n
trailer
<<
/Size 10
/Root 8 0 R
/Info 9 0 R
/ID [<9C5EB4D6BC5DCD07641240C47C497799>
<9C5EB4D6BC5DCD07641240C47C497799>]
>>
startxref
2556
%%EOF The pdfTEX user manual
Hàn Thê´ Thành
Sebastian Rahtz
Hans Hagen
Hartmut Henkel
January 6, 2005
The title page of this manual
represents the plain TEX coded
text Welcome to pdfTEX!
\pdfoutput=1
\pdfcompresslevel=0
\font\tenrm=ptmr8r
\tenrm
Welcome to pdf\TeX!
\bye The pdfTEX user manual
2
Contents
1
Introduction . . . . . . . . . . . . . . . . . .
2
2
About PDF
.
. . . . . . . . . . . . . . . . . .
3
3
Getting started
. . . . . . . . . . . . . . . .
4
4
Macro packages supporting PDFTEX . . 10
5
Setting up fonts . . . . . . . . . . . . . . . .
11
6
Formal syntax specication . . . . . . . .
15
7
New primitives
. . . . . . . . . . . . . . . . 18
8
Graphics and color
. . . . . . . . . . . . .
31
9
Character translation
. . . . . . . . . . . . 32
10
Limitations of PDFTEX . . . . . . . . . . . . 32
Abbreviations . . . . . . . . . . . . . . . . . . . . . 32
Examples of HZ and protruding . . . . . . . . . 33
Additional PDF keys . . . . . . . . . . . . . . . . . 35
Colophon
. . . . . . . . . . . . . . . . . . . . . . . 36
GNU Free Documentation License . . . . . . . 36
1 Introduction
The main purpose of the pdfTEX project is to create and maintain an extension of TEX that can produce pdf directly
from TEX source les and improve/enhance the result of TEX typesetting with the help of pdf. When pdf output is
not selected, pdfTEX produces normal dvi output, otherwise it generates pdf output that looks identical to the dvi
output. An important aspect of this project is to investigate alternative justication algorithms (e. g. a font expansion
algorithm akin to the hz micro--typography algorithm by Prof. Hermann Zapf), optionally making use of multiple
master fonts.
pdfTEX is based on the original TEX sources and Web2c, and has been successfully compiled on Unix, Win32 and
MSDos
systems. It is under active development, with new features trickling in. Great care is taken to keep new
pdfTEX versions backward compatible with earlier ones.
For some years there has been a moderate successor to TEX available, called -TEX. Because mainstream macro
packages such as L
A
TEX have started supporting this welcome extension, pdfTEX also is available as pdfeTEX.
Although in this document we will speak of pdfTEX, we advise users to use pdfeTEX when available. That way they
get the best of all worlds and are ready for the future. Starting with TEX Live 2004, that future has arrived: pdfeTEX is
now the primary TEX engine.
Other extensions to pdfTEX are MLTEX and encTEX; recent pdfTEX engines have these often included.
pdfTEX is maintained by Hàn Thê´ Thành, Martin Schröder, Hartmut Henkel, Hans Hagen and others. The pdfTEX
homepage is
http://www.pdftex.org
. Please send pdfTEX comments and bug reports to the mailing list
pdftex@tug.org.
We thank all readers who send us corrections and suggestions. We also wish to express the hope that pdfTEX will
be of as much use to you as it is to us. Since pdfTEX is still being improved and extended, we suggest you to keep
track of updates.
1.1
About this manual
This manual revision tries to keep track with the recent pdfTEX development up to version 1.20b. Main text updates
were done regarding the new conguration scheme, font mapping, and new or updated primitives. The primary
repository for the manual and its sources is at
http://sarovar.org/projects/pdftex/
. Copies in pdf
format can also be found at the CTAN network in directory
ctan:systems/pdftex
.
Thanks to Karl Berry for proof reading and submitting a long changes list. New errors might have slipped in
afterwards by the editor. Please send questions or suggestions by email to pdftex@tug.org. The pdfTEX user manual
3
1.2
Legal Notice
Copyright © 1996--2005 Hàn Thê´ Thành. Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free
Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the
license is included in the section entitled GNU Free Documentation License.
2 About PDF
The cover of this manual lists an almost minimal pdf le generated by pdfTEX, with the corresponding source le on
the next page. Unless compression is enabled, such a pdf le is rather verbose and readable. The rst line species
the version used; currently pdfTEX produces level 1.4 output. Viewers are supposed to silently skip over all elements
they cannot handle.
A pdf le consist of objects. These objects can be recognized by their number and keywords:
8 0 obj << /Type /Catalog /Pages 6 0 R >> endobj
Here
8 0 obj ... endobj
is the object capsule. The rst number is the object number. Later we will see that
pdfTEX gives access to this number. One can for instance create an object by using
\pdfobj
after which
\pdflastobj
returns the number. So
\pdfobj{/Type /Catalog /Pages 6 0 R}
inserts an object into the le, while
\pdflastobj
returns the number pdfTEX assigned to this object. The
sequence
6 0 R
is an object reference, a pointer to another object (no. 6). The second number (here a zero) is
currently not used in pdfTEX; it is the version number of the object. It is for instance used by pdf editors, when they
replace objects by new ones. The version numbers permit a roll--back. (An example of a graphic editor that uses pdf
as storage format is Adobes Illustrator.)
In general this rather direct way of pushing objects in the les is not very useful, and only makes sense when
implementing, say, ll--in eld support or annotation content reuse. We will come to that later. Unless such direct
objects are part of something larger, they will end up as isolated entities, not doing any harm but not doing any good
either.
When a viewer opens a pdf le, it rst goes to the end of the le. There it nds the keyword
startxref
, the signal
where to look for the so called object cross reference table. This table provides fast access to the objects that make
up the le. The actual starting point of the le is dened after the
trailer
. The
/Root
entry points to the catalog.
In this catalog the viewer can nd the page list. In our example we have only one page. The trailer also holds an
/Info
entry, which tells a bit more about the document. Just follow the thread:
/Root
object 8
/Pages
object 6
/Kids
object 2 page content
As soon as we add annotations, a fancy word for hyperlinks and the like, some more entries are present in the
catalog. We invite users to take a look at the pdf code of this le to get an impression of that.
The page content is a stream of drawing operations. Such a stream can be compressed, where the level of
compression can be set with
\pdfcompresslevel
. Lets take a closer look at this stream. First there is a
transformation mat