diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /support/txt |
Initial commit
Diffstat (limited to 'support/txt')
-rw-r--r-- | support/txt/README | 28 | ||||
-rw-r--r-- | support/txt/doc.tfm | bin | 0 -> 772 bytes | |||
l--------- | support/txt/dvi2tty | 1 | ||||
-rw-r--r-- | support/txt/i-d.sty | 42 | ||||
-rw-r--r-- | support/txt/myparms.sty | 39 | ||||
-rw-r--r-- | support/txt/rfc.sty | 55 | ||||
-rw-r--r-- | support/txt/rfc.tex | 46 | ||||
-rw-r--r-- | support/txt/txt-old.sty | 156 | ||||
-rw-r--r-- | support/txt/txt.aux | 10 | ||||
-rw-r--r-- | support/txt/txt.dvi | bin | 0 -> 6388 bytes | |||
-rw-r--r-- | support/txt/txt.log | 31 | ||||
-rw-r--r-- | support/txt/txt.sty | 165 | ||||
-rw-r--r-- | support/txt/txt.tex | 126 |
13 files changed, 699 insertions, 0 deletions
diff --git a/support/txt/README b/support/txt/README new file mode 100644 index 0000000000..d17bfeb5b0 --- /dev/null +++ b/support/txt/README @@ -0,0 +1,28 @@ +To install: + +1) Copy the desired .sty files to your favoriate LaTeX library (e.g., +/usr/lib/tex/inputs). + + txt.sty - Generates fixed-width font output from LaTeX input. + Does flush-right output if doc.tfm is installed. + + txt-old.sty - Older version of txt.sty that generates ragged-right + output, but does not require doc.tfm + + txt.tex - "Documentation" for the above. + + rfc.sty - .sty for Internet RFCs. + + i-d.sty - .sty for Internet Drafts. + + rfc.tex - "Documentation" for the above. + +2) Copy the doc.tfm file to your favorite LaTeX font directory (e.g., +/usr/lib/tex/fonts). + +3) Make and install the new version of dvi2tty: + + cd dvi2tty + make + cp dvi2tty <your favorite binary directory> + diff --git a/support/txt/doc.tfm b/support/txt/doc.tfm Binary files differnew file mode 100644 index 0000000000..7194376d7e --- /dev/null +++ b/support/txt/doc.tfm diff --git a/support/txt/dvi2tty b/support/txt/dvi2tty new file mode 120000 index 0000000000..a8f44b9f06 --- /dev/null +++ b/support/txt/dvi2tty @@ -0,0 +1 @@ +../../dviware/dvi2tty
\ No newline at end of file diff --git a/support/txt/i-d.sty b/support/txt/i-d.sty new file mode 100644 index 0000000000..1eed2d9660 --- /dev/null +++ b/support/txt/i-d.sty @@ -0,0 +1,42 @@ +\def\pubdate#1{\gdef\@pubdate{#1}} +\def\address#1{\gdef\@address{#1}} +\def\maketitle{\par + \begingroup + \newpage \global\@topnum\z@ + \@maketitle + \@makeheadings + \endgroup + \setcounter{footnote}{0} + \let\maketitle\relax + \let\@maketitle\relax +} +\def\@maketitle{\newpage + \null + \begin{tabular*}{\textwidth}{@{\hspace{0in}} l @{\extracolsep{\fill}} r @{\hspace{0in}}} + Internet Engineering Task Force & \@author \\ + INTERNET-DRAFT & \@address \\ + & \@pubdate + \end{tabular*} + \begin{center} + \large\bf\@title + \end{center} +\def\@makeheadings{ + \null + % Generate RFC page headings + \gdef\@oddhead {\rm INTERNET-DRAFT \hfil \@title \hfil \@pubdate} + \gdef\@evenhead{\rm INTERNET-DRAFT \hfil \@title \hfil \@pubdate} + \gdef\@oddfoot {\rm \@author\hfil [Page \thepage ]} + \gdef\@evenfoot{\rm \@author\hfil [Page \thepage ]} + } +} + +\evensidemargin 0in +\oddsidemargin 0in +\topmargin 0pt +\textwidth 6.5in +\textheight 8.5in + +\parindent 0in +\parskip 12pt + +\thispagestyle{empty} diff --git a/support/txt/myparms.sty b/support/txt/myparms.sty new file mode 100644 index 0000000000..aa506a88d4 --- /dev/null +++ b/support/txt/myparms.sty @@ -0,0 +1,39 @@ +\def\section{\@startsection {section}{1}{\z@}{-3.5ex plus -1ex minus + -.2ex}{2.3ex plus .2ex}{\normalsize\bf}} +\def\subsection{\@startsection{subsection}{2}{\z@}{-3.25ex plus -1ex minus + -.2ex}{1.5ex plus .2ex}{\normalsize\bf}} + +% Make ``smallverbatim'' environment +\begingroup \catcode `|=0 \catcode `[= 1 +\catcode`]=2 \catcode `\{=12 \catcode `\}=12 +\catcode`\\=12 |gdef|@xsmallverbatim#1\end{smallverbatim}[#1|end[smallverbatim]] +|gdef|@sxsmallverbatim#1\end{smallverbatim*}[#1|end[smallverbatim*]] +|endgroup + +\def\@ssmallverbatim{\obeyspaces\@smallverbatim} + +\def\@gobble#1{} + +\def\@smallverbatim{\trivlist \item[]\if@minipage\else\vskip\parskip\fi +\leftskip\@totalleftmargin\rightskip\z@ +\parindent\z@\parfillskip\@flushglue\parskip\z@ +\@tempswafalse \def\par{\if@tempswa\hbox{}\fi\@tempswatrue\@@par} +\obeylines \small\tt \catcode``=13 \@noligs \let\do\@makeother \dospecials} + +\def\smallverbatim{\@smallverbatim \frenchspacing\@vobeyspaces \@xsmallverbatim} +\let\endsmallverbatim=\endtrivlist + +\evensidemargin 0in +\oddsidemargin 0in +\topmargin 0pt +\textwidth 6.5in +\textheight 8.5in + +\parindent 0in +\parskip 12pt + +\newcommand{\unix}{{\sc Unix}} +\newcommand{\tildechar}{\raisebox{-3pt}{\bf\char'176}} +\newcommand{\msdos}{MS--DOS} + +\special{header=/home/sol/CSFAC/droms/lib/makefonts.ps}
\ No newline at end of file diff --git a/support/txt/rfc.sty b/support/txt/rfc.sty new file mode 100644 index 0000000000..469a21439c --- /dev/null +++ b/support/txt/rfc.sty @@ -0,0 +1,55 @@ +\def\rfc{\gdef\@pubtype{RFC} + \gdef\@pubhdr{Request for Comments:} + \gdef\@pubgroup{Network Working Group}} +\def\i-d{\gdef\@pubtype{INTERNET-DRAFT} + \gdef\@pubhdr{INTERNET-DRAFT} + \gdef\@pubgroup{Internet Engineering Task Force}} + +\def\@rfcnum{} +\def\rfcnum#1{\gdef\@rfcnum{#1}} + +\def\pubdate#1{\gdef\@pubdate{#1}} + +\def\address#1{\gdef\@address{#1}} + +\def\maketitle{\par + \begingroup + \newpage \global\@topnum\z@ + \@maketitle + \@makeheadings + \endgroup + \setcounter{footnote}{0} + \let\maketitle\relax + \let\@maketitle\relax +} +\def\@maketitle{\newpage + \null + \begin{tabular*}{\textwidth} + {@{\extracolsep{0pt}} l @{\extracolsep{\fill}} r @{\extracolsep{0pt}}} + \@pubgroup & \@author \\ + \@pubhdr\ \@rfcnum & \@address \\ + & \@pubdate + \end{tabular*} + \begin{center} + \large\bf\@title + \end{center} +\def\@makeheadings{ + \null + % Generate RFC page headings + \gdef\@oddhead {\rm \@pubtype\ \@rfcnum \hfil \@title \hfil \@pubdate} + \gdef\@evenhead{\rm \@pubtype\ \@rfcnum \hfil \@title \hfil \@pubdate} + \gdef\@oddfoot {\rm \@author\hfil [Page \thepage ]} + \gdef\@evenfoot{\rm \@author\hfil [Page \thepage ]} + } +} + +\evensidemargin 0in +\oddsidemargin 0in +\topmargin 0pt +\textwidth 6in +\textheight 8.5in + +\parindent 0in +\parskip 12pt + +\thispagestyle{empty} diff --git a/support/txt/rfc.tex b/support/txt/rfc.tex new file mode 100644 index 0000000000..cf080daa94 --- /dev/null +++ b/support/txt/rfc.tex @@ -0,0 +1,46 @@ +\documentstyle[12pt,myparms]{article} + +\title{The {\tt rfc} Style} +\author{Ralph Droms \\ Bucknell Univerity} +\begin{document} +\bibliographystyle{/home/sol/CSFAC/droms/lib/plain} +\maketitle + +The {\tt rfc} style is a modification of the \LaTeX\ {\tt article} +style that produces documents in the format of Internet RFCs. It +includes several new commands that define fields required for RFC +headers, and then generates a document header and page headers and +footers that follow the RFC format. + +The {\tt rfc} commands are: +\begin{description} +\item[{\tt \\rfcnum\{ \}} :] specifies the number of this RFC. the word +``DRAFT'' can be substituted for draft RFCs. +\item[{\tt \\pubdate\{ \}} :] defines the publication date to be printed in +the RFC headers. +\item[{\tt \\title\{ \}} :] specifies the title of the RFC. +\item[{\tt \\author\{ \}} :] gives the RFC author. +\item[{\tt \\address\{ \}} :] gives the author's address. +\item[{\tt \\maketitle} :] generates the RFC header on the first page. +\end{description} +\newpage +Using {\tt rfc} requires simply that {\tt rfc} be specified in the +list of {\tt .sty} files, and that the commands in the list above all +be filled in. For example, the following is extracted from a draft +RFC: + +\begin{verbatim} + \documentstyle[12pt,rfc]{article} + + \author{R. Droms} + \rfcnum{DRAFT} + \address{NRI} + \pubdate{November, 1989} + \title{Dynamic Host Configuration} + + \begin{document} + + \maketitle + +\end{verbatim} +\end{document}
\ No newline at end of file diff --git a/support/txt/txt-old.sty b/support/txt/txt-old.sty new file mode 100644 index 0000000000..ec78c3cd62 --- /dev/null +++ b/support/txt/txt-old.sty @@ -0,0 +1,156 @@ + +% RFC.sty fixed up for RFC format + +% Fix section headings to be less garish +\def\section{\@startsection {section}{1}{\z@}{\baselineskip} +{0.00001in}{\normalsize\bf}} +\def\subsection{\@startsection{subsection}{2}{\z@}{12pt} +{0.00001in}{\normalsize\bf}} + +% Make dvi2tty-compatible footnote marks +\def\@makefnmark{(\@thefnmark)} +\long\def\@makefntext#1{\parindent 1em\noindent + \hbox to 1.8em{\hss(\@thefnmark)}#1} +\alph{footnote} + +\def\@array[#1]#2{ + \setbox\@arstrutbox=\hbox{\vrule height12pt depth0pt width\z@} + \@mkpream{#2} + \edef\@preamble{\halign \noexpand\@halignto + \bgroup \tabskip\z@ \@arstrut \@preamble \tabskip\z@ \cr}% + \let\@startpbox\@@startpbox + \let\@endpbox\@@endpbox + \vbox +% \if #1t\vtop \else \if#1b\vbox \else \vcenter \fi\fi + \bgroup \let\par\relax + \let\@sharp##\let\protect\relax + \lineskip\z@ + \baselineskip\z@ + \@preamble +} + + +% Fix itemize and enumerate environments for dvi2tty - cut down +% inter-item spacing +\def\itemize{\ifnum \@itemdepth >3 \@toodeep\else + \advance\@itemdepth \@ne + \edef\@itemitem{labelitem\romannumeral\the\@itemdepth} + \list{\csname\@itemitem\endcsname} + {\def\makelabel##1{\hss\llap{##1}} + \setlength{\topsep}{0in} + \setlength{\itemsep}{0in} + \setlength{\parsep}{12pt}}\fi} + +\def\enumerate{\ifnum \@enumdepth >3 \@toodeep\else + \advance\@enumdepth \@ne + \edef\@enumctr{enum\romannumeral\the\@enumdepth} + \list{\csname label\@enumctr\endcsname} + {\usecounter{\@enumctr} + \def\makelabel##1{\hss\llap{##1}} + \setlength{\topsep}{0in} + \setlength{\itemsep}{0in} + \setlength{\parsep}{12pt}}\fi} + +\def\trivlist{\parsep\parskip + \setlength{\topsep}{0in} + \setlength{\itemsep}{0in} + \@trivlist \labelwidth\z@ \leftmargin\z@ + \itemindent\z@ \def\makelabel##1{##1}} + +\def\@normalsize{\@setsize\normalsize{12pt}\xiipt\@xiipt +\abovedisplayskip 12pt \belowdisplayskip \abovedisplayskip +\abovedisplayshortskip 0in \belowdisplayshortskip 12pt +\let\@listi\@listI} + +% Fix up dotted table of contents lines... +\def\@dottedtocline#1#2#3#4#5{\ifnum #1>\c@tocdepth \else + \vskip \z@ plus .2pt + {\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip + \parindent #2\relax\@afterindenttrue + \interlinepenalty\@M + \leavevmode + \@tempdima #3\relax \advance\leftskip \@tempdima \hbox{}\hskip -\leftskip + #4\nobreak\leaders\hbox{ . } + \hfill \nobreak \hbox to\@pnumwidth{\hfil\rm #5}\par}\fi} + +\headsep 24pt +\headheight 12pt +\topskip 12pt +\topmargin 24pt + +\footskip 24pt + +\def\numcol#1{ + \textwidth #1sp + \multiply \textwidth by 404685 + \oddsidemargin 75sp + \multiply \oddsidemargin by 404685 + \advance \oddsidemargin by -\textwidth + \divide \oddsidemargin by 2 + \evensidemargin \oddsidemargin +} +\def\numrow#1{ + \textheight #1sp + \multiply \textheight by 786432 +} +\floatsep 12pt +\textfloatsep 12pt +\intextsep 12pt +\partopsep 12pt + +\parskip 12pt +\skip\footins= 12pt +\footnotesep 12pt + +\labelsep 404685sp +\leftmargini 4sp \multiply \leftmargini by 404685 +\leftmarginii 3sp \multiply \leftmarginii by 404685 +\leftmarginiii 3sp \multiply \leftmarginiii by 404685 +\leftmarginiv 3sp \multiply \leftmarginiv by 404685 +\leftmarginv 3sp \multiply \leftmarginv by 404685 +\labelwidth\leftmargini\advance\labelwidth-\labelsep +\def\@listI{\leftmargin\leftmargini \parsep 4pt plus 2pt minus 1pt\topsep 8pt +plus 2pt minus 4pt\itemsep 4pt plus 2pt minus 1pt} +\let\@listi\@listI +\@listi +\def\@listii{\leftmargin\leftmarginii + \labelwidth\leftmarginii\advance\labelwidth-\labelsep + \topsep 0pt + \parsep 0pt + \itemsep 12pt} +\def\@listiii{\leftmargin\leftmarginiii + \labelwidth\leftmarginiii\advance\labelwidth-\labelsep + \topsep 0pt + \parsep 0pt + \itemsep 12pt} +\def\@listiv{\leftmargin\leftmarginiv + \labelwidth\leftmarginiv\advance\labelwidth-\labelsep} +\def\@listv{\leftmargin\leftmarginv + \labelwidth\leftmarginv\advance\labelwidth-\labelsep} +\def\@listvi{\leftmargin\leftmarginvi + \labelwidth\leftmarginvi\advance\labelwidth-\labelsep} + +% redefine all font sizes to be \normalsize +\def\tiny{\normalsize} +\def\scriptsize{\normalsize} +\def\footnotesize{\normalsize} +\def\small{\normalsize} +\def\large{\normalsize} +\def\Large{\normalsize} +\def\LARGE{\normalsize} +\def\huge{\normalsize} +\def\Huge{\normalsize} + +% redefine all font types to be \tt +\def\em{\tt} +\def\bf{\tt} +\def\it{\tt} +\def\sl{\tt} +\def\sf{\tt} +\def\sc{\tt} +\def\rm{\tt} + +% now typeset document using \tt and \raggedright +\tt +\raggedright +% \raggedbottom diff --git a/support/txt/txt.aux b/support/txt/txt.aux new file mode 100644 index 0000000000..7b8a9bb709 --- /dev/null +++ b/support/txt/txt.aux @@ -0,0 +1,10 @@ +\relax +\bibstyle{/home/sol/CSFAC/droms/lib/plain} +\citation{dvi2tty} +\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {1}Introduction}{1}} +\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {2}Theory}{1}} +\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {3}Using {\string\pdoc\space txt}}{2}} +\bibdata{/home/sol/CSFAC/droms/lib/droms} +\bibcite{dvi2tty}{1} +\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {4}Bugs}{3}} +\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {5}Summary}{3}} diff --git a/support/txt/txt.dvi b/support/txt/txt.dvi Binary files differnew file mode 100644 index 0000000000..bb14a47f46 --- /dev/null +++ b/support/txt/txt.dvi diff --git a/support/txt/txt.log b/support/txt/txt.log new file mode 100644 index 0000000000..e4a58c36db --- /dev/null +++ b/support/txt/txt.log @@ -0,0 +1,31 @@ +This is TeX, C Version 3.0 (format=lplain 92.2.19) 30 SEP 1992 11:44 +**&latex txt +(txt.tex +LaTeX Version 2.09 <14 January 1992> +(/usr/lib/tex/inputs/article.sty +Standard Document Style `article' <14 Jan 92>. +(/home/sol/CSFAC/droms/lib/art12.sty) +\c@part=\count79 +\c@section=\count80 +\c@subsection=\count81 +\c@subsubsection=\count82 +\c@paragraph=\count83 +\c@subparagraph=\count84 +\c@figure=\count85 +\c@table=\count86 +) (myparms.sty) (txt.sty +\docfam=\fam11 +) +(/home/sol/CSFAC/droms/lib/txt.aux) [1 + +] [2] (/home/sol/CSFAC/droms/lib/txt.bbl) [3] (txt.aux) ) +Here is how much of TeX's memory you used: + 223 strings out of 6958 + 1957 string characters out of 63166 + 29149 words of memory out of 262141 + 2135 multiletter control sequences out of 9500 + 19165 words of font info for 73 fonts, out of 72000 for 255 + 14 hyphenation exceptions out of 607 + 12i,6n,17p,163b,228s stack positions out of 300i,40n,60p,3000b,4000s + +Output written on txt.dvi (3 pages, 6388 bytes). diff --git a/support/txt/txt.sty b/support/txt/txt.sty new file mode 100644 index 0000000000..a640808cec --- /dev/null +++ b/support/txt/txt.sty @@ -0,0 +1,165 @@ +% dvidoc style file. Fixes things up so your file uses only fixed width +% non-math characters, at least if you don't use math mode +% +% The first section defines all the font change commands to use the +% doc pseudo-font. It is taken from John Pavel's dvidoc.sty, March 1987 +% +\makeatletter +% version from John Pavel's dvidoc.sty, March 1987 +\def\rm{\protect\pdoc} +\def\it{\protect\pdoc} +\def\bf{\protect\pdoc} +\def\sl{\protect\pdoc} +\def\sf{\protect\pdoc} +\def\sc{\protect\pdoc} +\def\tt{\protect\pdoc} +\newfam\docfam +\def\pdoc{\@getfont\pdoc\docfam\@xpt{doc}} +% This gets all normal text, headings, etc. +% Unfortunately it doesn't catch places where more explicit stuff +% is done. The following is brute force but effective. Note that +% we leave the symbol fonts alone, since otherwise we'll get TeX +% errors complaining that it couldn't find symbol fonts +% Possibly we should do this for all of the font types. This caught +% everything in sample.tex. +\font\fivmi = doc +\font\fivrm = doc +\font\fivsy = cmsy10 +\font\sixmi = doc +\font\sixrm = doc +\font\sixsy = cmsy10 +\font\sevmi = doc +\font\sevrm = doc +\font\sevsy = cmsy10 +\font\egtmi = doc +\font\egtrm = doc +\font\egtsy = cmsy10 +\font\ninmi = doc +\font\ninrm = doc +\font\ninsy = cmsy10 +\font\tenmi = doc +\font\tenrm = doc +\font\elvmi = doc +\font\elvrm = doc +\font\elvsy = cmsy10 +\font\twlmi = doc +\font\twlsy = cmsy10 +\font\frtnmi = doc +\font\frtnrm = doc +\font\frtnsy = cmsy10 +\font\svtnmi = doc +\font\svtnrm = doc +\font\svtnsy = cmsy10 +\font\twtymi = doc +\font\twtyrm = doc +\font\twtysy = cmsy10 +\rm +% +% These dimensional definitions are also taken from Langdon, though with +% some changes, e.g. not ragged right/bottom and parind 3 instead of 5. +% horizontal dimensions had best be multiples of \em +\hsize 78 em % 78 characters per line so fit any screen +% \rightskip=0pt plus 4em % ragged right +% \spaceskip=1em % forces ONE space between words +% \frenchspacing suppresses extra blanks after punctuation -don't +% \parindent=3em +\def\enspace{\kern 1em} \def\enskip{\hskip 1em\relax} +% +% vertical skips may best be multiples of \baselineskip +\baselineskip=12pt % 6 lines per inch +% \vsize % default give 58 lines -OK +\voffset=\baselineskip % so don't lose \headline +% \parskip=0pt +\smallskipamount=0pt +\medskipamount= \baselineskip +\bigskipamount=2\baselineskip +% \raggedbottom +% +% By default itemize is done with bullets, which we don't have. use hyphen +% now fix up various latexish stuff +% +% \def\labelitemi{ -} +% \def\labelitemii{ -} +% \def\labelitemiii{ -} +% \def\labelitemiv{ -} +% +% Fix up table of contents. Default latex uses fractional spacing between +% the section number and title. This comes out as no space in the doc file +% so we add a space to numberline, and expand tempdima by one em to allow +% for it. Also, go out of math mode for the dot in the leader. Dots in +% math mode turn out to be colons! +% +\def\@dottedtocline#1#2#3#4#5{\ifnum #1>\c@tocdepth \else + \vskip \z@ plus .2pt + {\hangindent #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip + \parindent #2\relax\@afterindenttrue + \interlinepenalty\@M + \leavevmode + \@tempdima #3\relax + \addtolength\@tempdima{1em} + #4\nobreak\leaders\hbox to 2em{\hss.\hss}\hfill \nobreak \hbox to\@pnumwidth{\hfil\rm #5}\par}\fi} +\def\numberline#1{\advance\hangindent\@tempdima \hbox to\@tempdima{#1\hfil}\ } +% +% Can't really do superscripts, so do footnotes with [] +% +\def\@makefnmark{\hbox{(\@thefnmark)}} +\long\def\@makefntext#1{\parindent 1em\noindent + \hbox to 3em{\hss\@thefnmark.}\ #1} +\skip\footins 24pt plus 4pt minus 2pt +\def\footnoterule{\kern-12\p@ +\hbox to .4\columnwidth{\leaders\hbox{-}\hfill}} +% +% \arrayrulewidth 1em \doublerulesep 1em +% +% Some fairly obvious hacks. No odd/even pages in doc files. Can't do the +% fancy TeX symbols. +% +\oddsidemargin 0pt \evensidemargin 0pt +\def\TeX{TeX} +\def\LaTeX{LaTeX} +\def\SliTeX{SliTeX} +\def\BibTeX{BibTeX} +% +% special versions of stuff from xxx10.sty, since only one font size +% +\def\@normalsize{\@setsize\normalsize{12pt}\xpt\@xpt +\abovedisplayskip 12pt +\belowdisplayskip \abovedisplayskip +\abovedisplayshortskip \z@ +\belowdisplayshortskip \z@ +\let\@listi\@listI} % Setting of \@listi added 9 Jun 87 +\let\small\@normalsize +\let\footnotesize\@normalsize +\normalsize +\footnotesep 12pt +\labelsep 10pt +\def\@listI{\leftmargin\leftmargini \parsep 12pt% +\topsep 12pt% +\itemsep 0pt} +\let\@listi\@listI +\let\@listii\@listI +\let\@listiii\@listI +\let\@listiv\@listI +\let\@listv\@listI +\let\@listvi\@listI +\@listI +% +% We had sort of random numbers of blank lines around section numbers. +% Turns out they used various fractional spacing. Rather than depend +% upon the definition of startsection, just wrap something around it +% that normalizes the arguments to 12pt. Negative args have special +% meanings. +\let\@oldstartsec\@startsection +\def\@startsection#1#2#3#4#5#6{ + \@tempskipa #4\relax + \@tempskipb #5\relax + \ifdim \@tempskipa <\z@ \@tempskipa -12pt \else \@tempskipa 12pt \fi + \ifdim \@tempskipb >\z@ \@tempskipb 12pt \fi +\@oldstartsec{#1}{#2}{#3}{\@tempskipa}{\@tempskipb}{#6} +} +% +% Remaining unsolved problem: hrule and vrule are no-ops. This is +% visible mostly in the tabular stuff, where none of the lines show up, +% though it's still basically usable. +% +\makeatother diff --git a/support/txt/txt.tex b/support/txt/txt.tex new file mode 100644 index 0000000000..bf282bd571 --- /dev/null +++ b/support/txt/txt.tex @@ -0,0 +1,126 @@ +\documentstyle[12pt,myparms,txt]{article} + +\title{The {\tt txt} Style} +\author{Ralph Droms \\ Bucknell University} + +\begin{document} +\bibliographystyle{/home/sol/CSFAC/droms/lib/plain} +\maketitle +\section{Introduction} +\TeX\ and \LaTeX\ produce nicely formatted documents; however, the final +versions of these documents, the {\tt .dvi} files, are, in some ways, +not accessible to further electronic processing. For example, +\unix\footnote{\unix\ is a trademark of AT\&T Bell Laboratories.} +tools like {\tt grep} and {\tt emacs} can't be used on {\tt .dvi} +files, and electronic display of {\tt .dvi} files requires a +high-function bit--mapped terminal. + +Some text--processing systems accommodate both high--resolution output +and straight ASCII text output. Microsoft Word\footnote{I assume +Microsoft Word is a trademark of Microsoft, Inc.} can save a document +in either formatted or text--only form. The formatted version can be +printed on an appropriate high--function printer, while the text--only +version is compatible with other tools and text editors. The \unix\ +text processing tools {\tt troff} and {\tt nroff} both accept the same +input files, but {\tt troff} produces high--quality output while {\tt +nroff} produces ASCII text. {\tt troff} and {\tt nroff} are used, for +example, to produde hard--copy and online versions of the \unix\ +user's manual, assuring that both versions have identical content. + +\TeX\ and \LaTeX\ have no equivalent to {\tt troff}'s {\tt nroff}. +The {\tt txt} style is part of a package that can take standard +\LaTeX\ input and produce ASCII text output. This output will not be +identical to the \LaTeX\ {\tt .dvi} file output, but will, instead, be +ASCII text appropriately formatted for an 8.5 by 11 inch page. + +\section{Theory} + +The problem addressed by {\tt txt} is to restrict \LaTeX\ output so +that it simulates a line printer, without rewriting \LaTeX\ itself. An +accompanying program, {\tt dvi2tty}~\cite{dvi2tty}, then produces +ASCII text output from the {\tt txt}--generated {\tt .dvi} file. + +There are three primary areas in which {\tt txt} must modify \LaTeX\ +to produce ASCII output: + +\begin{itemize} +\item Horizontal spacing +\item Vertical spacing +\item Special characters +\end{itemize} + +{\tt txt} makes a first approximation to line--printer output by +substituting the 12--point Courier font for all the standard \LaTeX\ +font styles and sizes. Using 12--point Courier is assumed to be a good +approximation of a standard line printer, both horizontally and +vertically. {\tt txt} explicitly sets the \LaTeX\ +\verb+\baselineskip+ to be 12 points to better approximate a standard +line printer generating 66 lines on an 11.5 inch long page. + +The next problem in approximating line printer output is to replace +all rubber vertical glue with fixed glue. Such rubber glue, included +in commands like \verb+\section+ and the {\tt itemize} environment, is +replaced by fixed glue in multiples of 12 points. Several other fixed +vertical spaces are modified to be even multiples of 12 points, again +to better simulate line printer output. + +There are two types of special characters modified by {\tt txt}: the +\verb+\labelitem+ characters used by the {\tt itemize} environment and +footnote marks. Footnote marks are recoded to use arabic numbers in +parentheses without superscripting (which is typically not feasible on +a line printer or ASCII terminal). The \verb+\labelitem+ characters +are redefined to be ``{\tt o}'', ``{\tt -}'', ``{\tt *}'' and ``{\tt ++}''. + +\section{Using {\tt txt}} + +Generating ASCII output with {\tt txt} requires two steps: first, the +{\tt txt} style must be included in the \verb+\documentstyle+ command, +and then {\tt dvi2tty} must be run on the {\tt .dvi} file to generate +the ASCII output. + +The {\tt txt} style specification should be included after any other +style files, so that previously defined commands and parameters are +correctly redefined by {\tt txt} for ASCII output. For example, the +header to this document is: +\begin{verbatim} + \documentstyle[12pt,txt]{article} +\end{verbatim} + +A sample session to generate a file containing the ASCII version of +this doucment is (where the ``\%'' character is the \unix\ prompt and +should not be typed): +\begin{verbatim} + % latex txt.tex + % dvi2tty txt.dvi > txt.txt +\end{verbatim} + +\section{Bugs} + +Not all vertical rubber glue has been removed: for example, tables, +page headers and page footers do not always appear on even multiples +of 12 point lines. + +Rules aren't correct; specifically, horizontal and vertical lines in +arrays are likely not to work correctly. + +The model used by {\tt dvi2tty} to simulate horizontal spaacing is +prone to error, especially when horizontal spaces or fills are used. + +\section{Summary} + +The {\tt txt} style generates an approximation of line printer output +from \LaTeX\ input, in the way {\tt nroff} generates output from {\tt +troff} input. The approximation assumes an 80 column, 66 line per page +printer. The {\tt .dvi} file generated by {\tt txt} can be run through +{\tt dvi2tty}. The resulting ASCII output is compatible with +ASCII--only display and printing devices, and can be further processed +by tools like {\tt grep} and {\tt emacs}. + +The approximation is imperfect and has several bugs in the spacing of +output. Modifications to both {\tt txt}, especially eliminating +remaining rubber space, and {\tt dvi2tty} are required to generate +better output. + +\bibliography{/home/sol/CSFAC/droms/lib/droms} +\end{document} |