summaryrefslogtreecommitdiff
path: root/support/txt/txt.sty
blob: a640808cecff22c83ca26ea1aae8b32f6288a48d (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
% 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