% interface=english modes=letter,screen output=pdftex

%D We use a multi purpose style (using modes) that enable us
%D to generate an A4, letter and screen version. 
%D
%D Default A4 size manual: 
%D
%D texexec pdftex-t
%D
%D Letter size manual: 
%D
%D texexec --mode=letter pdftex-t 
%D
%D Booklet (given that A4 document is available):
%D
%D texexec --pdfarrange --paper=a5a4 --print=up --addempty=1,2 pdftex-t
%D
%D Screen version 
%D 
%D texexec --mode=screen pdftex-t 

%D This is the \PDFTEX\ manual, so it makes sense to force \PDF\ output here. 

\setupoutput
  [pdftex]

%D First we define ourselves some abbreviations, if only to force
%D consistency and to save typing. We use real small capitals, not pseudo
%D ones.

\setupsynonyms
  [abbreviation]
  [textstyle=smallcaps,
   location=left,
   width=broad,
   sample=\POSTSCRIPT]

\setupcapitals
  [title=no]

\abbreviation [AFM]        {afm}        {Adobe Font Metrics}
\abbreviation [AMIGA]      {Amiga}      {Amiga hardware platform}
\abbreviation [AMIWEB]     {AmiWeb2c}   {\AMIGA\ distribution}
\abbreviation [ASCII]      {ascii}      {American Standard Code for Information Interchange}
\abbreviation [CMACTEX]    {CMac\TeX}   {\MAC\ \WEBC\ distribution}
\abbreviation [CONTEXT]    {\ConTeXt}   {general purpose macro package}
\abbreviation [DJGPP]      {djgpp}      {DJ Delorie's \GNU\ Programming Platform}
\abbreviation [DVI]        {dvi}        {natural \TEX\ Device Independ fileformat}
\abbreviation [EPSTOPDF]   {epstopdf}   {\EPS\ to \PDF\ conversion tool}
\abbreviation [EPS]        {eps}        {Encapsulated PostScript}
\abbreviation [ETEX]       {e-\TeX}     {an extension to \TEX}
\abbreviation [FPTEX]      {fp\TeX}     {\WIN\ \WEBC\ distribution}
\abbreviation [GNU]        {gnu}        {GNU's Not Unix}
\abbreviation [JPEG]       {jpeg}       {Joined Photographic Expert Group}
\abbreviation [LATEX]      {\LaTeX}     {general purpose macro package}
\abbreviation [MAC]        {MacIntosh}  {MacIntosh hardware platform}
\abbreviation [METAFONT]   {\MetaFont}  {graphic programming environment, bitmap output}
\abbreviation [METAPOST]   {\MetaPost}  {graphic programming environment, vector output}
\abbreviation [MIKTEX]     {MikTeX}     {\WIN\ distribution}
\abbreviation [MSDOS]      {MSDos}      {Microsoft DOS platform (Intel)}
\abbreviation [PDFETEX]    {pdfe-\TeX}  {\ETEX\ extension producing \PDF\ output}
\abbreviation [PDFTEX]     {pdf\TeX}    {\TEX\ extension producing \PDF\ output}
\abbreviation [PDF]        {pdf}        {Portable Document Format}
\abbreviation [PERL]       {Perl}       {Perl programming environment}
\abbreviation [PGC]        {pgc}        {\PDF\ glyph container}
\abbreviation [PK]         {pk}         {Packed Bitmap Font}
\abbreviation [PNG]        {png}        {Portable Network Graphics}
\abbreviation [POSTSCRIPT] {PostScript} {PostScript}
\abbreviation [RGB]        {rgb}        {Red Green Blue color specification}
\abbreviation [TETEX]      {te\TeX}     {\UNIX\ \WEBC\ distribution}
\abbreviation [TEXEXEC]    {\TeX exec}  {\CONTEXT\ command line interface}
\abbreviation [TEXUTIL]    {\TeX util}  {\CONTEXT\ utility tool}
\abbreviation [TEX]        {\TeX}       {typographic language and program}
\abbreviation [TFM]        {tfm}        {\TEX\ Font Metrics}
\abbreviation [TIF]        {tiff}       {Tagged Interchange File Format}
\abbreviation [TUG]        {tug}        {\TEX\ Users Group}
\abbreviation [UNIX]       {Unix}       {Unix platform}
\abbreviation [URL]        {url}        {Uniform Resource Locator}
\abbreviation [WEBC]       {Web2c}      {official multi||platform \WEB\ environment}
\abbreviation [WEB]        {web}        {literate programming environment}
\abbreviation [WIN]        {Win32}      {Microsoft Windows platform}
\abbreviation [ZIP]        {zip}        {compressed file format}

%D It makes sense to predefine the name of the author of \PDFTEX, doesn't it?

\def\THANH{H\`an Th\^e\llap{\raise 0.5ex\hbox{\'{}}} Th\`anh}

%D Because they are subjected to changes and spoil the visual appearance of
%D the \TEX\ source, \URL's are defined here.

\useURL [updates]   [ftp://ftp.cstug.cz/pub/tex/local/cstug/thanh/pdftex/latest]
\useURL [tetex]     [http://www.tug.org/teTeX/]
\useURL [win32]     [ctan:systems/win32]
\useURL [amiga]     [ctan:systems/amiga/amiweb2c/]
\useURL [examples]  [http://www.tug.org/applications/pdftex/]

\useURL [fabrice]   [popineau@ese-metz.fr]
\useURL [andreas]   [andreas.scherer@pobox.com]
\useURL [christian] [cschenk@berlin.snafu.de]
\useURL [context]   [http://www.ntg.nl/context/]

\useURL [sebastian] [mailto:s.rahtz@elsevier.co.uk]    [] [s.rahtz@elsevier.co.uk]
\useURL [thanh]     [mailto:thanh@informatics.muni.cz] [] [thanh@informatics.muni.cz]
\useURL [hans]      [mailto:pragma@wxs.nl]             [] [pragma@wxs.nl]

%D The primitive definitions are specified a bit fuzzy using the next set of
%D commands. Some day I'll write some proper macros to deal with this.

\def\Sugar    #1{\unskip\unskip\unskip\kern.25em{#1}\kern.25em\ignorespaces}
\def\Something#1{\Sugar{\mathematics{\langle\hbox{#1}\rangle}}}
\def\Lbrace     {\Sugar{\tttf\leftargument}}
\def\Rbrace     {\Sugar{\tttf\rightargument}}
\def\Or         {\Sugar{\mathematics{\vert}}}
\def\Optional #1{\Sugar{\mathematics{[\hbox{#1}]}}}
\def\Means      {\Sugar{\mathematics{\rightarrow}}}
\def\Tex      #1{\Sugar{\type{#1}}}
\def\Literal  #1{\Sugar{\type{#1}}}
\def\Syntax   #1{\strut\kern-.25em{#1}\kern-.25em}
\def\Next       {\crlf\hbox to 2em{}\nobreak}
\def\Whatever #1{\Sugar{\mathematics{(\hbox{#1})}}}

%D We typeset the \URL's in a monospaced font.

\setupurl
  [style=type]

%D The basic layout is pretty simple. Because we want non european readers to
%D read the whole text as well, a letter size based alternative is offered 
%D too. Mode switching is taken care of at the command line when running 
%D \TEXEXEC.

\startmode[letter]

  \setuppapersize
    [letter][letter]

\stopmode

\setuplayout
  [topspace=1.5cm,
   backspace=2cm,
   leftmargin=2cm,
   width=middle,
   footer=1.5cm,
   header=1.5cm,
   height=middle]

%D For the moment we use the description mechanism to typeset keywords etc. 
%D Well, I should have used capitals.

\definedescription
  [description]
  [location=serried,
   width=broad]

\definedescription
  [PathDescription]
  [location=left,
   sample=TEXPSHEADERS,
   width=broad,
   headstyle=type]

\definehead
  [pdftexprimitive]
  [subsubsection]

\setuphead
  [pdftexprimitive]
  [style=,
   before=\blank,
   after=\blank,
   numbercommand=\SubSub]

%D This is typically a document where we want to save pages,
%D so we don't start any matter (part) on a new page.

\setupsectionblock [frontpart] [page=]
\setupsectionblock [bodypart]  [page=]
\setupsectionblock [backpart]  [page=]

%D The \type {\SubSub} command is rather simple and generates a triangle. 
%D This makes the primitives stand out a bit more.

\def\SubSub#1{\mathematics{\blacktriangleright}}

%D But, for non Lucida users, the next one is more safe:  

\def\SubSub#1{\goforwardcharacter}

%D I could have said:
%D
%D \starttyping
%D \setupsection[section-5][previousnumber=no,bodypartconversion=empty]
%D \setuplabeltext[subsubsection=\mathematics{\blacktriangleright}]
%D \stoptyping
%D
%D but this is less clear.

%D We use white space, but not too much.

\setupwhitespace
  [medium]

\setupblank
  [medium]

%D Verbatim things get a small margin.

\setuptyping
  [margin=standard]

%D Due to the lots of verbatim we will be a bit more tolerant in breaking 
%D paragraphs into lines.

\setuptolerance
  [verytolerant,stretch]

%D We put the chapter and section numbers in the margin and use bold fonts.

\setupheads
  [alternative=margin]

\setuphead
  [section]
  [style=\bfb]

\setuphead
  [subsection]
  [style=\bfa]

%D The small table of contents is limited to section titles and is fully 
%D interactive.

\setuplist
  [section]
  [criterium=all,
   interaction=all,
   width=2em,
   alternative=a]

%D Ah, this manual is in english!

\mainlanguage
  [en]

%D We use Lucida Bright fonts, because they look so well on the screen.

\setupbodyfont
  [lbr,10pt]

%D This document is mildly interactive. Yes, H\'an's name will end up ok in 
%D the document information data.

\setupinteraction
  [state=start,
   style=normal,
   color=,
   page=yes,
   openaction=firstpage,
   title=the pdfTeX users manual,
   author={H\`an Th\^e Th\`anh, Sebastian Rahtz, Hans Hagen}]

\setupinteractionscreen % still needed? 

\startnotmode[screen]

\setupinteractionscreen
  [option=bookmark]

\stopnotmode

%D Some headers and footers will complete the layout.

\setupheadertexts
  [The pdf\TeX\ user manual]

\setupfootertexts
  [pagenumber]

%D For Tobias Burnus, who loves bookmarks, I've enabled them.

\placebookmarks
  [section,subsection,pdftexprimitive]

%D Let's also define a screen layout: 

\startmode[screen] \environment pdftex-i \stopmode

%D We auto-cross link the paper and screen version:

\startnotmode[screen] 

\coupledocument
  [screenversion]
  [pdftex-s]
  [section,subsection,subsubsection,pdftexprimitive]
  [the screen version]

\setuphead
  [section,subsection,subsubsection,pdftexprimitive]
  [file=screenversion]

\setuplist
  [section]
  [alternative=c] 

\stopnotmode

%D The text starts here!

\starttext

%D Being lazy, I don't split the file, so paper andscreen get
%D mixed in one document. 

\startmode[screen] \getbuffer[screen] \stopmode

\startnotmode[screen]

%D But first we typeset the title page. It has a background. This background,
%D showing a piece of \PDF\ code, will be refered to later on.

\NormalizeFontWidth
  \TitleFont
  {\hskip1mm The pdf\TeX\ user manual} % 1 mm is fake offset 
  \paperheight
  {RegularBold}

\setupbackgrounds
  [page]
  [background={title,joke,names,content}]

\defineoverlay
  [title]
  [\hbox to \paperwidth
     {\hfill
      \TitleFont\setstrut
      \roteer{The pdf\TeX\ user manual}%
      \hskip\dp\strutbox}]

\defineoverlay
  [joke]
  [\hbox to \paperwidth
     {\TitleFont\setstrut
      \dimen0=\overlaywidth
      \advance\dimen0 by -\ht\strutbox
      \advance\dimen0 by -\dp\strutbox
      \advance\dimen0 by -1cm
      \dimen2=\overlayheight
      \advance\dimen2 by -1cm
      \hskip.5cm\externalfigure[pdftex-z][type=pdf,width=\dimen0,height=\dimen2]%
      \hfill}]

\defineoverlay
  [names]
  [\vbox to \paperheight
     {\dontcomplain
      \TitleFont\setstrut
      \setbox0=\hbox{\TeX}%
      \hsize\paperwidth
      \rightskip\ht0
      \advance\rightskip\dp\strutbox
      \advance\rightskip\dp\strutbox
      \bfa \setupinterlinespace
      \vfill
      \hfill \THANH \endgraf
      \hfill Sebastian Rahtz \endgraf
      \hfill Hans Hagen
      \vskip 1ex
      \hfill \currentdate
      \vskip 2ex}]

\defineoverlay
  [content]
  [\overlaybutton{contents}]

\startstandardmakeup

%D The titlepage is generated using the background overlay mechanism. This 
%D saves me the trouble of determining funny skips and alignments. So no text
%D goes here.

\stopstandardmakeup

\setupbackgrounds
  [page]
  [background=]

%D The inside title page is as follows.

\startstandardmakeup

  \dontcomplain

  \setupalign[left]

  \start

    \bfd The pdf\TeX\ manual

    \bfa \setupinterlinespace

    \vskip4ex

    \leavevmode \from[thanh]     ---          \THANH\par
    \leavevmode \from[sebastian] --- Sebastian Rahtz\par
    \leavevmode \from[hans]      ---      Hans Hagen\par

    \vskip2ex

    \currentdate

  \stop

  \vfill

  The title page of this manual    \par
  represents the plain \TeX\ coded \par
  text ``Welcome to pdf\TeX !''

  \vskip\lineheight

  \type{\pdfoutput=1}         \par
  \type{\pdfcompresslevel=0}  \par
  \type{\font\tenrm=tir}      \par
  \type{\tenrm}               \par
  \type{Welcome to pdf\TeX !} \par
  \type{\end}                 \par

\stopstandardmakeup

%D So far for non screen mode.

\stopnotmode

%D We start with a small table of contents, typeset in double column format.

\startfrontmatter

\subject[contents]{Contents}

\startcolumns
\placelist[section]
\stopcolumns

\stopfrontmatter

%D And here it is: the main piece of text.

\startbodymatter

\section{Introduction}

The main purpose of the \PDFTEX\ project was to create an extension of \TEX\
that can create \PDF\ directly from \TEX\ source files 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 produces
\PDF\ output that looks identical to the \DVI\ output. An important aspect of
this project is to investigate alternative justification algorithms,
optionally making use of multiple master fonts. 

\PDFTEX\ is based on the original \TEX\ sources and \WEBC, and has been
successfully compiled on \UNIX, \WIN\ and \MSDOS\ systems. It is still
under beta development and all features are liable to change. Despite its
$\beta$||state, \PDFTEX\ produces excellent \PDF\ code.

As \PDFTEX\ evolves, this manual will evolve and more background information
will be added. Be patient with the authors.

This manual is typeset in \CONTEXT. One can generate an A4 version from the 
source code by saying: 

\starttyping
texexec  pdftex-t 
\stoptyping

An letter size variant is also supported: 

\starttyping
texexec  --mode=letter  pdftex-t 
\stoptyping

Given that the A4 version is typeset, one can generate a booklet by saying:
 
\starttyping
texexec --pdfarrange --paper=a5a4 --print=up --addempty=1,2 pdftex-t
\stoptyping

This also demonstrates that \PDFTEX\ can be used for page imposition purposes
(given that \PDFTEX\ and the fonts are set up all right). 

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 keep
track of updates. 

\section{About \PDF}

The cover of this manual shows a simple \PDF\ file. Unless compression
and|/|or encryption is applied, such a file is rather verbose and readable.
The first line specifies the version used; currently \PDFTEX\ produces level
1.2 output. Viewers are supposed to silently skip over all elements they
cannot handle.

A \PDF\ file consist of objects. These objects can be recognized by their
number and keywords:

\starttyping
8 0 obj << /Type /Catalog /Pages 6 0 R >> endobj
\stoptyping

Here \typ{8 0 obj ... endobj} is the object capsule. The first 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 \type {\pdfobj} after
which \type {\pdflastobj} returns the number. So

\starttyping
\pdfobj{/Type /Catalog /Pages 6 0 R}
\stoptyping

inserts an object into the file, while \type {\pdflastobj} returns the number
\PDFTEX\ assigned to this object. The sequence \type{6 0 R} is an object
reference, a pointer to another object. 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.

In general this rather direct way of pushing objects in the files is rather
useless and only makes sense when implementing for instance fill||in field
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\ file, it first goes to the end of the file. There
it finds the keyword \type{startxref}, the signal where to look for the so
called \quote {object cross reference table}. This table provides fast access
to the objects that make up the file. The actual starting point of the file
is defined after the \type {trailer}. The \type{/Root} entry points to the
catalog. In this catalog the viewer can find the page list. In our example we
have only one page. The trailer also holds an \type{/Info} entry, which tells
a bit more about the document. Just follow the thread:

\startnarrower
\type{/Root}  $\longrightarrow$ object~8 $\longrightarrow$
\type{/Pages} $\longrightarrow$ object~6 $\longrightarrow$
\type{/Kids}  $\longrightarrow$ object~2 $\longrightarrow$ page content
\stopnarrower

As soon as we add annotations, a fancy word for hyperlinks and alike, some
more entries are present in the catalog. We invite users to take a look at
the \PDF\ code of this file 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 \type
{\pdfcompresslevel}. Let's take a closer look at this stream. First there is
a transformation matrix, six numbers followed by \type{cm}. As in
\POSTSCRIPT, the operator comes after the operands. Between \type {BT} and
\type {ET} comes the text. A font switch can be recognized as \type{/F..}.
The actual text goes between \type{()} so that it creates a \POSTSCRIPT\
string. When one analyzes a file produced by a less sophisticated typesetting
engine, whole sequences of words can be recognized. In \TEX\ however, the
text comes out rather fragmented, mainly because a lot of kerning takes
place. Because viewers can search in these streams, one can imagine that the
average \TEX\ produced files becomes more difficult as soon as the
typesetting engine does a better job; \TEX\ cannot do less.

This one page example uses an Adobe Times Roman font. This is one of the
14~fonts that is always present in the viewer application, and is called a
base font. However, when we use for instance Computer Modern Roman, we have
to make sure that this font is available, and the best way to do this is to
embed it in the file. Just let your eyes follow the object thread and see how
a font is described. The only thing missing in this example is the
(partially) embedded glyph description file, which for the base fonts is not
needed.

In this simple file, we don't specify in what way the file should be opened,
for instance full screen or clipped. A closer look at the page object
(\typ{/Type /Page}) shows that a mediabox is part of the page description. A
mediabox acts like the bounding box in a \POSTSCRIPT\ file. \PDFTEX\ users
have access to this object by \type {\pdfpageattr}.

Although in most cases macro packages will shield users from these internals,
\PDFTEX\ provides access to many of the entries described here, either
automatically by translating the \TEX\ data structures into \PDF\ ones, or
manually by pushing entries to the catalog, page, info or self created
objects. Those who, after this introduction, feel uncomfortable in how to
proceed, are advised to read on but skip \in{section}[primitives]. Before we
come to that section, we will describe how to get started with \PDFTEX.

\section{Getting started}

This section describes the steps needed to get \PDFTEX\ running on a system
where \PDFTEX\ is not yet installed. Some \TEX\ distributions have \PDFTEX\
as a component, like \TETEX, \FPTEX, \MIKTEX\ and \CMACTEX, so when you use
one of them, you don't need to bother with the \PDFTEX\ installation. Note
that the installation description in this manual is \WEBC||specific.

For some years there has been a \quote {moderate} successor to \TEX\
available, called \ETEX. Because the main stream macro packages start
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.

\subsection{Getting sources and binaries}

The latest sources of \PDFTEX\ are distributed together with precompiled
binaries of \PDFTEX\ for some platforms, including Linux \footnote {The Linux
binary is compiled for the new \type {libc-6} (\GNU\ \filename {glibc-2.0}),
which will not run for users of older Linux installations still based on
\type {libc-5}.}, SGI IRIX, Sun SPARC Solaris and \MSDOS\ (\DJGPP). \footnote
{The \DJGPP\ version is built by \DJGPP~2.0 cross||compiler on Linux.} The
primary location where one can fetch the source code (by version) is:

\startnarrower
\from[updates]
\stopnarrower

Thomas Esser's \TETEX\ distribution comes with precompiled versions for many
\UNIX\ systems. More information can be found at: \from[tetex]. For \WIN\
systems (Windows 95, Windows NT) there are two packages that contain \PDFTEX,
both in \from[win32]: \FPTEX, maintained by Fabrice Popineau, \from[fabrice],
and \MIKTEX\ by Christian Schenk, \from[christian]. 

\subsection{Compiling}

If there is no precompiled binary of \PDFTEX\ for your system, you need to
build \PDFTEX\ from sources. The compilation is expected to be easy on
\UNIX||like systems and can be described best by example. Assuming that all
needed files are downloaded to \filename {\$HOME/pdftex}, on a \UNIX\ system
the following steps are needed to compile \PDFTEX:

\starttyping
cd $HOME/pdftex
gunzip < web-7.3.tar.gz | tar xvf -
gunzip < web2c-7.3.tar.gz | tar xvf -
gunzip < pdftex.tar.gz | tar xvf -
mv pdftexdir web2c-7.3/web2c
cd web2c-7.3
./configure
cd web2c
make pdftex
\stoptyping

If you happen to have a previously configured source tree and just install a
new version of \PDFTEX, you can avoid running \filename {configure} from the
top||level directory. It's quicker to run \filename {config.status}, which
will just regenerate the \type{Makefile}'s based on \filename {config.cache}:

\starttyping
cd web2c-7.3/web2c
sh config.status
make pdftex
\stoptyping

For \UNIX\ users the savest way to generate binaries is to get the latest
\TETEX\ and follow the instructions that come with it. 

Apart from the binary of \PDFTEX\ the compilation also produces several other
files which are needed for running \PDFTEX:

\description {\filename{pdftex.pool}} The pool file, needed for
creating formats, located in \filename {web2c-7.3/web2c}

\description {\filename{texmf.cnf}} \WEBC\ run||time configuration file,
located in \filename {web2c-7.3/kpathsea}

\description {\filename{ttf2afm}} An external program to generate \AFM\ files
from TrueType fonts, located in \filename {web2c-7.3/web2c/pdftexdir}

Precompiled binaries are included in the \ZIP\ archive \filename
{pdftex.zip}.

\subsection{Getting \PDFTEX||specific platform||independent files}

Apart from the above||mentioned files, there is another \ZIP\ archive
(\filename {pdftexlib.zip}) in the \PDFTEX\ distribution which contains
platform||independent files required for running \PDFTEX:

\startitemize[packed]
\item configuration file: \filename {pdftex.cfg}
\item encoding vectors: \type {*.enc}
\item map files: \type {*.map}
\item macros: \type {*.tex}
\stopitemize

Unpacking this archive |<|don't forget the \type {-d} option when using \type
{pkunzip}|>| will create a \type {texmf} tree containing \PDFTEX||specific
files.

\subsection{Placing files}

The next step is to place the binaries somewhere in \type {PATH}. If you want
to use \LATEX, you also need to make a copy (or symbolic link) of \type
{pdftex} and name it \type {pdflatex}. The files \filename {texmf.cnf} and
\filename {pdftex.pool} and the directory \filename {texmf/}, created by
unpacking the file \filename {pdftexlib.zip}, should be moved to the
\quote {appropriate} place (see below).

\subsection{Setting search paths}

\WEBC||based programs, including \PDFTEX, use the \WEBC\ run||time
configuration file called \filename {texmf.cnf}. This file can be found via
the user||set environment variable \type {TEXMFCNF} or via the compile||time
default value if the former is not set. It is strongly recommended to use the
first option. Next you need to edit \filename {texmf.cnf} so \PDFTEX\ can
find all necessary files. Usually one has to edit \type {TEXMFS} and maybe
some of the next variables. When running \PDFTEX, some extra search paths are
used beyond those normally requested by \TEX\ itself:

\startbuffer
\starttabulate[|l|l|l|]
\HL 
\NC \bf used for   \NC \bf format                     \NC \bf texmf.cnf       \NC\NR
\HL  
\NC virtual fonts  \NC kpse\_vf\_format               \NC \type{VFFONTS}      \NC\NR
\NC type1 fonts    \NC kpse\_type1\_format            \NC \type{T1FONTS}      \NC\NR
\NC truetype fonts \NC kpse\_truetype\_format         \NC \type{TTFONTS}      \NC\NR
\NC pgc fonts      \NC kpse\_miscfonts\_format        \NC \type{MISCFONTS}    \NC\NR
\NC pdftex.cfg     \NC kpse\_tex\_format              \NC \type{TEXINPUTS}    \NC\NR
\NC images         \NC kpse\_tex\_format              \NC \type{TEXINPUTS}    \NC\NR
\NC map files      \NC kpse\_tex\_ps\_header\_format  \NC \type{TEXPSHEADERS} \NC\NR 
\NC encoding files \NC kpse\_tex\_ps\_header\_format  \NC \type{TEXPSHEADERS} \NC\NR 
\HL 
\stoptabulate
\stopbuffer

\placetable
  {The \WEBC\ variables.}
  {\getbuffer}

\PathDescription {VFFONTS} Virtual fonts are fonts made up of others and 
\type {vf} files play an important role in this process. Because \PDFTEX\ 
produces the final output code, it must consult those files. 

\PathDescription {T1FONTS} Outline (vector) fonts are to be prefered over 
bitmap \PK\ fonts. In most cases Type~1 fonts are used and this variable 
tells \PDFTEX\ where to find them. 

\PathDescription {TTFONTS} Like Type~1 fonts, TrueType fonts are also 
outlines.

\PathDescription {MISCFONTS} \PDFTEX\ is able to read so called \type {pdf 
glyph container} files. These contain fonts descriptions in \PDF\ format. (A 
separate manual will be made available soon.) 

\PathDescription {PKFONTS} Unfortunately bitmap fonts are displayed poorly by
\PDF\ viewers, so when possible one should use outline fonts. When no outline
is available, \PDFTEX\ tries to locate a suitable \PK\ font (or invoke a 
process that generates them). 

\PathDescription {TEXINPUTS} This variable specifies where \PDFTEX\ finds its
configuration file and input files. Being a postprocessor too, image files 
are considered input files and searched for along this path.  

\PathDescription {TEXPSHEADERS} This is the path where \PDFTEX\ looks for the
font mapping files (\type {*.map}) and encoding files (\type {*.enc}). Both 
types provide \PDFTEX\ the information needed for embedding font encoding 
vectors and font resources. 

\subsection[cfg]{The \PDFTEX\ configuration file}

One has to keep in mind that, opposed to \DVI\ output, there is no
postprocessing stage. This has several rather fundamental consequences, like
one||pass graphic and font inclusion. When \TEX\ builds a page, the macro
package used quite certain has a concept of page dimensions, which is not the
same as paper dimensions. The reference point of the page is the top||left
corner.

Most \DVI\ postprocessors enable the user to specify the paper size, which
often defaults to \quote {A4} or \quote{letter}. In most cases it does not
harm that much to mix the two, because one will seldom put too small paper in
the printer. And, if one does, one will certainly not do that a second time.
In \PDF\ the paper size is part of the definition. This means that everything
that is off page, is clipped off, it simply disappears. Even worse, just like
in a \POSTSCRIPT\ file, the reference point is in the lower corner, which is
opposite to \DVI's reference point.

And so, we've found one of the main reasons why \PDFTEX\ explicitly needs to
know the paper dimensions. These dimensions can either be passed using the so
called configuration file, or by using the primitives provided for this
purpose. In this respect, the \PDFTEX\ configuration file can be compared to
configuration files that come with \DVI\ postprocessors and|/|or command line
options. Both contain information on the paper used, the fonts to be included
and optimizations to be applied.

When \PDFTEX\ is run in ini||mode, which is normally the case when we
generate a format file, the configuration file is not read at all, and all
configuration parameters are set to~0 by default for both integer and
dimension parameters. 

When \PDFTEX\ is launched in non||ini mode, it reads the \WEBC\ configuration
file as well as the \PDFTEX\ configuration file called \filename
{pdftex.cfg}, searched for in the \type {TEXINPUTS} path. As \WEBC\ systems
commonly specify a \quote {private} tree for \PDFTEX\ where configuration and
map files are located, this allows individual users or projects to maintain
customized versions of the configuration file. The configuration file must
exist when \PDFTEX\ is run (except when generating a format). 

The integer configuration parameters replace the corresponding internal ones
just before \PDFTEX\ starts reading the input file. At this moment the format
is already loaded, so any former settings during creating formats will be
overwritten by the values from config file. So, unless the macro package used
resets \type {\pdfoutput}, \PDFTEX\ will produce \PDF\ output! Macros
(packages) that adapt themselves to either \DVI\ (using specials) or \PDF\
(dedicated primitives) should be aware of this. 

When at the moment the first page is shipped out \type {\pdfoutput} has
positive value, the configuation parameters that are dimension overwrite only
the corresponding internal ones that are~0. The value of \type {\pdfoutput}
cannot be changed after the first page has been shipped out. 

Most parameters in the configuration file have a corresponding internal
register. When not set during the \TEX\ run, \PDFTEX\ uses the values as 
specified in the configuration file. 

\startbuffer
\starttabulate[|l|l|l|]
\HL
\NC \bf internal name          \NC \bf parameters         \NC \bf type  \NC\NR
\HL
\NC \type{\pdfoutput}          \NC output\_format         \NC integer   \NC\NR
\NC \type{\pdfadjustspacing}   \NC adjust\_spacing\_level \NC integer   \NC\NR
\NC \type{\pdfcompresslevel}   \NC compress\_level        \NC integer   \NC\NR
\NC \type{\pdfdecimaldigits}   \NC decimal\_digits        \NC integer   \NC\NR
\NC \type{\pdfmovechars}       \NC move\_chars            \NC integer   \NC\NR
\NC \type{\pdfimageresolution} \NC image\_resolution      \NC integer   \NC\NR
\NC \type{\pdfpkresolution}    \NC pk\_resolution         \NC integer   \NC\NR
\NC \type{\pdfhorigin}         \NC horigin                \NC dimension \NC\NR
\NC \type{\pdfvorigin}         \NC vorigin                \NC dimension \NC\NR
\NC \type{\pdfpageheight}      \NC page\_height           \NC dimension \NC\NR
\NC \type{\pdfpagewidth}       \NC page\_width            \NC dimension \NC\NR
\NC \type{\pdflinkmargin}      \NC link\_margin           \NC dimension \NC\NR
\NC \type{\pdfthreadmargin}    \NC thread\_margin         \NC dimension \NC\NR
\HL 
\stoptabulate
\stopbuffer

\placefigure
  {The configuration parameters.}
  {\getbuffer}

Apart from the above described parameters, the configuration file can have
another entry named \type {map}. This entry specifies the font mapping files,
which is similar to those used by many \DVI\ to \POSTSCRIPT\ drivers. More
than one map file can be specified, using multiple \type {map} lines. If the
name of the map file is prefixed with a \type{+}, its values are appended to
the existing set, otherwise they replace it. If no map files are given, the
default value \filename {psfonts.map} is used. 

A typical \type {pdftex.cfg} file looks like this, setting up output for A4
paper size and the standard \TEX\ offset of 1~inch, and loading two map files
for fonts: 

\starttyping
output_format      1           % the implicit output will be PDF
compress_level     1           % use the fastest level of compression
decimal_digits     3           % max. 3 digits after the decimal point 
image_resolution   300         % when not specified, embed images at 300 DPI
pk_resolution      600         % use PK fonts at 600 DPI
move_chars         1           % move chars in 0..31 to higher area 
page_width         210 true mm % A4 paper width
page_height        297 true mm % A4 paper height
horigin            1 true in   % horizontal origin offset
vorigin            1 true in   % vertical origin offset
map                pdftex.map  % standard map file
map                +misc.map   % map file for extra fonts
\stoptyping

The configuration file sets default values for these parameters, and apart
from the \type {map} entry, they all can be over||ridden in the \TEX\ source
file. Dimensions can be specified as \type {true}, which makes them immune
for magnification (when set). 

\description {output\_format} This integer parameter specifies whether the
output format should be \DVI\ or \PDF. A positive value means \PDF\ output,
otherwise we get \DVI\ output.

\description {compress\_level} This integer parameter specifies the level of
text and in||line graphics compression. \PDFTEX\ uses \ZIP\ compression as
provided by \type {zlib}. A value of~0 means no compression, 1~means fastest,
9~means best, 2..8 means something in between. Just set this value to~9,
unless there is a good reason to do otherwise --- 0 is great for testing
macros that use \type {\pdfliteral}.

\description {decimal\_digits} This integer specifies the preciseness of real
numbers in \PDF\ page descriptions. It gives the maximal number of decimal
digits after the decimal point of real numbers. Valid values are in range
0..5. A higher value means more precise output, but also results in a much
larger file size and more time to display or print. In most cases the optimal
value is~2. This parameter does {\em not} influence the precision of numbers
used in raw \PDF\ code, like that used in \type {\pdfliteral} and annotation
action specifications.

\description {image\_resolution} When \PDFTEX\ is not able to determine the
natural dimensions of an image, it assumes a resolution of type 72~dots per
inch. Use this variable to change this default value.

\description {pk\_resolution} One can use this entry to specify the
resolution for bitmap fonts. Nowadays most printers are capable to print at
least 600 dots per inch, so this is a reasonable default. 

\description {move\_chars} Although \PDF\ output is claimed to be portable,
especially when all font information is included in the file, problems with
printing and viewing have a persistent nature. Moving the characters in range
0-31 sometimes helps a lot. When set to~1, characters are only moved when a
font has less than 128 glyphs, when set to~2 higher slots are used too. 

\description {page\_width \& page\_height} These two dimension parameters
specify the output medium dimensions (the paper, screen or whatever the page
is put on). If they are not specified, the page width is calculated as
$w_{\hbox{\txx box being shipped out}} + 2 \times (\hbox{horigin} +
\hbox{\type{\hoffset}})$. The page height is calculated in a similar way.

\description {horigin \& vorigin} These dimension parameters can be used to
set the offset of the \TEX\ output box from the top left corner of the
\quote {paper}.

\description {map} This entry specifies the font mapping file, which is
similar to those used by many \DVI\ to \POSTSCRIPT\ drivers. More than one
map file can be specified, using multiple \type {map} lines. If the name of
the map file is prefixed with a \type {+}, its values are appended to the
existing set, otherwise they replace it. If no map files are given, the
default value \filename {psfonts.map} is used.

% \description {include\_form\_resources} Sometimes embedded \PDF\
% illustrations can pose viewers for problems. When set to~1, this variable
% makes \PDFTEX\ take some precautions. Forget about it when you never
% encounteres problems. When all the programs you use conform to the \PDF\
% specifications, you will never need to set this variable.

\subsection{Creating formats}

Formats for \PDFTEX\ are created in the same way as for \TEX. For plain
\TEX\ and \LATEX\ it looks like:

\starttyping
pdftex -ini -fmt=pdftex   plain      \dump
pdftex -ini -fmt=pdflatex latex.ltx
\stoptyping

In \CONTEXT\ the generation depends on the interface used. A format using the
english user interface is generated with

\starttyping
pdftex -ini -fmt=cont-en cont-en
\stoptyping

When properly set up, one can also use the \CONTEXT\ command line interface
\TEXEXEC\ to generate one or more formats, like:

\starttyping
texexec --make en
\stoptyping

for an english format, or

\starttyping
texexec --make --tex=pdfetex en de
\stoptyping

for an english and german one, using \PDFETEX. Indeed, if there is \PDFTEX\
as well as \PDFETEX, use it! Whatever macro package used, the formats should
be placed in the \type {TEXFORMATS} path. We strongly recommend to use
\PDFETEX, if only because the main stream macro packages (will) use it.

\subsection{Testing the installation}

When everything is set up, you can test the installation. In the distribution
there is a plain \TEX\ test file \filename {example.tex}. Process this file
by saying:

\starttyping
pdftex example
\stoptyping

If the installation is ok, this run should produce a file called \filename
{example.pdf}. The file \filename {example.tex} is also a good place to look
for how to use \PDFTEX's new primitives.

\subsection{Common problems}

The most common problem with installations is that \PDFTEX\ complains that
something cannot be found. In such cases make sure that \type {TEXMFCNF} is
set correctly, so \PDFTEX\ can find \filename {texmf.cnf}. The next best
place to look|/|edit is the file \type {texmf.cnf}. When still in deep
trouble, set \type {KPATHSEA_DEBUG=255} before running \PDFTEX\ or run
\PDFTEX\ with option \type {-k 255}. This will cause \PDFTEX\ to write a lot
of debugging information that can be useful to trace problems. More options
can be found in the \WEBC\ documentation.

Variables in \filename {texmf.cnf} can be overwritten by environment
variables. Here are some of the most common problems you can encounter when
getting started:

\startitemize

\head  \type {I can't read pdftex.pool; bad path?}

       \type {TEXMFCNF} is not set correctly and so \PDFTEX\ cannot find
       \type {texmf.cnf}, or \type {TEXPOOL} in \filename {texmf.cnf}
       doesn't contain a path to the pool file \filename {pdftex.pool} or 
       \type {pdfetex.pool} when you use \PDFETEX.

\head  \type {You have to increase POOLSIZE.}

       \PDFTEX\ cannot find \filename {texmf.cnf}, or the value of \type
       {pool_size} specified in \filename {texmf.cnf} is not large enough
       and must be increased. If \type {pool_size} is not specified in
       \filename {texmf.cnf} then you can add something like

\starttyping
pool_size = 500000
\stoptyping

\head  \type {I can't find the format file `pdftex.fmt'!} \crlf
       \type {I can't find the format file `pdflatex.fmt'!}

       Format is not created (see above how to do that) or is not properly
       placed. Make sure that \type {TEXFORMATS} in \filename {texmf.cnf}
       contains the path to \filename {pdftex.fmt} or \filename {pdflatex.fmt}.

\head  \type {Fatal format file error; I'm stymied.}

       This appears if you forgot to regenerate the \type {.fmt} files after
       installing a new version of the \PDFTEX\ binary and
       \filename {pdftex.pool}.

\head  \type {TEX.POOL doesn't match; TANGLE me again!} \crlf
       \type {TEX.POOL doesn't match; TANGLE me again (or fix the path).}

       This might appear if you forgot to install the proper
       \filename {pdftex.pool} when installing a new version of the \PDFTEX\
       binary.

\item  \PDFTEX\ cannot find the configuration file \filename {pdftex.cfg},
       one or more map files (\type {*.map}), encoding vectors (\type
       {*.enc}), virtual fonts, Type~1 fonts, TrueType fonts or some image
       file.

       Make sure that the required file exists and the corresponding variable
       in \filename {texmf.cnf} contains a path to the file. See above which
       variables \PDFTEX\ needs apart from the ones \TEX\ uses.

\stopitemize

Normally the page content takes one object. This means that one seldom finds
more than a few hundred objects in a simple file. This document for instance
uses about 300 objects. In demanding applications this number can grow quite
rapidly, especially when one uses a lot of widget annotations, shared
annotations or other shared things. In these situations in \filename
{texmf.cnf} one can enlarge \PDFTEX 's internal object table by adding a line
in \filename {texmf.cfg}, for instance:

\starttyping
obj_tab_size = 400000
\stoptyping

\section{Macro packages supporting \PDFTEX}

When producing \DVI\ output, for which one can use \PDFTEX\ as well as any
other \TEX, part of the job is delegated to the \DVI\ postprocessor, either
by directly providing this program with commands, or by means of \type
{\specials}. Because \PDFTEX\ directly produces the final format, it has to
do everything itself, from handling color, graphics, hyperlink support,
font||inclusion, upto page imposition and page manipulation. 

As a direct result, when one uses a high level macro package, the macros that
take care of these features have to be set up properly. Specials for instance
make no sense at all. Actually being a comment understood by \DVI\
postprocessors |<|given that the macro package speaks the specific language
of this postprocessor|>| a \type {\special} would end up as just a comment in
the \PDF\ file, which is of no use. Therefore, \type {\special} issues a
warning when \PDFTEX\ is in \PDF\ mode.

When one wants to get some insight to what extend \PDFTEX\ specific support
is needed, one can start a file by saying:

\starttyping
\pdfoutput=1 \let\special\message
\stoptyping

or, if this leads to confusion,

\starttyping
\pdfoutput=1 \def\special#1{\write16{special: #1}}
\stoptyping

And see what happens. As soon as one \quote {special} message turns up, one
knows for sure that some kind of \PDFTEX\ specific support is needed, and
often the message itself gives a indication of what is needed.

Currently all main stream macro packages offer \PDFTEX\ support in one way or
the other. When using such a package, it makes sense to turn on this support
in the appropriate way, otherwise one cannot be sure if things are set up
right. Remember that for instance the page and paper dimensions have to be
taken care of, and only the macro package knows the details.

\startitemize

\item  For \LATEX\ users, Sebastian Rahtz' \type {hyperref} package has
       substantial support for \PDFTEX, and provides access to most of its
       features. In the simplest case, the user merely needs to load \type
       {hyperref} with a \type {pdftex} option, and all cross||references
       will be converted to \PDF\ hypertext links. \PDF\ output is
       automatically selected, compression is turned on, and the page size is
       set up correctly. Bookmarks are created to match the table of
       contents.

\item  The standard \LATEX\ \type {graphics} and \type {color} packages have
       \type {pdftex} options, which allow use of normal color, text
       rotation, and graphics inclusion commands.

\item  The \CONTEXT\ macro package by Hans Hagen (\from[hans]) has very full
       support for \PDFTEX\ in its generalized hypertext features. Support
       for \PDFTEX\ is implemented as a special driver, and is invoked
       by saying \type {\setupoutput[pdftex]} or feeding \TEXEXEC\ with the
       \type{--pdf} option. 

\item  Hypertexted \PDF\ from \type {texinfo} documents can be created with
       \filename {pdftexinfo.tex}, which is a slight modification of the
       standard \type {texinfo} macros. This file is part of the \PDFTEX\
       distribution.

\item  A similar modification of \filename {webmac.tex}, called \filename
       {pdfwebmac.tex}, allows production of hypertext'd \PDF\ versions of
       programs written in \WEB. This is also part of the \PDFTEX\
       distribution.

\stopitemize

Some nice samples of \PDFTEX\ output can be found on the \TUG\ web server, at
\from[examples] and \from[context].

\section{Setting up fonts}

\PDFTEX\ can work with Type~1 and TrueType fonts, but a source must be
available for all fonts used in the document, except for the 14~base fonts
supplied by Acrobat Reader (Times, Helvetica, Courier, Symbol and Dingbats).
It is possible to use \METAFONT||generated fonts in \PDFTEX --- but it is
strongly recommended not to use \METAFONT||fonts if an equivalent is
available in Type~1 or TrueType format, if only because bitmap Type~3 fonts
render very poorly in Acrobat Reader. Given the free availability of Type~1
versions of all the Computer Modern fonts, and the ability to use standard
\POSTSCRIPT\ fonts, most \TEX\ users should be able to experiment with
\PDFTEX.

\subsection[mapfile]{Map files}

\PDFTEX\ reads the map files, specified in the configuration file, see
\in{section}[cfg], in which reencoding and partial downloading for each font
are specified. Every font needed must be listed, each on a separate line,
except \PK~fonts. The syntax of each line is similar to \type {dvips} map
files \footnote {\type {dvips} map files can be used with \PDFTEX\ without
problems.} and can contain up to the following (some are optional) fields:
{\em texname}, {\em basename}, {\em fontflags}, {\em fontfile}, {\em
encodingfile} and {\em special}. The only mandatory is {\em texname} and must
be the first field. The rest is optional, but if {\em basename} is given, it
must be the second field. Similarly if {\em fontflags} is given it must be
the third field (if {\em basename} is present) or the second field (if {\em
basename} is left out). It is possible to mix the positions of {\em
fontfile}, {\em encodingfile} and {\em special}, however the first three
fields must be given in fixed order.

\startdescription {texname}

sets the name of the \TFM\ file. This name must be given for each font.

\stopdescription

\startdescription {basename}

sets the base (\POSTSCRIPT) font name. If not given then it will be taken
from the font file. Specifying a name that doesn't match the name in the font
file will cause \PDFTEX\ to write a warning, so it is best not to have this
field specified if the font resource is available, which is the most common
case. This option is primarily intended for use of base fonts and for
compatibility with \type {dvips} map files.

\stopdescription

\startdescription {fontflags}

specify some characteristics of the font. The next description of these flags
are taken, with a slight modification, from the \PDF\ Reference Manual (the
section on Font Descriptor Flags).

\startsmaller

The value of the flags key in a font descriptor is a 32||bit integer that
contains a collection of boolean attributes. These attributes are true if the
corresponding bit is set to~1. \in{Table}[flags] specifies the meanings of
the bits, with bit~1 being the least significant. Reserved bits must be set
to zero.

\startbuffer
\starttabulate[|c|l|]
\HL
\NC \bf bit position \NC \bf semantics                               \NC\NR
\HL
\NC 1                \NC Fixed||width font                           \NC\NR
\NC 2                \NC Serif font                                  \NC\NR
\NC 3                \NC Symbolic font                               \NC\NR
\NC 4                \NC Script font                                 \NC\NR
\NC 5                \NC Reserved                                    \NC\NR
\NC 6                \NC Uses the Adobe Standard Roman Character Set \NC\NR
\NC 7                \NC Italic                                      \NC\NR
\NC 8--16            \NC Reserved                                    \NC\NR
\NC 17               \NC All||cap font                               \NC\NR
\NC 18               \NC Small||cap font                             \NC\NR
\NC 19               \NC Force bold at small text sizes              \NC\NR
\NC 20--32           \NC Reserved                                    \NC\NR
\HL
\stoptabulate
\stopbuffer

\placetable
  [here][flags]
  {The meaning of flags in the font descriptor.}
  {\getbuffer}

All characters in a {\em fixed||width} font have the same width, while
characters in a proportional font have different widths. Characters in a {\em
serif font} have short strokes drawn at an angle on the top and bottom of
character stems, while sans serif fonts do not have such strokes. A {\em
symbolic font} contains symbols rather than letters and numbers. Characters
in a {\em script font} resemble cursive handwriting. An {\em all||cap} font,
which is typically used for display purposes such as titles or headlines,
contains no lowercase letters. It differs from a {\em small||cap} font in
that characters in the latter, while also capital letters, have been sized
and their proportions adjusted so that they have the same size and stroke
weight as lowercase characters in the same typeface family.

Bit~6 in the flags field indicates that the font's character set conforms the
Adobe Standard Roman Character Set, or a subset of that, and that it uses
the standard names for those characters.

Finally, bit~19 is used to determine whether or not bold characters are
drawn with extra pixels even at very small text sizes. Typically, when
characters are drawn at small sizes on very low resolution devices such as
display screens, features of bold characters may appear only one pixel
wide. Because this is the minimum feature width on a pixel||based device,
ordinary non||bold characters also appear with one||pixel wide features, and
cannot be distinguished from bold characters. If bit 19 is set, features of
bold characters may be thickened at small text sizes.

\stopsmaller

If the font flags are not given, \PDFTEX\ treats it as being~4, a symbolic
font. If you do not know the correct value, it would be best not to specify
it, as specifying a bad value of font flags may cause troubles in viewers. On
the other hand this option is not absolutely useless because it provides
backward compatibility with older map files (see the fontfile description
below).

\stopdescription

\startdescription {fontfile}

sets the name of the font source file. This must be a Type~1 or TrueType font
file. The font file name can be preceded by one or two special characters,
which says how the font file should be handled.

\startitemize

\item  If it is preceded by a \type {<} the font file will be partly
       downloaded, which means that only used glyphs (characters) are
       embedded to the font. This is the most common use and is
       {\em strongly recommended} for any font, as it ensures the
       portability and reduces the size of the \PDF\ output. Partial fonts
       are included in such a way that name and cache clashes are minimalized.

\item  In case the font file name is preceded by a double \type{<<}, the font
       file will be included entirely --- all glyphs of the font are
       embedded, including the ones that are not used in the document. Apart
       from causing large size \PDF\ output, this option may cause troubles
       with TrueType fonts too, so it is not recommended. It might be useful
       in case the font is untypical and can not be subsetted well by
       \PDFTEX. {\em Beware: some font vendors forbid full font inclusion.}

\item  In case nothing preceded the font file name, the font file is read but
       nothing is embedded, only the font parameters are extracted to
       generate the so||called font descriptor, which is used by Acrobat
       Reader to simulate the font if needed. This option is useful only when
       you do not want to embed the font (i.e.~to reduce the output size),
       but wish to use the font metrics and let Acrobat Reader generate
       instances that look close to the used font in case the font resource
       is not installed on the system where the \PDF\ output will be viewed
       or printed. To use this feature the font flags {\em must} be
       specified, and it must have the bit~6 set on, which means that only
       fonts with the Adobe Standard Roman Character Set can be simulated.
       The only exception is in case of Symbolic font, which is not very
       useful.

\item  If the font file name is preceded by a \type {!}, the font is not read
       at all, and is assumed to be available on the system. This option can
       be used to create \PDF\ files which do not contain embedded fonts. The
       \PDF\ output then works only on systems where the resource of the used
       font is available. It's not very useful for document exchange, as the
       \PDF\ is not \quote{portable} at all. On the other hand it is very
       useful when you wish to speed up running of \PDFTEX\ during
       interactive work, and only in a final version embed all used fonts.
       Don't over||estimate gain in speed and when distributing files, always
       embed the fonts! This feature requires Acrobat Reader to have access
       to installed fonts on the system. This has been tested on Win95 and
       \UNIX\ (Solaris).

\stopitemize

Note that the standard 14~fonts are never downloaded, even when they are 
specified to be downloaded in map files. When one suffers from invalid 
lookups, for instance when \PDFTEX\ tries to open a \type {.pfa} file 
instead of a \type {.pfb} one, one can add the suffix to the filename.
In this respect, \PDFTEX\ completely relies on the \type {kpathsea} 
libraries. 

\stopdescription

\startdescription {encoding}

specifies the name of the file containing the external encoding vector to be
used for the font. The file name may be preceded by a \type {<}, but the
effect is the same. The format of the encoding vector is identical to that
used by \type {dvips}. If no encoding is specified, the font's built||in
default encoding is used. It may be omitted if you are sure that the font
resource has the correct built||in encoding. In general this option is highly
preferred and is {\em required} when subsetting a TrueType font.

\stopdescription

\startdescription {special}

instructions can be used to manipulate fonts similar to the way \type {dvips}
does. Currently only the keyword \type {SlantFont} is interpreted, other
instructions are just ignored.

\stopdescription

If a used font is not present in the map files, first \PDFTEX\ will look for
a source with suffix \type {.pgc}, which is a so||called \PGC\ source (\PDF\
Glyph Container) \footnote {This is a text file containing a \PDF\ Type~3
font, created by \METAPOST\ using some utilities by Hans Hagen. In general
\PGC\ files can contain whatever allowed in \PDF\ page description, which may
be used to support fonts that are not available in \METAFONT. At the moment
\PGC\ fonts are not very useful, as vector Type~3 fonts are not displayed
very well in Acrobat Reader, but it may be more useful when Type~3 font
handling gets better.}. If no \PGC\ source is available, \PDFTEX\ will try to
use \PK~fonts in a normal way as \DVI\ drivers do, on||the||fly creating
\PK~fonts if needed.

Lines containing nothing apart from {\em texname} stand for scalable Type~3
fonts. For scalable fonts as Type~1, TrueType and scalable Type~3 font, all
the fonts loaded from a \TFM\ at various sizes will be included only once in
the \PDF\ output. Thus if a font, let's say \type{csr10}, is described in one
of the map files, then it will be treated as scalable. As a result the font
source for csr10 will be included only once for \type {csr10}, \type {csr10
at 12pt} etc. So \PDFTEX\ tries to do its best to avoid multiple downloading
of identical font sources. Thus vector \PGC\ fonts should be specified as
scalable Type~3 in map files like:

\starttyping
csr10
\stoptyping

It doesn't hurt much if a scalable Type~3 font is not given in map files,
except that the font source will be downloaded multiple times for various
sizes, which causes a much larger \PDF\ output. On the other hand if a font
is in the map files is defined as scalable Type~3 font and its \PGC\ source
is not scalable or not available, \PDFTEX\ will use \PK\ font instead; the
\PDF\ output is still valid but some fonts may look ugly because of the
scaled bitmap.

A SlantFont is specified similarly as for \type {dvips}. A \type {SlantFont}
or \type {ExtendFont} must be used with embedding font file. Note that the
base name, the \POSTSCRIPT\ name like Symbol or Times||Roman, cannot be
given, as \PDFTEX\ never embeds a base font. 

\starttyping 
psyr     Symbol
psyro    ".167 SlantFont"  <usyr.pfb  
ptmr8r   Times-Roman       <8r.enc
\stoptyping 

To summarize this rather confusing story, we include some sample lines. First
we use a built||in font with font||specific encoding, i.e.~neither a download
font nor an external encoding is given. 

\starttyping
psyr   Symbol
pzdr   ZapfDingbats
\stoptyping

Use a built||in font with an external encoding. The \type {<} preceded
encoding file may be left out.

\starttyping
ptmr8r   Times-Roman   <8r.enc
ptmri8r  Times-Italic  <8r.enc
\stoptyping

Use a partially downloaded font with an external encoding:

\starttyping
putr8r   Utopia-Regular  <8r.enc <putr8a.pfb
putri8r  Utopia-Italic   <8r.enc <putri8a.pfb
putro8r  Utopia-Regular  <8r.enc <putr8a.pfb   ".167 SlantFont"
\stoptyping

Use some faked font map entries:

\starttyping
logo8      <logo8.pfb
logo9      <logo9.pfb
logo10     <logo10.pfb
logosl8    <logo8.pfb     ".25 SlantFont"
logosl9    <logo9.pfb     ".25 SlantFont"
logosl10   <logosl10.pfb
logobf10   <logobf10.pfb
\stoptyping

Use an \ASCII\ subset of OT1 and T1:

\starttyping
ectt1000  cmtt10  <cmtt10.map  <tex256.enc
\stoptyping

Download a font entirely without reencoding:

\starttyping
pgsr8r GillSans  <<pgsr8a.pfb
\stoptyping

Partially download a font without reencoding:

\starttyping
pgsr8r GillSans  <pgsr8a.pfb
\stoptyping

Do not read the font at all --- the font is supposed to be installed on
the system:

\starttyping
pgsr8r GillSans  !pgsr8a.pfb
\stoptyping

Entirely download a font with reencoding:

\starttyping
pgsr8r GillSans  <<pgsr8a.pfb  8r.enc
\stoptyping

Partially download a font with reencoding:

\starttyping
pgsr8r GillSans  <pgsr8a.pfb  8r.enc
\stoptyping

Sometimes we do not want to include a font, but need to extract parameters
from the font file and reencode the font as well. This only works for fonts
with Adobe Standard Encoding. The font flags specify how such a font looks
like, so Acrobat Reader can generate similar instance if the font resource
is not available on the target system.

\starttyping
pgsr8r GillSans  32  pgsr8a.pfb  8r.enc
\stoptyping

A TrueType font can be used in the same way as a Type~1 font:

\starttyping
verdana8r Verdana  <verdana.ttf  8r.enc
\stoptyping

\subsection{TrueType fonts}

As mentioned above, \PDFTEX\ can work with TrueType fonts. Defining TrueType
files is similar to Type~1 font. The only extra thing to do with
TrueType is to create a \TFM\ file. There is a program called \type {ttf2afm}
in the \PDFTEX\ distribution which can be used to extract \AFM\ from TrueType
fonts. Usage is simple:

\starttyping
ttf2afm -e <encoding vector> -o <afm outputfile> <ttf input file>
\stoptyping

A TrueType file can be recognized by its suffix \filename {ttf}. The optional
{\em encoding} specifies the encoding, which is the same as the encoding
vector used in map files for \PDFTEX\ and \type {dvips}. If the encoding is
not given, all the glyphs of the \AFM\ output will be mapped to \type
{/.notdef}. \type {ttf2afm} writes the output \AFM\ to standard output. If we
need to know which glyphs are available in the font, we can run \type
{ttf2afm} without encoding to get all glyph names. The resulting \AFM\ file
can be used to generate a \TFM\ one by applying \filename {afm2tfm}.

To use a new TrueType font the minimal steps may look like below. We suppose
that \filename {test.map} is included in \filename {pdftex.cfg}.

\starttyping
ttf2afm -e 8r.enc -o times.afm times.ttf
afm2tfm times.afm -T 8r.enc
echo "times TimesNewRomanPSMT <times.ttf <8r.enc" >>test.map
\stoptyping

The \POSTSCRIPT\ font name (\type {TimesNewRomanPSMT}) is reported by \type
{afm2tfm}, but from \PDFTEX\ version 0.12l onwards it may be left out.

There are two main restrictions with TrueType fonts in comparison with
Type~1 fonts: 

\startitemize[a,packed]
\item  The special effects SlantFont|/|ExtendFont cannot be used. 
\item  To subset a TrueType font, the font must be specified as reencoded, 
       therefore an encoding vector must be given.
\stopitemize

\section{Formal syntax specification}

This sections formaly specifies the \PDFTEX\ specific extensions to the \TEX\
macro programming language. First we present some general definitions. All
\Something {general text} is expanded immediately, like \type {\special} in
traditional \TEX, unless mentioned explicitly no to. 

\startpacked

\Syntax {\Something {general text} \Means \Something {filler} \Lbrace
\Something {balanced text} \Something {right brace}} 

\Syntax {\Something {attr spec} \Means \Literal {attr} \Something {general
text}} 

\Syntax {\Something {object type spec} \Means \Optional {\Something {attr
spec}} \Literal {stream} \Or \Optional {\Something {attr spec}} \Literal
{file}} 

\Syntax {\Something {resources spec} \Means \Literal {resources} \Something
{general text}} 
 
\Syntax {\Something {file spec} \Means \Literal {file} \Something {general
text}} 

\Syntax {\Something {page spec} \Means \Literal {page} \Something {integer}} 

\Syntax {\Something {action spec} \Means \Literal {user} \Something
{user-action spec} \Or \Literal {goto} \Something {goto-action spec} \Or
\Next \Literal {thread} \Something {thread-action spec}} 

\Syntax {\Something {newwindow spec} \Means \Literal {newwindow} \Or \Literal
{nonewwindow}} 

\Syntax {\Something {user-action spec} \Means \Literal {user} \Something
{general text}} 

\Syntax {\Something {goto-action spec} \Means \Something {numid} \Or \Next
\Optional {\Something {file spec}} \Something {nameid} \Or \Next \Optional
{\Something {file spec}} \Something {page spec} \Something {general text} \Or
\Next \Something {file spec} \Something {nameid} \Something {newwindow spec}
\Or \Next \Something {file spec} \Something {page spec} \Something {general
text} \Something {newwindow spec}} 

\Syntax {\Something {numid} \Means \Literal {num} \Something {integer}} 

\Syntax {\Something {nameid} \Means \Literal {name} \Something {general
text}} 

\Syntax {\Something {thread-action spec} \Means \Optional {\Something {file
spec}} \Something {numid} \Or \Optional {\Something {file spec}} \Something
{nameid}} 

\Syntax {\Something {dest spec} \Means \Something {numid} \Something {dest
type} \Or \Something {nameid} \Something {dest type}} 

\Syntax {\Something {dest type} \Means \Literal {xyz} \Optional {\Literal
{zoom} \Something {integer}} \Or \Next \Literal {fitbh} \Or \Literal {fitbv}
\Or \Literal {fitb} \Or \Literal {fith} \Or \Literal {fitv} \Or \Literal
{fitr} \Something {rule spec} \Or \Literal {fit}}

\Syntax {\Something {id spec} \Means \Something {numid} \Or \Something
{nameid}} 

\stoppacked

\PDFTEX\ introduces the following new primitives. Each primitive is prefixed 
by \type {pdf} except for \type {\efcode} and the extended \type {font} 
primitive.  

\startpacked

\Syntax {\Tex {\pdfoutput} \Whatever {integer}} 

\Syntax {\Tex {\pdfcompresslevel} \Whatever {integer}} 

\Syntax {\Tex {\pdfdecimaldigits} \Whatever {integer}} 
 
\Syntax {\Tex {\pdfmovechars} \Whatever {integer}} 

\Syntax {\Tex {\pdfpkresolution} \Whatever {integer}} 

\Syntax {\Tex {\pdfpagewidth} \Whatever {dimension}} 

\Syntax {\Tex {\pdfpageheight} \Whatever {dimension}} 

\Syntax {\Tex {\pdfhorigin} \Whatever {dimension}} 

\Syntax {\Tex {\pdfvorigin} \Whatever {dimension}} 

\Syntax {\Tex {\pdfpagesattr} \Whatever {tokens}} 

\Syntax {\Tex {\pdfpageattr} \Whatever {tokens}} 

\Syntax {\Tex {\pdfinfo} \Something {general text}} 

\Syntax {\Tex {\pdfcatalog} \Something {general text} \Optional {\Literal
{openaction} \Something {action spec}}} 

\Syntax {\Tex {\pdfnames} \Something {general text}} 

\Syntax {\Tex {\font} \Optional {\Something {font spec}} \Optional {\Literal
{stretch} \Something {integer}} \Optional {\Literal {shrink} \Something
{integer}} \Optional {\Literal {step} \Something {integer}}} 

\Syntax {\Tex {\pdfadjustspacing} \Whatever {integer}} 

\Syntax {\Tex {\efcode} \Whatever {integer}} 

\Syntax {\Tex {\pdffontname} \Something {font} \Whatever {expandable}} 

\Syntax {\Tex {\pdffontobjnum} \Something {font} \Whatever {read||only integer}} 

\Syntax {\Tex {\pdfincludechars} \Something {font} \Something {general text}} 

\Syntax {\Tex {\pdfxform} \Optional {\Something {attr spec}} \Optional
{\Something {resources spec}} \Something {box number}} 

\Syntax {\Tex {\pdfrefxform} \Something {integer}} 

\Syntax {\Tex {\pdflastxform} \Whatever {read||only integer}} 

\Syntax {\Tex {\pdfximage} \Optional {\Something {rule spec}} \Optional
{\Something {attr spec}} \Optional {\Something {page spec}} \Something {file
spec}} 

\Syntax {\Tex {\pdfrefximage} \Something {integer}} 

\Syntax {\Tex {\pdflastximage} \Whatever {read||only integer}} 

\Syntax {\Tex {\pdfimageresolution} \Whatever {integer}} 

\Syntax {\Tex {\pdfannot} \Optional {\Something {rule spec}} \Something
{general text}} 

\Syntax {\Tex {\pdflastannot} \Whatever {read||only integer}} 

\Syntax {\Tex {\pdfdest} \Something {dest spec}} 

\Syntax {\Tex {\pdfstartlink} \Optional {\Something {rule spec}} \Optional
{\Something {attr spec}} \Something {action spec}} 

\Syntax {\Tex {\pdfendlink}} 

\Syntax {\Tex {\pdflinkmargin} \Whatever {dimension}} 

\Syntax {\Tex {\pdfoutline} \Something {action spec} \Optional {\Literal
{count} \Something {integer}} \Something {general text}} 

\Syntax {\Tex {\pdfthread} \Something {rule spec} \Optional {\Something 
{attr spec}} \Something {id spec}} 

\Syntax {\Tex {\pdfthreadmargin} \Whatever {dimension}} 

%\Syntax {\Tex {\pdfthreadhoffset} \Whatever {dimension}} 
%\Syntax {\Tex {\pdfthreadvoffset} \Whatever {dimension}} 

\Syntax {\Tex {\pdfliteral} \Optional {\Literal {direct}} \Something {general
text}} 

\Syntax {\Tex {\pdfobj} \Optional {\Something {object type spec}} \Something
{general text}} 

\Syntax {\Tex {\pdflastobj} \Whatever {read||only integer}} 

\Syntax {\Tex {\pdfrefobj} \Something {integer}} 

\Syntax {\Tex {\pdftexversion} \Whatever {read||only integer}} 
 
\Syntax {\Tex {\pdftexrevision} \Whatever {expandable}} 

\stoppacked 

\section[primitives]{New primitives}

Here follows a short description of new primitives added by \PDFTEX. One way
to learn more about how to use these primitives is to have a look at the file
\filename {example.tex} in the \PDFTEX\ distribution. Each \PDFTEX\ specific
primitive is prefixed by \type{\pdf}.

The parameters that are marked as {\em default: from configuration} take
their value from the configuration file. Note that if the output is \DVI\
then the dimension parameters are not set to the configuration values and not
used at all. However some \PDFTEX\ integer parameters can affect the \PDF\ as
well as \DVI\ output (currently \type {\pdfoutput} and \type
{\pdfadjustspacing}). 

\subsection{Document setup}

\pdftexprimitive {\Syntax {\Tex {\pdfoutput} \Whatever {integer}}} 

\bookmark{\type{\pdfoutput}} 

This parameter specifies whether the output format should be \DVI\ or \PDF. A
positive value means \PDF\ output, otherwise one gets \DVI\ output. This
parameter cannot be specified {\em after} shipping out the first page. In
other words, this parameter must be set before \PDFTEX\ ships out the first
page if we want \PDF\ output. This is the only one parameter that must be set
to produce \PDF\ output. All others are optional. This parameter cannot be 
set after the first page is shipped out. 

When \PDFTEX\ starts complaining about specials, one can be sure that the
macro package is not aware of this mode. A simple way of making macros
\PDFTEX\ aware is:

\starttyping
\ifx\pdfoutput\undefined \csname newcount\endcsname\pdfoutput \fi

\ifcase\pdfoutput DVI CODE \else PDF CODE \fi
\stoptyping

However, there are better ways to handle these things.

\pdftexprimitive {\Syntax {\Tex {\pdfcompresslevel} \Whatever {integer}}} 

\bookmark{\type{\pdfcompresslevel}}

This integer parameter specifies the level of text compression via \type
{zlib}. Zero means no compression, 1~means fastest, 9~means best, 2..8 means
something in between. A value out of this range will be adjusted to the
nearest meaningful value. This parameter is read each time \PDFTEX\ starts a 
stream.

\pdftexprimitive {\Syntax {\Tex {\pdfdecimaldigits} \Whatever {integer}}} 

\bookmark{\type{\pdfdecimaldigits}}

This parameter specifies the accuracy of real numbers as written to the in
\PDF\ file. It gives the maximal number of decimal digits after the decimal
point of real numbers. Valid values are in range 0..5. A higher value means
a more precise output, but also results in a much larger file size and more
time to display or print. In most cases the optimal value is~2. This
parameter does not influence the precision of numbers used in raw \PDF\ code,
like that used in \type {\pdfliteral} and annotation action specifications.
This parameter is read when \PDFTEX\ writes a real number to the \PDF\ output. 

When including huge \METAPOST\ images using \filename {supp-pdf.tex}, one can
limit the accuracy to two digits by saying: \type {\twodigitMPoutput}.

\pdftexprimitive {\Syntax {\Tex {\pdfmovechars} \Whatever {integer}}} 

\bookmark{\type{\pdfmovechars}}

This parameter specifies whether \PDFTEX\ should try to move characters in
range 0..31 to higher slots. When set to~1, this feature affects only to
fonts that have all character codes below~128, which applies to for instance
the Computer Moderd Roman fonts. When set to~2 or higher \PDFTEX\ will try to
move those characters to free slots in encoding array, even in case the font
contains characters with code greater than or equal to 128. This parameter is
read when \PDFTEX\ writes a character of a font to the \PDF\ output at which
moment it has to decide whether to move the character or not. 

\pdftexprimitive {\Syntax {\Tex {\pdfpkresolution} \Whatever {integer}}} 

\bookmark{\type{\pdfpkresolution}}

This integer parameter specifies the default resolution of embedded \PK\
fonts and is read when \PDFTEX\ downloads a \PK\ font during finishing the
\PDF\ output. Currently bitmap fonts are displayed poorly, so use Type~1 
fonts when available!

\pdftexprimitive {\Syntax {\Tex {\pdfpagewidth} \Whatever {dimension}}}

\bookmark{\type{\pdfpagewidth}}

This dimension parameter specifies the page width of the \PDF\ output, being
the screen, the paper or whatrever the page content is put on. \PDFTEX\ reads
this parameter when it starts shipping out a page. When at this moment the
value is still~0, the page width is calculated as $w_{\hbox{\txx box being
shipped out}} + 2 \times (\hbox{horigin} + \hbox{\type{\hoffset}})$. 

Like the next one, this value replaces the value set in the configuration
file. When part of the page falls of the paper or screen, you can be rather
sure that this parameter is set wrong. 

\pdftexprimitive {\Syntax {\Tex {\pdfpageheight} \Whatever {dimension}}} 

\bookmark{\type{\pdfpageheight}}

Similar to the previous one, this dimension parameter specifying the page
height of the \PDF\ output. If not given then the page height will be
calculated as mentioned above.

\pdftexprimitive {\Syntax {\Tex {\pdfhorigin} \Whatever {dimension}}} 

\bookmark{\type{\pdfhorigin}}

This parameter can be used to set the horizontal offset the output box from 
the top left corner of the page. A value of 1~inch corresponds to the normal 
\TEX\ offset. This parameter is read when \PDFTEX\ starts shippin gout a page
to the \PDF\ outout.  

\pdftexprimitive {\Syntax {\Tex {\pdfvorigin} \Whatever {dimension}}} 

\bookmark{\type{\pdfvorigin}}

This parameter is the vertical alternative of \type {\pdfhorigin}. Keep in 
mind that the \TEX\ coordinate system starts in the top left corner, while 
the \PDF\ one starts at the bottom. 

\pdftexprimitive {\Syntax {\Tex {\pdfpagesattr} \Whatever {tokens}}} 

\bookmark{\type{\pdfpagesattr}}

\PDFTEX\ expands this token list when it finishes the \PDF\ output and adds
the resulting character stream to the root \type {Pages} object. When sound,
these are applied to all pages in the document. Some examples of attributes
are \type {/MediaBox}, the rectangle specifying the natural size of the page,
\type {/CropBox}, the rectangle specifying the region of the page being
displayed and printed, and \type {/Rotate}, the number of degrees (in
multiples of 90) the page should be rotated clockwise when it is displayed or
printed. 

\starttyping 
\pdfpagesattr 
  { /Rotate 90                % rotate all pages by 90 degrees
    /MediaBox [0 0 612 792] } % the media size of all pages (in bp) 
\stoptyping 

\pdftexprimitive {\Syntax {\Tex {\pdfpageattr} \Whatever {tokens}}} 

\bookmark{\type{\pdfpageattr}}

This is similar to \type {\pdfpagesattr}, but it takes priority to the former
one. It can be used to overwrite any attribute given by \type {\pdfpagesattr}
for individual pages. The token list is expanded when \PDFTEX\ ships out a 
page. The contents are added to the attributes of the current page. 

\subsection{The document info and catalog}

\pdftexprimitive {\Syntax {\Tex {\pdfinfo} \Something {general text}}} 

\bookmark{\type{\pdfinfo}}

This primitive allows the user to add information to the document info
section; if this information is provided, it can be extracted by Acrobat
Reader (version 3.1: menu option {\em Document Information, General}). The
\Something {general text} is a collection of key||value||pairs. The key names
are preceded by a \type {/}, and the values, being strings, are given between
parentheses. All keys are optional. Possible keys are \type {/Author}, \type
{/CreationDate} (defaults to current date), \type {/ModDate}, \type
{/Creator} (defaults to \type {TeX}), \type {/Producer} (defaults to \type
{pdfTeX}), \type {/Title}, \type {/Subject}, and \type {/Keywords}. 

\type {/CreationDate} and \type {/ModDate} are expressed in the form \type
{D:YYYYMMDDhhmmss}, where \type {YYYY} is the year, \type {MM} is the month,
\type {DD} is the day, hh is the hour, \type {mm} is the minutes, and \type
{ss} is the seconds.

Multiple appearances of \type {\pdfinfo} will be concatenated to only
one. If a key is given more than once, then the first appearance will take
priority. An example of the use of \type {\pdfinfo} is:

\starttyping
\pdfinfo
  { /Title        (example.pdf)
    /Creator      (TeX)
    /Producer     (pdfTeX 0.14a)
    /Author       (Tom and Jerry)
    /CreationDate (D:19980212201000)
    /ModDate      (D:19980212201000)
    /Subject      (Example)
    /Keywords     (mouse,cat) }
\stoptyping

\pdftexprimitive {\Syntax {\Tex {\pdfcatalog} \Something {general text}
\Optional {\Literal {openaction} \Something {action spec}}}} 

\bookmark{\type{\pdfcatalog}}

Similar to the document info section is the document catalog, where keys are
\type {/URI}, which provides the base \URL\ of the document, and \type
{/PageMode} determines how Acrobat displays the document on startup. The
possibilities for the latter are explained in \in {Table} [pagemode]:

\startbuffer
\starttabulate[|l|l|]
\HL
\NC \bf value        \NC \bf meaning                            \NC\NR
\HL
\NC \tt /UseNone     \NC neither outline nor thumbnails visible \NC\NR
\NC \tt /UseOutlines \NC outline visible                        \NC\NR
\NC \tt /UseThumbs   \NC thumbnails visible                     \NC\NR
\NC \tt /FullScreen  \NC full||screen mode                      \NC\NR
\HL
\stoptabulate
\stopbuffer

\placetable
  [here][pagemode]
  {Supported \type{/PageMode} values.}
  {\getbuffer}

In full||screen mode, there is no menu bar, window controls, nor any other
window present. The default setting is \type {/UseNone}.

The \Something {openaction} is the action provided when opening the
document and is specified in the same way as internal links, see \in
{section} [linking]. Instead of using this method, one can also write the
open action directly into the catalog. 

\pdftexprimitive {\Syntax {\Tex {\pdfnames} \Something {general text}}}

\bookmark{\type{\pdfnames}}

This primitive inserts the text to \type {/Names} array. The text must be
conform to the specifications as laid down in the \PDF\ Reference Manual,
otherwise the document can be invalid. 

\subsection{Fonts}

\pdftexprimitive {\Syntax {\Tex {\font} \Optional {\Something {font spec}} \Optional
{\Literal {stretch} \Something {integer}} \Optional {\Literal {shrink}
\Something {integer}} \Optional {\Literal {step} \Something {integer}}}} 

\bookmark{\type{\font}}

Although still in an experimental stage, and therefore subjected to changes,
the next extension to the \TEX\ primitive \type {font} is worth mentioning.

\starttyping
\font\somefont=somefile at 10pt stretch 30 shrink 20 step 10
\stoptyping

The \type {stretch 30 shrink 20 step 5} means as much as: \quotation {hey
\TEX, when things are going to bad, you may stretch the glyphs in this font
as much as 3\% or shrink them by 2\%}. Because \PDFTEX\ uses internal
datastructures with fixed widths, each additional width also means an
additional font. For practical reasons \PDFTEX\ uses discrete steps, in this
example a 1\% one. This means that for font \type {somefile} upto~6
differently scaled alternatives are used. When no step is specified, 0.5\%
steps are used.

Roughly spoken, the trick is as follows. Consider a text typeset in triple
column mode. When \TEX\ cannot break a line in the appropriate way, the
unbreakable parts of the word will stick into the margin. When \PDFTEX\ notes
this, it will try to scale (shrink) the glyphs in that line using fixed
steps, until the line fits. When lines are too spacy, the opposite happens:
\PDFTEX\ starts scaling (stretching) the glyphs until the white space gaps is
acceptable.

The additional fonts are named as \type {somefile+10} or \type {somefile-15},
and \TFM\ files with these names and appropriate dimensions must be
available. So, each scaled font must have its own \TFM\ file! When no
\TFM\ file can be found, \PDFTEX\ will try to generate it by executing the
script \type {mktextfm}, where available and supported.

This mechanism is inspired on an optimization first introduced by Herman
Zapf, which in itself goes back to optimizations used in the early days of
typesetting: use different glyphs to optimize the greyness of a page. So,
there are many, slightly different~a's, e's, etc. For practical
reasons \PDFTEX\ does not use such huge glyph collections; it uses horizontal
scaling instead. This is sub||optimal, and for many fonts, sort of offending
to the design. But, when using \PDF, it's not that illogical at all: \PDF\
viewers use so called Multiple Master fonts when no fonts are embedded
and|/|or can be found on the target system. Such fonts are designed to adapt
their design to the different scaling parameters. It is up to the user to
determine to what extend mixing slightly remastered fonts can be used without
violating the design. Think of an~O: when simply stretched, the vertical part
of the glyph becomes thicker, and looks incompatible to an unscaled original.
In a multiple master, one can decide to stretch but keep this thickness
compatible.

\pdftexprimitive {\Syntax {\Tex {\pdfadjustspacing} \Whatever {integer}}}

\bookmark{\type{\pdfadjustspacing}}

The output that \PDFTEX\ produces is pretty compatible with the normal \TEX\
output: \TEX's typesetting engine is normally unchanged, because the
optimization described here is turned off by default. At this moment there are
two methods provided. When \type {\pdfadjustspacing} is set to~1, stretching
is applied {\em after} \TEX's normal paragraph breaking routines have broken
the paragraph into lines. In this case, line breaks are identical to standard
\TEX\ behaviour.

When set to~2, the width changes that are the result of stretching and
shrinking are taken into account {\em while} the paragraph is broken into
lines. In this case, line breaks are likely to be different from those of
standard \TEX. In fact, paragraphs may even become longer or shorter.

Both alternatives use the extended collection of \TFM\ files that are related
to the \type {stretch} and \type {shrink} settings as described in the
previous section.

\pdftexprimitive {\Syntax {\Tex {\efcode} \Whatever {integer}}} 

\bookmark{\type{\efcode}}

We didn't yet tell the whole story. One can imagine that some glyphs are more
sensitive to scaling than others. The \type {\efcode} primitive can be used
to influence the stretchability of a glyph. The syntax is similar to \type
{\sfcode}, and defaults to~1000, meaning 100\%.

\starttyping
\efcode`A=2500
\efcode`O=0
\stoptyping

In this example an~A may stretch 2.5~times as much as normal and the~O is not
to be stretched at all. The minimum and maximum stretch is however bound by
the font specification, otherwise one would end up with more fonts inclusions
than comfortable.

\pdftexprimitive {\Syntax {\Tex {\pdffontname} \Something {font} \Whatever 
{expandable}}}

\bookmark{\type{\pdffontname}}

In \PDF\ files produced by \PDFTEX, one can recognize a font switch by the
prefix~\type {F} followed by a number, for instance \type {/F12} or
\type{/F54}. This command returns the number \PDFTEX\ uses to name a font
resource, e.g.~for a font named as \type {/F12} this command returns
number~12. 

\pdftexprimitive {\Syntax {\Tex {\pdffontobjnum} \Something {font} \Whatever 
{read||only integer}}}

\bookmark{\type{\pdffontobjnum}}

This command is similar to \type {\pdffontname}, but returns the object
number instead of the name of a font. Use of \type {\pdffontname} and \type
{\pdffontobjnum} allows user full access to all the font resources used in 
the document. 

\pdftexprimitive {\Syntax {\Tex {\pdfincludechars} \Something {font}
\Something {general text}}} 

\bookmark{\type{\pdfincludechars}}

This command causes \PDFTEX\ to treat the characters in \Something {general
text} as if they were used with \Something {font}, which means that the
corresponding glyphs will be embedded into the font resources in the \PDF\
output. Nothing is appended to the list being built. 

\subsection{XObject forms}

The next three primitives support a \PDF\ feature called \quote {object
reuse} in \PDFTEX. The idea is first to create a XObject form in \PDF. The
content of this object corresponds to the content of a \TEX\ box, which can
also contain pictures and references to other XObject form objects as well.
After that the XObject form can be used by simply referring to its object
number. This feature can be useful for large documents with a lot of similar
elements, as it can reduce the duplication of identical objects. 

These command behave similar \type {\pdfobj}, \type {\pdflastobj} and \type
{\pdfrefobj} but instead of taking raw \PDF\ code, they take care of text
typeset by \TEX. 

\pdftexprimitive {\Syntax {\Tex {\pdfxform} \Optional {\Something {attr
spec}} \Optional {\Something {resources spec}} \Something {box number}}} 

\bookmark{\type{\pdfxform}}

This command creates a XObject form corresponding to the contents of the box
\Something {box number}. The box can contain other raw objects, XObject forms
or images as well. It can however {\em not} contain annotations because they
are laid out on a separate layer, are positioned absolutely, and have a
dedicated housekeeping. 

When \Something {attr spec} is given, the text will be written as additional
attributes of the form. The \Something {resources spec} is similar, but the
text will be added to the resources dictionary of the form. The text given by
\Something {attr spec} or \Something {resources spec} is written before other
keys of the form dictionary and|/|or the resources dictionary and takes
priority to the further ones. 

\pdftexprimitive {\Syntax {\Tex {\pdfrefxform} \Something {integer}}}

\bookmark{\type{\pdfrefxform}}

The form is kept in memory and will be written to the \PDF\ output only when
its number is refered to by \type {\pdfrefxform} or \type {\pdfxform} is
preceded by \type {\immediate}. Nothing is appended to the list being built.
The number of the most recently created XObject form is accessible via \type
{\pdflastxform}. 

When issued, \type {\pdfrefxform} appends a whatsit node to the list being
built. When the whatsit node is searched at shipping time, \PDFTEX\ will
write the form with number \Something {integer} to the \PDF\ output if it is
not written yet. 

\pdftexprimitive {\Syntax {\Tex {\pdflastxform}} \Whatever {read||only
integer}} 
 
\bookmark{\type{\pdflastxform}}

The number of the most recently created XObject form is accessible via \type
{\pdflastxform}. 

As said, this feature can be used for reusing information. This mechanism
also plays a role in typesetting fill||in form. Such widgets sometimes
depends on visuals that show up on user request, but are hidden otherwise.

\subsection{Graphics inclusion}

\PDF\ provides a mechanism for embedding graphic and textual objects: XObject
forms. In \PDFTEX\ this mechanism is accessed by means of \type {\pdfxform},
\type {\pdflastxform} and \type {\pdfrefxform}. A special kind of XObjects 
are bitmap graphics and for manipulating them similar commands are provided. 

\pdftexprimitive {\Syntax {\Tex {\pdfximage} \Optional {\Something {rule
spec}} \Optional {\Something {attr spec}} \Optional {\Something {page spec}}
\Something {file spec}}} 

\bookmark{\type{\pdfximage}}

This command creates an image object. The dimensions of the image can be
controlled via \Something {rule spec}. The default values are zero for depth
and \quote {running} for height and width. If all of them are given, the
image will be scaled to fit the specified values. If some of them (but not
all) are given, the rest will be set to a value corresponding to the
remaining ones so as to make the image size to yield the same proportion of
$width : (height+depth)$ as the original image size, where depth is treated
as zero. If none of them is given then the image will take its natural size. 

An image inserted at its natural size often has a resolution of \type
{\pdfimageresolution} (see below) given in dots per inch in the output file,
but some images may contain data specifying the image resolution, and in such
a case the image will be scaled to the correct resolution. The dimension of
the image can be accessed by enclosing the \type {\pdfrefximage} command to a
box and checking the dimensions of the box:

\starttyping
\setbox0=\hbox{\pdfximage{somefile.png}\pdfrefximage\pdflastximage}
\stoptyping

Now we can use \type {\wd0} and \type {\ht0} to question the natural size of
the image as determined by \PDFTEX. When dimensions are specified before the
\type {{somefile.pdf}}, the graphic is scaled to fit these. Opposite to for
instance the \type {\input} primitive, the filename is supplied between
braces. 

The image type is specified by the extension of the given file name, so \type
{.png} stands for \PNG\ image, \type {tif} for \TIF, and \type {.pdf} for
\PDF\ file. Otherwise the image is treated as \PDF\ (\type {pdf}).

Similarly to \type {\pdfxform}, the optional text given by \Something {attr
spec} will be written as additional attributes of the image before other keys
of the image dictionary. 

\pdftexprimitive {\Syntax {\Tex {\pdfrefximage} \Something {integer}}}

\bookmark{\type{\pdfrefximage}}

The image is kept in memory and will be written to the \PDF\ output only when
its number is refered to by \type {\pdfrefximage} or \type {\pdfximage} is
preceded by \type {\immediate}. Nothing is appended to the list being built. 

\type {\pdfrefximage} appends a whatsit node to the list being built. When
the whatsit node is searched at shipping time, \PDFTEX\ will write the image
with number \Something {integer} to the \PDF\ output if it has not been
written yet. 

\pdftexprimitive {\Syntax {\Tex {\pdflastximage} \Whatever {read||only
integer}}} 

\bookmark{\type{\pdflastximage}}

The number of the most recently created XObject image is accessible via \type
{\pdflastximage}. 

\pdftexprimitive {\Syntax {\Tex {\pdfimageresolution} \Whatever {integer}}} 

\bookmark{\type{\pdfimageresolution}}

This parameter specifies the default resolution of included bitmap images
(\PNG, \TIF, and \JPEG). This parameter is read when \PDFTEX\ creates an
image via \type {\pdfximage}. When not given or set to~0 \PDFTEX\ treates it
as~72. 

\subsection{Annotations}

\PDF\ level 1.2 provides four basic kinds of annotations:

\startitemize[packed]
\item hyperlinks, general navigation
\item text clips (notes)
\item movies
\item sound fragments
\stopitemize

The first type differs from the other three in that there is a designated
area involved on which one can click, or when moved over some action occurs.
\PDFTEX\ is able to calculate this area, as we will see later. All
annotations can be supported using the next two general annotation
primitives.

\pdftexprimitive {\Syntax {\Tex {\pdfannot} \Optional {\Something {rule
spec}} \Something {general text}}} 

\bookmark{\type{\pdfannot}}

This command appends a whatsit node corresponding to an annotation to the the
list being built. The dimensions of the annotation can be controlled via
Something {rule spec}. The default values are running for all width, height
and depth. When an annotation is written out, running dimensions will take
the corresponding values from the box containing the whatsit node
representing the annotation. The \Something {general text} is inserted as raw
\PDF\ code to the contents of annotation. The annotation is written out only
if the corresponding whatsit node is searched at the shipping time. 

\pdftexprimitive {\Syntax {\Tex {\pdflastannot} \Whatever {read||only
integer}}} 

\bookmark{\type{\pdflastannot}}

This primitive returns the object number of the last annotation created by
\type {\pdfannot}. These two primitives allow users to create any annotation
that cannot be created by \type {\pdfstartlink} (see below).

\subsection[linking]{Destinations and links}

The first type of annotation mentioned before, is implemented by three
primitives. The first one is used to define a specific location as being
referred to. This location is tied to the page, not the exact location on the
page. The main reason for this is that \PDF\ maintains a dedicated list of
these annotations |<|and some more when optimized|>| for the sole purpose of
speed.

\pdftexprimitive {\Syntax {\Tex {\pdfdest} \Something {dest spec}}}

\bookmark{\type{\pdfdest}}

This primitive appends a whatsit node which establishes a destination for
links and bookmark outlines; the link is identified by either a number or a
symbolic name, and the way the viewer is to display the page must be
specified in \Something {dest type}, which must be one of those mentioned in
\in{table}[appearance]. 

\startbuffer
\starttabulate[|l|l|]
\HL
\NC \bf keyword \NC \bf meaning                                       \NC\NR
\HL
\NC \tt fit    \NC fit the page in the window                         \NC\NR
\NC \tt fith   \NC fit the width of the page                          \NC\NR
\NC \tt fitv   \NC fit the height of the page                         \NC\NR
\NC \tt fitb   \NC fit the \quote{Bounding Box} of the page           \NC\NR
\NC \tt fitbh  \NC fit the width of \quote{Bounding Box} of the page  \NC\NR
\NC \tt fitbv  \NC fit the height of \quote{Bounding Box} of the page \NC\NR
\NC \tt xyz    \NC goto the current position (see below)              \NC\NR
\HL
\stoptabulate
\stopbuffer

\placetable
  [here][appearance]
  {The outline and destination appearances.}
  {\getbuffer}

The specification \Literal {xyz} can optionally be followed by \Literal
{zoom} \Something {integer} to provide a fixed zoom||in. The Something
{integer} is like \TEX\ magnification, i.e. 1000 is the \quote {normal} page
view. When \Literal {zoom} \Something {integer} is given the zoom factor
changes to number, otherwise the current zoom factor is kept unchange.d 

The destination is written out only the corresponding whatsit node is
searched at the shipping time. 

\pdftexprimitive {\Syntax {\Tex {\pdfstartlink} \Optional {\Something {rule
spec}} \Optional {\Something {attr spec}} \Something {action spec}}} 

\bookmark{\type{\pdfstartlink}}

This primitive is used along with \type {\pdfendlink} and appends a whatsit
node corresponding to the start of a hyperlink. The whatsit node representing
the end of the hyperlink is created by \type {\pdfendlink}. The dimensions of
the link are handled in the similar way as in \type {\pdfannot}. Both \type
{\pdfstartlink} and \type {\pdfendlink} must be in the same level of box
nesting. A hyperlink with running width can be multi||line or even
multi||page, in which case all horizontal boxes with the same nesting level
as the boxes containing \type {\pdfstartlink} and \type {\pdfendlink} will be
treated as part of the hyperlink. The hyperlink is written out only if the
corresponding whatsit node is searched at the shipping time. 

Additional attributes, which are explained in great detail in the \PDF\
Reference Manual, can be given via \Something {attr spec}. Typically, the
attributes specify the color and thickness of any border around the link.
Thus \typ {/C [0.9 0 0] /Border [0 0 2]} specifies a color (in \RGB) of dark
red, and a border thickness of 2~points. 

While all graphics and text in a \PDF\ document have relative positions,
annotations have internally hard||coded absolute positions. Again we're
dealing with a speed optimization. The main disadvantage is that these
annotations do {\em not} obey transformations issued by \type
{\pdfliteral}'s. 

The \Something {action spec} specifies the action that should be perfomed
when the hyperlink is activated while the \Something {user-action spec}
performs a user||defined action. A typical use of the latter is to specify a
\URL, like \typ {/S /URI /URI (http://www.tug.org/)}, or a named action like
\typ {/S /Named /N /NextPage}. 

A \Something {goto-action spec} performs a GoTo action. Here \Something
{numid} and \Something {nameid} specify the destination identifier (see
below). The \Something {page spec} specifies the page number of the
destination, in this case the zoom factor is given by \Something {general
text}. A destination can be performed in another \PDF\ file by specifying
\Something {file spec}, in which case \Something {newwindow spec} specifies
whether the file should be opened in a new window. A \Something {file spec}
can be either a \type {(string)} or a \type{<<dictionary>>}. The default
behaviour of the \Something {newwindow spec} depends on the browser setting. 

A \Something {thread-action spec} performs an article thread reading. The
thread identifier is similar to the destination identifier. A thread can be
performed in another \PDF\ file by specifying a \Something {file spec}. 

\pdftexprimitive {\Syntax {\Tex {\pdfendlink}}}

\bookmark{\type{\pdfendlink}}

This primitive ends a link started with \type {\pdfstartlink}. All text
between \type {\pdfstartlink} and \type {\pdfendlink} will be treated as part
of this link. \PDFTEX\ may break the result across lines (or pages), in which
case it will make several links with the same content. 

\pdftexprimitive {\Syntax {\Tex {\pdflinkmargin} \Whatever {dimension}}} 

\bookmark{\type{\pdflinkmargin}}

This dimension parameter specifies the margin of the box representing a
hyperlink and is read when a page containing hyperlinks is shipped out. 

\subsection{Bookmarks}

\pdftexprimitive {\Syntax {\Tex {\pdfoutline} \Something {action spec}
\Optional {\Literal {count} \Something {integer}} \Something {general text}}} 

\bookmark{\type{\pdfoutline}}

This primitive creates an outline (or bookmark) entry. The first parameter
specifies the action to be taken, and is the same as that allowed for \type
{\pdfstartlink}. The \Something {count} specifies the number of direct
subentries under this entry; specify~0 or omit it if this entry has no
subentries. If the number is negative, then all subentries will be closed and
the absolute value of this number specifies the number of subentries. The
\Something {text} is what will be shown in the outline window. Note that this
is limited to characters in the \PDF\ Document Encoding vector. The outline
is written to the \PDF\ output immediately. 

\subsection{Article threads}

\pdftexprimitive {\Syntax {\Tex {\pdfthread} \Something {rule spec} \Optional
{\Something {attr spec}} \Something {id spec}}} 

\bookmark{\type{\pdfthread}}

Defined an article thread. Treads with same identifiers (spread across the 
document) will be joined together. 

\pdftexprimitive {\Syntax {\Tex {\pdfthreadmargin} \Whatever {dimension}}} 

\bookmark{\type{\pdfthreadmargin}}

Specifies a margin to be added to the thread dimensions. 

\subsection{Miscellaneous}

\pdftexprimitive {\Syntax {\Tex {\pdfliteral} \Optional {\Literal {direct}}
\Something {general text}}} 

\bookmark{\type{\pdfliteral}}

Like \type {\special} in normal \TEX, this command inserts raw \PDF\ code
into the output. This allows support of color and text transformation. This
primitive is heavily used in the \METAPOST\ inclusion macros. Normally
\PDFTEX\ ends a text section in the \PDF\ output and resets the
transformation matrix before inserting \Something {general text}, however it
can be turned off by giving the optional keyword \Literal {direct}. This
command appends a whatsit node to the list being built. \Something {general
text} is expanded when the whatsit node is created and not when it is shipped
out, so this primitive behaves like \type {\special}. 

\pdftexprimitive {\Syntax {\Tex {\pdfobj} \Optional {\Something {object type
spec}} \Something {general text}}} 

\bookmark{\type{\pdfobj}}

This command creates a raw \PDF\ object that ends op in the \PDF\ file as
\type {1 0 obj <<} \unknown\ \type {>> endobj}. When \Something {object type
spec} is not given, a dictionary object with contents \Something {general
text} is created. 

When however \Something {object type spec} is given as \Something {attr spec}
\Literal{stream}, the object will be created as a stream with contents
\Something {general text} and additional attributes in \Something {attr
spec}. 

When \Something {object type spec} is given as \Something{attr spec}
\Literal{file}, then the \Something {general text} will be treated as a file
name and its contents will be copied into the stream contents. 

The object is kept in memory and will be written to the \PDF\ output only
when its number is refered to by \type {\pdfrefobj} or when \type {\pdfobj}
is preceded by \type {\immediate}. Nothing is appended to the list being
built. The number of the most recently created object is accessible via
\type {\pdflastobj}. 

\pdftexprimitive {\Syntax {\Tex {\pdflastobj} \Whatever {read||only integer}}} 

\bookmark{\type{\pdflastobj}}

This command returns the object number of the last object created by \type
{\pdfobj}. 

\pdftexprimitive {\Syntax {\Tex {\pdfrefobj} \Something {integer}}}

\bookmark{\type{\pdfrefobj}}

This command appends a whatsit node to the list being built. When the whatsit
node is searched at shipping time, \PDFTEX\ will write the object with number
\Something {integer} to the \PDF\ output if it has not been written yet. 

\pdftexprimitive {\Syntax {\Tex {\pdftexversion}}}

\bookmark{\type{\pdftexversion}}

Returns the version of \PDFTEX\ multiplied by 100, e.g. for version \type
{0.13x} it returns 13. This document is typeset with version~\the
\pdftexversion .\pdftexrevision .

\pdftexprimitive {\Syntax {\Tex {\pdftexrevision}}}

\bookmark{\type{\pdftexrevision} \Whatever {expandable}} 

Returns the revision of \PDFTEX, e.g. for version \type {0.14a} it returns
\type {a}.

\section{Graphics and color}

\PDFTEX\ supports inclusion of pictures in \PNG, \JPEG, \TIF\ and \PDF\
format. The most common technique |<|the inclusion of \EPS\ figures|>| is
replaced by \PDF\ inclusion. \EPS\ files can be converted to \PDF\ by
GhostScript, Acrobat Distiller or other \POSTSCRIPT||to||\PDF\ convertors.
The BoundingBox of a \PDF\ file is taken from CropBox if available, otherwise
from the MediaBox. To get the right BoundingBox from a \EPS\ file, before
converting to \PDF, it is necessary to transform the \EPS\ file so that the
start point is at the (0,0)~coordinate and the page size is set exactly
corresponding to the BoundingBox. A \PERL\ script (\EPSTOPDF) for this
purpose has been written by Sebastian Rahtz. The \TEXUTIL\ utility script
that comes with \CONTEXT\ can so a similar job. (Concerning this conversion,
it handles complete directories, removes some garbage from files, takes
precautions against duplicate conversion, etc.)

Other alternatives for graphics in \PDFTEX\ are:

\description {\LATEX\ picture mode} Since this is implemented simply in terms
of font characters, it works in exactly the same way as usual.

\description {Xy||pic} If the \POSTSCRIPT\ back||end is not requested, Xy-pic
uses its own Type~1 fonts, and needs no special attention.

\description {tpic} The \quote {tpic} \type {\special} commands (used in some
macro packages) can be redefined to produce literal \PDF, using some macros
written by Hans Hagen.

\description {\METAPOST} Although the output of \METAPOST\ is \POSTSCRIPT, it
is in a highly simplified form, and a \METAPOST\ to \PDF\ conversion (written
by Hans Hagen and Tanmoy Bhattacharya) is implemented as a set of macros
which reads \METAPOST\ output and supports all of its features.

\description {\PDF} It is possible to insert arbitrary one||page||only
\PDF\ files, with their own fonts and graphics, into a document. The
front page of this document is an example of such an insert, it is an
one page document generated by \PDFTEX.

For new work, the \METAPOST\ route is highly recommended. For the future,
Adobe has announced that they will define a specification for \quote
{encapsulated \PDF}, and this should solve some of the present difficulties.

The inclusion of raw \POSTSCRIPT\ commands |<|a technique utilized by for
instance the \type {pstricks} package|>| cannot be supported. Although \PDF\
is a direct descendant of \POSTSCRIPT, it lacks any programming language
commands, and cannot deal with arbitrary \POSTSCRIPT.

\stopbodymatter

%D We did use some abbreviations. Only those really used will end up in the 
%D following list.

\startbackmatter

\writebetweenlist[section]{\blank[line]}

\section{Abbreviations}

In this document we used a few abbreviations. For convenience we mention 
their meaning here. 

\placelistofabbreviations

\stopbackmatter

%D And then we're done.

\stoptext
