summaryrefslogtreecommitdiff
path: root/usergrps/uktug/baskervi/6_4/sojka.tex
blob: 65be64ca0f35c1d3ec40b99aee3291cd9baba9f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
\author[Petr Sojka, Han The Thanh, and Ji\v{r}\'\i\ Zlatu\v{s}ka]
{Petr Sojka, Han The Thanh, and Ji\v{r}\'\i\ Zlatu\v{s}ka\\
Faculty of Informatics\\
Masaryk University Brno\\
Bure\v{s}ova 20, 602\,00 Brno\\
Czech Republic}
\title{The Joy of \TeX2\acro{PDF}\Dash Acrobatics
with an Alternative to \acro{DVI} Format}
\newcommand{\stress}[1]{\emph{#1}}
\makeatletter
\DeclareRobustCommand{\Hyph}{\nobreak\hskip\z@skip%
       \discretionary{-}{-}{-}\nobreak\hskip\z@skip}
\DeclareRobustCommand{\La}{L\kern-.36em%
        {\sbox\z@ T%
         \vbox to\ht0{\hbox{$\m@th$%
                            \csname S@\f@size\endcsname
                            \fontsize\sf@size\z@
                            \math@fontsfalse\selectfont
                            A}%
                      \vss}%
        }%
        \kern-.14em%
}
\makeatother
\newcommand{\pdfcname}[1]{\texttt{\bs #1}}
\let\citeasnoun=\citeANP
\newcommand\TeXtoPDF{\TeX2\acro{PDF}}
%
% mottos
%
\newcommand{\mottofont}{\small\sl}
\newenvironment{smotto}
       {\leavevmode\par\noindent\hbox{}\hfill\begin{minipage}{0.96\linewidth}
        \parindent0pt\hfill\mottofont
        \begin{tabular}[t]{@{}r@{}}
        }
       {\end{tabular}
        \end{minipage}
        \smallskip\par\nobreak\noindent%
        }

\def\acro#1{\textsc{#1}}
\begin{Article}

\noindent [\emph{Editor's note:} At the \TeX{} Users Group meeting held in
Dubna, Russia, in July/August 1996, a prize in memory of
Cathy Booth was awarded to this paper. Delegates to the conference
gave it their overwhelming vote when asked to consider which paper
would affect their \TeX{} work in the future. Sebastian Rahtz and
Robin Fairbairns, representing UKTUG at the meeting, were delighted to
keep alive the memory of Cathy Booth with a paper she would have
greatly enjoyed.

This paper is reprinted from \emph{TUGboat} 16(3) with kind permission
of Barbara Beeton and the authors.
]

\begin{abstract}
This paper presents a discussion about generating 
Portable Document Format (\acro{PDF})
directly from \TeX{} source using a prototype
\TeXtoPDF{} program. This is a derivative made from the \TeX{}
source which allows us to bypass
\acro{DVI} output generation, and to produce documents
in Adobe \acro{PDF} directly. Motivations for the \TeXtoPDF{}
approach are discussed and further possible
enhancements are outlined.
\end{abstract}


\section{Motivation}
\label{s:motivation}
\begin{smotto}
\textsc{Go forth} now\\ 
and create masterpieces\\
of the publishing art!\\
Don Knuth \protect\cite{tex:Knuth:ct-a}, p.~303.
\end{smotto}


\noindent
General acceptance of \TeX{} for the publishing of technical
documents has spread enormously during the last two decades. 
Since \TeX's inception, however,
new standards have emerged in the publishing world. 
\acro{SGML} and \LaTeX\ for markup, \PS{} and 
Portable Document Format as page description
languages (\acro{PDL}), are just a~few of the buzzwords in the arena. 
Publishers are moving towards the
art of creating \emph{electronic} documents.

% redid next sentence - hate that dash...
\TeX's typesetting engine outputs its results in the device independent
(\acro{DVI}) page description format
\cite{tex:Fuchs:TB1-1-17,tex:Fuchs:TB3-2-14}.
To avoid duplication, and to be backward compatible,
various extensions to the \acro{DVI} format
have been used via the \verb+\special+ command.
Do you need color? Use color supporting \verb+\special+s.
Do you need PostScript fragments in the \verb+dvi+ file?
Graphics in various formats?
\acro{PDF} fragments in the \verb+dvi+ file? Hypertext?
Document/object structure markup for an \acro{SGML}
driver? Every new application usually ends up 
as a~new set of \verb+\special+s, which are unfortunately,
not yet standardized~\cite{tex:sofka96,tex:rokicki95TB16-4}.

Do you need portable object reuse in your \verb+dvi+ file?
Sound? Portable Multiple Master font parameters?
No \verb+\special+s for these are 
in sight. 

As a result of all this, documents in \acro{DVI}
 format are not really portable,
as they usually contain a~lot of \verb+\special+s,
and visual appearance depends on the device drivers
available at the reader's site.
These and similar problems and thoughts have led us to research
on the possibility of generating portable electronic documents
which will offer widest range of functionality
from well established and widely used (\La)\TeX{} sources. 

%In the next section 
We give an overview of current
formats relevant to the electronic document storage,
%In section~\ref{s:pdf} we discuss
including the current possibilities for producing
\acro{PDF}\Dash a possible format of choice for electronic documents.
We suggest a~new approach by means of the \TeXtoPDF{} 
program % in the section~\ref{s:tex2pdf} and, in
        % section~\ref{s:proscons},
and discuss its merits with respect to other approaches.
We conclude with a discussion of object reuse %in section~\ref{s:reuse},
and future developments.% in section~\ref{s:future}.


\section{Formats for Electronic Document Delivery}
\label{s:formats}

\subsection{DVI Format}
\label{s:dvi}
A \verb+dvi+ file is the standard output of a~\TeX{} run and is often used as 
a~format for storage and exchange of typeset \TeX{} documents.

\acro{DVI} format is heavily (but not exclusively) used e.g.\
in the Los Alamos \mbox{e-Print} archive \url|http://xxx.lanl.gov/|.
Several tens of thousands 
documents are available (typeset by auto\TeX ing
scripts) from there. The disadvantage is that the documents
are not `self\Hyph embedded', which means that they rely
on standardisation of font names and availability
of fonts at the document consumer's site.
Hypertext extensions to the \acro{DVI} format have been accomplished 
by a~set of \acro{HTML}\Hyph like \verb+\special+s
defined by the Hyper\TeX{} project
(\URL|http://xxx.lanl.gov/hypertex/|)
and special versions of previewers (\textsf{xhdvi}), 
\textsf{dvihps} and \textsf{ghost\-script} 
(\textsf{ghosth\-view}) have been developed.


\subsection{Portable Document Format}
\label{s:pdf}

\acro{PDF} \cite{tex:pdf96} is 
a~page description language derived from Adobe's %Display 
PostScript language~\cite{tex:postscriptref85}. 
The design goals are:
\begin{itemize}
\item Rendering speed\Dash algorithmic constructs were
removed from the language.
\item Portability\Dash as a~cross platform format, Acrobat Reader
is available free of charge on major platforms.
\item Compactness\Dash The Lempel, Ziv, Welsh 
compressing algorithm was licensed from UNISYS
for maximum compression of files.\footnote{Latest
news from Adobe says that ZIP compression has been added as
well, leading to even better compression ratios.}
Multiple Master font technology, partial font downloading 
and built-in fonts in the Acrobat Reader
lead to a minimum size for portable documents.
\item WWW support\Dash hypertext links to other documents
on the Internet are allowed. \acro{PDF} version~1.2 
and Acrobat~3.0 (Amber) introduced a linearized arrangement
of objects within \acro{PDF} documents, allowing for incremental downloading
across the Internet.
\item\sloppypar Extensibility\Dash documents can be extended
without losing the old version; notes (stickers)
can be added to document by the readers.
\item Password protection\Dash access to a~document can be 
protected by a~password.
\item Object structure\Dash
allows for access to individual pages, with possibility
of one-pass generation.
\item Easy exchange\Dash ASCII (7bit)
\acro{PDF} files can be generated for better portability
and email exchange.
\end{itemize}
\acro{PDF} files can be embedded directly in an \acro{HTML} page
using the \acro{HTML} \texttt{<EMBED>} tag~\cite{html:adobe3beta}.
These are becoming more
and more popular in the \acro{WWW} world, as they render
faithfully what the author saw
(modulo color rendering and resolution of 
an end\Hyph user's display).


\subsection{SGML}
\label{s:sgml}
\smallskip
\begin{smotto}
Roll on \acro{SGML}, and real document storage.\\ 
Not just this strange \acro{PDF} thing\\
which traps the visuals like an insect in amber \ldots\\
James Robertson on~\texttt{comp.text.pdf}
\end{smotto}

\noindent
\acro{SGML}~is~a~widely accepted international 
standard (ISO~8879)~\cite{sgml:Goldfarb:1990:SH,%
sgml:DeRose:1994:MHW,sgml:ANSI:1985:IPT%,sgml:CSA:1989:IPT%
} for document markup. 
It~is the format of choice for document storage chosen by many 
publishers~\cite{tex:rahtz95,tex:Dobrowolski91:TB12-3,%
sgml:AAP:1987:AAP}.
It~is a~language for describing markup, aimed at long\Hyph term storage,
but not at visual layout. As \TeX{}'s typesetting engine
is still the state\Hyph of\Hyph the\Hyph art, 
the perspective of typesetting
of \acro{SGML} documents via \LaTeX3 with \TeX{} based engine
is a~viable option. 


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{table*}[t!]
\begin{tabularx}{\textwidth}{@{}|X|c|c|c|@{}}
\hline
\multicolumn{1}{|c|}{\raisebox{-1ex}[0mm][0mm]{Program(s)}} &
\strut without \acro{LZW} & with \acro{LZW} & without compression\\
& compression & compression & and \acro{PDF} file gzipped\\
\hline
\TeXtoPDF{} ($\alpha$-test version) & \phantom{1}8\,063\,658 & 3\,086\,545 & 1\,906\,184 \\
\TeX{} + \textsf{dvips} 5.58 + Adobe Distiller 2.1& 10\,530\,967 & 4\,387\,232& 2\,115\,827\\
\TeX{} + \textsf{dvips} 5.58 + Aladdin Ghostscript 4.0 & 16\,908\,552 & not applicable& \\
\hline 
\end{tabularx}
\caption{Size comparison of several ways of
  producing \acro{PDF} file (\texttt{tex.pdf}) 
  from a~\TeX{} file (\texttt{tex.tex})}
\label{tab:sizecomp}
\end{table*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{table*}[t!]
\begin{tabularx}{\textwidth}{@{}|X|c|c|@{}}
\hline
\multicolumn{1}{|c|}{\raisebox{-1ex}[0mm][0mm]{Program(s)}} &
\strut Time without & Time with \\
&compression & compression (LZW)\\
\hline
\TeXtoPDF{} ($\alpha$-test version)& 1:57 & 2:38 \\
\TeX{} + \textsf{dvips} 5.58 + Adobe Distiller 2.1&  6:34 (1:33+0:18+4:43) & 
  6:56 (1:33+0:18+5:05)\\
\TeX{} + \textsf{dvips} 5.58 + Aladdin Ghostscript 4.0 & not applicable& 
40:23 (1:33+0:18+38:32)\\ 
\hline
\end{tabularx}
\caption{Speed comparison of several ways of
  producing \acro{PDF} file (\texttt{tex.pdf}) 
  from a~\TeX{} file (\texttt{tex.tex})}
\label{tab:timecomp}
\end{table*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



\section{Current Possibilities for Producing PDF from \TeX}
\label{s:currentpdf}

If~\acro{PDF}~is~required as the end format, with currently available
programs one has to generate PostScript from
a~\verb+dvi+ file and then to `distill' (using Adobe's Distiller program)
the result to~\acro{PDF}.
Some comments and suggestions on how to create
\acro{PDF} files from \TeX{} are collected in \cite{tex:yandy:96}.
Problems with configuring fonts are 
described in \cite{tex:whitehouse:96} and \cite{tex:emerge:96}.


\section{The Name of the Game}% Direct Generation
\label{s:tex2pdf}
\begin{smotto}
There still are countless important issues\\ 
to be studied, relating especially to the many\\
classes of documents that go far beyond\\
what I ever intended \TeX{} to handle.\\
Don Knuth~\cite{tex:knuth89}, p.~640 
\end{smotto}

\noindent 
Motivated by a~note by Don Knuth to one of the authors
(private communication, 1994), who mentioned he expected people would
attempt to create derivations from \TeX\ suitable for, e.g.,
outputting PostScript instead of \acro{DVI}, a~project for creating
\acro{PDF} files directly from the \TeX\ source has been 
attempted~\cite{tex:thanh96eng}, introducing the possibility of creating
either \acro{DVI} or \acro{PDF} output. The working name of this game is \TeXtoPDF{}. 
An example of the \TeX{} source taking advantage of 
the new possibilities is shown in figure~\ref{example-tex}
and the resulting document as viewed with Adobe Acrobat Reader
is shown in figure~\ref{example-reader} on page~\pageref{example-reader}.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{figure*}[t!]
{\small\verbatiminput{sample-texbook.tex}}
\caption{Example of new hypertext primitives added in the 
\TeXtoPDF{} source file} 
\label{example-tex}
\end{figure*}

\begin{figure*}[p!]
\includegraphics*[width=\textwidth, bb=-30 -53 644 847]{t.eps}
\caption{Result of \TeXtoPDF{} source in 
Fig.~\protect\ref{example-tex} viewed in Acrobat Reader}
\label{example-reader}
\end{figure*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\subsection{New primitives}
New primitives have been introduced in \TeXtoPDF{} in order to allow for more
straightforward use of hypertext features 
from within \TeX\Hyph like source.
Most of their parameters are taken implicitly from the context 
of use in \TeX{} terms, which simplifies their use considerably. 
We do not specify the full syntax here, because it is not yet fully stable.
\begin{description}
\item[]\pdfcname{pdfoutput}
changes \TeXtoPDF{} behaviour from \acro{DVI}\Hyph producing mode
to \acro{PDF}\Hyph producing one.
\item[]\pdfcname{pdfannottext}
takes an argument which specifies the text of an annotation
to be created at the current position.
\item[]\pdfcname{pdfannotlink}, \pdfcname{pdfendlink}
allows the user to specify hypertext links with all
of the link attributes available in the \acro{PDF} specification.
An integer argument is used as a key to the corresponding anchor.
If no link border has been specified, it is computed for all boxes
between \pdfcname{pdfannotlink} and \pdfcname{pdfendlink}, so the
link will automatically become multiline if line break
occurs in between.
\item[]\pdfcname{pdfoutline} allows for the generation 
of bookmarks; bookmarks can be hierarchically structured.
\item[]\pdfcname{pdfdestxyz}, \pdfcname{pdfdestfit}, 
\pdfcname{pdfdestfith}, \pdfcname{pdf\-dest\-fitv}
provide specification of various types of anchors
with zooming and fitting possib\-il\-ities.
\item[]\pdfcname{pdfdestfitr}, \pdfcname{pdfendfitr}
specify the position of anchor corners. In~this case, the 
anchor area is computed from the corners.
\end{description}

\subsection{Font handling}
Font handling in \TeXtoPDF{} is currently limited to Type1 fonts only.
Metric information is extracted from the \texttt{pfb} file.
Font name mapping is handled using an auxiliary font mapping 
configuration file introducing the
list of fonts available, together with the
information on the type of font embedding and its usage.

Virtual fonts~\cite{tex:Knuth:TB11-1-13-23} are 
supported in \TeXtoPDF{}. As they are in fact part of \verb+dvi+
files, they have to be unfolded before \acro{PDF} is output, as in 
today's \acro{DVI} drivers.

\subsection{Compression}
Compression is allowed in the \acro{PDF} specification, and 
several types of compression filters can be used;
\acro{JPEG} compression for color graphics,
\acro{LZW} and \acro{ZIP} compression for text and graphics, and
\acro{CCITT} Group, Run Length and \acro{LZW} compression for monochrome
images. 

As the \acro{LZW} compression algorithm is licensed by \acro{UNISYS}, we
cannot distribute \TeXtoPDF{} with \acro{LZW} support, but we used
it for testing runs to compare \TeXtoPDF{} with Distiller (see
table~\ref{tab:sizecomp}). However, the even more effective
\acro{ZIP} compression will be available in \acro{PDF} version~1.2,
avoiding the need for \acro{LZW} compression in \TeXtoPDF{}, and
the patent problems.  The test figures show that
\TeXtoPDF{} generated even more compact \acro{PDF} file
than Adobe Distiller on standard text files.

\subsection{Graphics}
\verb+\special+s are not yet handled by \TeXtoPDF{}. As most of the graphics
included in \TeX{} documents are PostScript and \acro{TIFF},
at least support for the PostScript to \acro{PDF} and \acro{TIFF}
to \acro{PDF} conversion will have to be included in the future.

\subsection{Implementation}
The implementation of of \TeXtoPDF{} is realized as a~\texttt{web} change file
to the latest \TeX{} source~\cite{tex:knuth86:ct-b}.
This implies that \TeXtoPDF{} is as portable as \TeX{} itself is. 
Karl Berry's \textsf{web2c} package has been used for 
the development and for producing
a running Unix version. We expect easy recompilation on any 
Unix platform.

\section{Pros and Cons}
\label{s:proscons}

\begin{smotto}
I was constantly bombarded by ideas\\ 
for extensions, and I was constantly turning\\ 
a~deaf ear to everything that did not fit\\
well with \TeX{} as I conceived it at the time.\\
Don Knuth~\cite{tex:knuth89}, p.~640
\end{smotto}

\noindent
To compare \TeXtoPDF{} with the other methods
of producing a hypertext \acro{PDF} document from a \TeX{} file,
we did several testing runs. They were done on a
Sun Sparc~10 under the Solaris 2.4 operating system. Measurements
were done using the \verb+time+ program (CPU times are listed).
We used \verb+tex.tex+, generated from the \TeX{} source (\verb+tex.web+)
file, as the testing document. For the hypertext version
we used a slightly changed version of \verb+webmac.tex+
(see \URL|http://www.cstug.cz/~thanh/tex2pdf|).


In both time and size comparisons \TeXtoPDF{} beats its competitors
(see tables~\ref{tab:sizecomp} and~\ref{tab:timecomp}). This is mainly
due to the
absence of intermediate \acro{DVI} and PostScript 
formats in \TeXtoPDF{}, allowing for better PDF optimization.
\TeXtoPDF{} is slightly slowed down by \texttt{pfb} file parsing.
 
The users familiar with the (\textsf{emacs} + \TeX{} + \textsf{xhdvi} 
(+~\textsf{ghostscript})) suite
of programs might want to switch to 
(\textsf{emacs} + \TeXtoPDF{} + \textsf{xpdf}), 
thus speeding up the document debugging cycle considerably.

\TeXtoPDF{} is written in \texttt{web} so that its source blends naturally
with the source of \TeX{} the program. The
obvious benefit is absolute compatibility with \TeX{} proper;
the actual code which drives the typesetting
engine is that of Don Knuth (modulo \texttt{whatsits}
use for the hypertext primitives added in \TeXtoPDF{}).
While this conformance to \TeX{} source greatly
benefits from Don's appreciation of stability, 
it makes the implementor's life more difficult in
the world where \acro{PDF} still evolves.
It is also hard to debug \TeXtoPDF{} without incremental
compilation. When we come to add implementation of
\verb+\special+ commands, maintenance will 
become tough. 

The changes introduced in new versions of \acro{PDF} are
motivated by achieving better performance when handling Acrobat
documents, and so \TeXtoPDF{} is bound to have the 
\acro{PDF}\Hyph generating modules
modified or rewritten so that maximum benefit of the
features supported by \acro{PDF} technology can be used.
The fact that PDF specification has been made public is
crucial to success of this approach.

The \TeXtoPDF{} aproach is naturally backward compatible with
\TeX{}\Dash in fact, if \acro{PDF} output is not switched
on, it can still generate \acro{DVI} output identical to that of \TeX{}.
Just by redefining some cross-referencing macros,
the new hypertext features of \TeXtoPDF{} can be instantly used even
without modifying the markup of old \LaTeX{} documents.

\section{Object Reuse}
\label{s:reuse}

\begin{smotto}
Using well-designed formats results\\
in \LaTeX\ source that clearly reflects\\
the document structure.\\
T.~V. Raman~\cite{tex:raman92}
\end{smotto}

\noindent
With \acro{PDF}, there is the possibility of taking advantage
of the object structure and manipulation specified within a~\acro{PDF} file 
to store elements of document structure (higher level 
document model) in the \acro{PDF} file
generated by the application (\TeXtoPDF{}).
Some work has been already done
in this direction by 
defining Encapsulated PDF (\acro{EPDF}) blocks and their 
reuse~\cite{tex:smith95}. This format, however,
is not supported or used by a wide variety of applications.

The logical structure of a document model is also urgently 
needed in applications
like A\kern.1pts\kern-.125emT\kern-.125emeR~\cite{tex:raman92}, which \emph{reads}
\LaTeX\ documents using a speech synthesizer. 
Developing an application that is 
able of reading aloud enriched \acro{PDF} files might become possible.

Our suggestions for further work
could lead to primitives which
allow handling of \acro{PDF} \emph{objects} 
stored in the trailer of a~\acro{PDF} file indirectly.
At least three primitives are foreseen:
\begin{description}
\item[]\pdfcname{setpdfbox} typesets its argument
and stores the result as a~\acro{PDF} object. The reference to that
object will stay in the internal register accessible by
\pdfcname{lastpdfbox}.

\item[]\pdfcname{lastpdfbox} returns
the reference to the last stored object by \pdfcname{setpdfbox}.

\item[]\pdfcname{usepdfbox} This primitive puts a~\emph{reference}
to an~object into the output stream.
\end{description}


\section{Future Work}
\label{s:future}

\begin{smotto}
Few claim to know what will be the preferred\\
electronic format a century from now,\\
but I'am willing to go out on a limb\\ 
and assert that it will be none of \TeX,\\ 
PostScript, \acro{PDF}, Microsoft Word, nor any\\
other format currently in existence.\\
Paul Ginsparg~\cite{ginsparg:unesco96}
\end{smotto}

\noindent
\TeXtoPDF{} is currently under development and is available
to beta testers only. We do not guarantee 
that the input syntax will remain unchanged.
Support for object reuse and graphics when the \acro{PDF} specification
1.2 comes out may be added.

For testing purposes, a \texttt{tex2pdf}
option for the hyperref package~\cite{tex:yannis95} will be written, using 
the hypertext possibilities of \TeXtoPDF{} directly.
This will allow using \TeXtoPDF{} for re\Hyph type\-setting of
\LaTeX\ documents just by 
loading with \texttt{hyperref} package with the \texttt{tex2pdf}
option in the document preamble.

Support for the full usage of Multiple Master 
technology remains to be added, possibly
in the combination with \MF~\cite{tex:yannis94,tex:goossensrahtz95}.
Extensions of the paragraph breaking algorithm~\cite{tex:knuth81a}
to take advantage of Multiple Master fonts with a variable width
axis (but constant grayness) to help justification
(\texttt{\bs emergencyfontwidthstretch})
is another possible direction of future work.

\section*{Acknowledgements}
\label{s:acknowledgement}

The support of TUG '96 bursary committee is acknowledged, having
allowed presentation of preliminary version of this
paper at the TUG '96 conference in Dubna, Russia.

\begin{thebibliography}{10}

\bibitem{html:adobe3beta}
Adobe.
\newblock Adobe acrobat 3.0 beta.
\newblock \URL|http://www.adobe.com/acrobat/3beta/main.html|, 1996.

\bibitem{tex:postscriptref85}
{Adobe Systems}.
\newblock {\em {\PS} Language Reference Manual}.
\newblock Ad{\-d}i{\-s}on-Wes{\-l}ey, Reading, MA, USA, 1985.

\bibitem{sgml:ANSI:1985:IPT}
{American National Standards Institute and International Organization for
  Standardization}.
\newblock {\em Information processing: Text and Office Systems: Standard
  Generalized Markup Language ({SGML}).}
\newblock American National Standards Institute, 1430 Broadway, New York, NY
  10018, USA, 1985.

\bibitem{sgml:AAP:1987:AAP}
{Association of American Publishers}.
\newblock {\em {Association of American Publishers} Electronic Manuscript
  Series Standard for Electronic Manuscript Preparation and Markup: an {SGML}
  Application Conforming to International Standard {ISO} 8879--Standard
  Generalized Markup Language. Version 2.0 {Dublin}, {Ohio}: Available from the
  {Electronic Publishing Special Interest Group}, c1987}.
\newblock Association of American Publishers, Dublin, OH, USA, 1987.

\bibitem{tex:pdf96}
Tim Bienz, Richard Cohn, and James~R. Meehan.
\newblock {\em {Portable Document Format} Reference Manual, Version 1.1}.
\newblock Ad{\-d}i{\-s}on-Wes{\-l}ey, Reading, MA, USA, 1996.

\bibitem{sgml:DeRose:1994:MHW}
Steven~J. DeRose and David~G. Durand.
\newblock {\em Making Hypermedia Work}.
\newblock Kluwer Academic Publishers Group, Norwell, MA, USA, and Dordrecht,
  The Netherlands, 1994.

\bibitem{tex:Dobrowolski91:TB12-3}
Andrew~E. Dobrowolski.
\newblock {{Typesetting SGML documents using \smash{\TeX}}}.
\newblock {\em TUGboat}, 12(3):\mbox{409--414}, December 1991.

\bibitem{tex:emerge:96}
Inc. Emerge.
\newblock \smash{\TeX} and pdf: Solving font problems.
\newblock \url|http://www.emrg.com/texpdf.html|, 1996.

\bibitem{tex:Fuchs:TB1-1-17}
David Fuchs.
\newblock {{The Format of \TeX's DVI Files}}.
\newblock {\em TUGboat}, 1(1):17, October 1980.

\bibitem{tex:Fuchs:TB3-2-14}
David Fuchs.
\newblock {{The Format of \TeX's DVI Files}}.
\newblock {\em TUGboat}, 3(2):14, October 1982.

\bibitem{ginsparg:unesco96}
Paul Ginsparg.
\newblock Winners and losers in the global research village.
\newblock \URL|http://xxx.lanl.gov/blurb/pg96unesco.html|, February 1996.

\bibitem{sgml:Goldfarb:1990:SH}
Charles~F. Goldfarb and Yuri Rubinsky.
\newblock {\em The {SGML} handbook}.
\newblock Clarendon Press, Oxford, UK, 1990.

\bibitem{tex:goossensrahtz95}
Michel Goossens, Sebastian Rahtz, and Robin Fairbairns.
\newblock {{Using Adobe Type~1 Multiple Master Fonts with \TeX{}}}.
\newblock {\em TUGboat}, 16(3):253--258, June 1995.

\bibitem{tex:yannis94}
Yannis Haralambous.
\newblock Parametrization of {P}ostscript {F}onts through \MF{}---an
  {A}lternative to {A}dobe {M}ultiple {M}aster {F}onts.
\newblock {\em Electronic Publishing}, 6(3):145--157, April 1994.

\bibitem{tex:yannis95}
Yannis Haralambous and Sebastian Rahtz.
\newblock {\LaTeX{}, Hypertext and PDF, or the Entry of \TeX{} into the World
  of Hypertext}.
\newblock {\em TUGboat}, 16(2):\hbox{162--173}, June 1995.

\bibitem{tex:yandy:96}
Berthold K.~P. Horn.
\newblock Acrobat pdf from \smash{\TeX}.
\newblock \URL|http://www.YandY.com/pdf_from.pdf|, 1996.

\bibitem{tex:Knuth:TB11-1-13-23}
Donald Knuth.
\newblock {Virtual Fonts: More Fun for Grand Wizards}.
\newblock {\em TUGboat}, 11(1):\hbox{13--23}, April 1990.

\bibitem{tex:Knuth:ct-a}
Donald~E. Knuth.
\newblock {\em The \smash{\TeX}book}, volume~A of {\em Computers and
  Typesetting}.
\newblock Ad{\-d}i{\-s}on-Wes{\-l}ey, Reading, MA, USA, {\noopsort{1986a}}1986.

\bibitem{tex:knuth86:ct-b}
Donald~E. Knuth.
\newblock {\em {\TeX}: The Program}, volume~B of {\em Computers and
  Typesetting}.
\newblock Ad{\-d}i{\-s}on-Wes{\-l}ey, Reading, MA, USA, {\noopsort{1986b}}1986.

\bibitem{tex:knuth89}
Donald~E. Knuth.
\newblock {The {E}rrors of \smash{\TeX}}.
\newblock {\em Software--Practice and Experience}, 19(7):607--685, 1989.

\bibitem{tex:knuth81a}
Donald~E. Knuth and Michael~F. Plass.
\newblock Breaking paragraphs into lines.
\newblock {\em Software--Practice and Experience}, 11:1119--1184, 1981.

\bibitem{tex:rahtz95}
Sebastian P.~Q. Rahtz.
\newblock {Another Look at \LaTeX\ to SGML Conversion}.
\newblock {\em TUGboat}, 16(3):\hbox{162--173}, September 1995.

\bibitem{tex:raman92}
T.~V. Raman.
\newblock {An Audio View of \TeX{} Documents}.
\newblock {\em TUGboat}, 13(3):\hbox{372--379}, October 1992.

\bibitem{tex:rokicki95TB16-4}
Tomas~G. Rokicki.
\newblock {{A proposed standard for specials}}.
\newblock {\em TUGboat}, 16(4):\hbox{395--401}, December 1995.

\bibitem{tex:smith95}
Philip~N. Smith.
\newblock {Block\discretionary{-}{-}{-}Base Formatting with Encapsulated PDF}.
\newblock Technical Report NOTTCS-TR-95-1, {Department of Computer Science,
  University of Nottingham}, January 1995.
\newblock \URL|http://www.ep.cs.nott.ac.uk/~pns/pdfcorner/complete.pdf|.

\bibitem{tex:sofka96}
Mike Sofka.
\newblock Dvi driver implementation and standardization issues.
\newblock available as \URL|http://www.rpi.edu/~sofkam/DVI/dvi.html|,
  1996\unskip--.

\bibitem{tex:thanh96eng}
Han~The Thanh.
\newblock Portable document format and typesetting system \smash{\TeX} (in
  Czech).
\newblock Master's thesis, Masaryk University, Brno, April 1996.

\bibitem{tex:whitehouse:96}
Kendall Whitehouse.
\newblock Creating quality Adobe pdf files from \smash{\TeX} with \textsf{dvips}.
\newblock
  \URL|http://www.adobe.com/supportservice/custsupport/SOLUTIONS/3a26.htm|,
  1996.

\end{thebibliography}

\end{Article}