summaryrefslogtreecommitdiff
path: root/info/digests/texline/no12/hubert.tex
blob: 639b734f325efd02f453b0d419a08e92e24a7cfd (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
\title{Layout design with \LaTeXbf\ is possible}
Contrary to a widespread belief, \LaTeX\ does not force you to use one of
the four sample layouts provided by Leslie Lamport.
Rather, you can define and use any reasonable layout,
and doing so within the framework of \LaTeX\ is in fact
less difficult than with plain \TeX.
 
How does this work?
Who is who in \LaTeX's high society?
\bi
The author specifies the contents in the {\tt tex}-file.
\bi
The layout designer specifies the layout in the {\tt sty}-files.
\bi
\LaTeX\ typesets the contents,
using the layout that results from the style files
specified in the |\documentstyle| command.
 
\noindent How can you implement and use a new layout?
I recommend  these four steps:
 
\item{1}
find an original \LaTeX\ style file that produces a similar layout,
 
\item{2}
find the definitions of the features that have to be changed,
 
\item{3}
write a style option file that contains the modified versions of these
definitions,
 
\item{4}
add the name of this file
as an option into the |\documentstyle| command.
 

 \noindent
Where do you find the original layout definitions
and an explanation how to modify them?
This information is distributed over four sources:

 
\item{1} Leslie Lamport's \LaTeX\ manual,
 
\item{2} the files {\tt article.doc}, {\tt art10.doc} etc.,
 
\item{3} the file {\tt latex.tex},
 
\item{4} Donald Knuth's \TeX book.
 
For the fun of it, just try the following two examples:
 
The first one deals with section headings.
In file {\tt art10.doc}, you will find definitions like
\begintt
\def\section{\@startsection
   {section}{1}{\z@}%1,2,3
   {-3.5ex plus -1ex minus -.2ex}%4
   {2.3ex plus .2ex}%5
   {\Large\bf}}%6
\endtt
The absolute values of the fourth and fifth parameters
specify the spacing before and after the heading,
and the sixth parameter specifies its style.
Therefore, if you want smaller vertical skips and a smaller typesize,
you put the following definitions into your private style option file:
\begintt
\def\section{\@startsection
   {section}{1}{\z@}%1,2,3
   {-1.75ex plus -0.5ex minus -.1ex}%4
   {1.15ex plus .1ex}%5
   {\large\bf}}%6
\endtt
for sections, and similar ones for subsections etc.
 
The second example deals with running headers and footers,
which are defined within \LaTeX's pagestyles.
In file {\tt article.doc}, you will find the following definition for
the {\tt myheadings} pagestyle:
\begintt
\def\ps@myheadings{%
   \let\@mkboth\@gobbletwo
   \def\@oddhead{%
      \hbox{}\sl\rightmark\hfil
      \rm\thepage}%
   \def\@oddfoot{}%
   \def\@evenhead{%
      \rm \thepage \hfil
      \sl\leftmark\hbox {}}%
   \def\@evenfoot{}%
   \def\sectionmark##1{}
   \def\subsectionmark##1{}}
\endtt
If you want running footlines with a horizontal rule, you define
\begintt
\def\ps@myfootings{%
   \let\@mkboth\@gobbletwo
   \def\@oddfoot{\parbox{\textwidth}%
      {\rule{\textwidth}{0.4pt}\\[2pt]
      \mbox{}\small\sl\rightmark \hfill
      \small\sl Page~\thepage}}%
   \def\@oddhead{}%
   \def\@evenfoot{\parbox{\textwidth}%
      {\rule{\textwidth}{0.4pt}\\[2pt]
      \small\sl Page~\thepage \hfill
      \leftmark \mbox{}}}%
   \def\@evenhead{}%
   \def\sectionmark##1{}
   \def\subsectionmark##1{}}
\endtt
You put this definition into a file {\tt myfoot.sty}
and then use it with
\begintt
\documentstyle[11pt,myfoot]{article}
\pagestyle{myfootings}
\markboth{News of \today}{News of \today}
\endtt
 
Other layout features can be changed in similar ways;
there is nothing to stop you from
creating masterpieces of layout design with \LaTeX!
 
\author{Hubert Partl}
\endinput
--------------------------- cut here ------------------------------------