Refman Format Technical Reference Manuals
Refman Format Technical Reference Manuals
Abstract
Contents
1 Introduction 3
1.1 Author, Layout Designer and Compositor . . . . . . . . . 3
1.2 Changing the Layout . . . . . . . . . . . . . . . . . . . . . 3
I Mathematics 11
4 Complex Analysis 11
4.1 Complex Numbers . . . . . . . . . . . . . . . . . . . . . . 11
4.2 Analytic Functions . . . . . . . . . . . . . . . . . . . . . . 12
If you want to use a layout different from the ones distributed with LATEX,
you have to take the following steps:
There are almost no common rules because every kind of document has
different requirements and needs a specific layout. This layout should
Line spacing : The spacing between two lines should be larger than the spacing
between two words to guide the eyes of the reader.
Line length : The length of a line – or when using multicolumn layout of a column
– should be about 60 characters. When lines get longer they are
more difficult to read and it is easier to go to the wrong line after
finishing the current one. Increasing the linespacing may help a
little. When lines get to short it is difficult to set them justified,
and you will get lots of hyphenated words.
Page layout : Normal text pages should look the same throughout the document.
Figures, tables and special pages like the index need not appear in
the same layout but should take as much space as needed.
Margin notes : Margin notes are often more suitable than footnotes because they
appear right next to the text they refer to. Special margin notes
are the “attention sign” or the “dangerous bend” that guide the
user to important parts of the text.
Headings and Footings : Headings and footings should make it easier for the reader to orient
himself in the document. If you expect readers to copy single pages
from the document they should contain information about the pa-
per as a whole, just in case you need more information or want to
cite the whole paper.
If you expect the document to change often (like software manuals),
each page should contain a version information or at least a date.
Let us compare three different layouts and check if they are usable for
technical descriptions, user’s guides and reference manuals. 3
Plain TEX : The standard format use by plain TEX has the great disadvantage
that the lines are much to long, which reduces the readability.
Standard-LATEX : The format used by LATEXs standard classes isn’t ideal. The line
length is correct, but that leaves us with a wide unused margin.
The font used for section headings is too large. The Koma-Script
classes improve this and offer many ways to configure the fonts.
1 Compare the layout of different daily papers or magazines like “page” or “invers”.
2 This is not always true for adverts that usually contain no information at all and,
picture magazines where the beauty of the picture is the contents.
3 This hint came from Paul Stiff, who teaches layout design at the University of
Reading.
Advantages: The big advantage of LATEX is, that it implements a “generic” or “logical”
design. This means that the author has to specify the meaning of special
parts of the text like: headings, citations, lists, literature references, and
so on. These logical definitions will be processed by the system and
printed in the “correct” way. The meaning of correct is defined in the
document class and additional packages.
The opposite of this is the “visual” design that most text processors use.
Here the author has to know the correct way to set certain parts of the
text and take care of the correct printing.
The logical design makes it easier for the author to write consistent docu-
ments (i. e., same font and fontsize for section headings of the same level,
same layout for lists and enumerations, . . . ).
Disadvantages: The main disadvantage of LATEX is that the author has only limited means
to change the layout and that she has only four classes to choose from.
This has changed a great deal with the appearance of the Script classes
for LATEX 2.09 in 1992, which in turn have been replaced by the even
more improved Koma-Script classes for LATEX 2ε .
Another disadvantage is that LATEX seems to be tied to the “Computer
modern” font family. This is simply not true, at least not when you have
a PostScript printer. Setting up different fonts isn’t an easy task, but
once they are installed they are as easy to use as the standard fonts.
But LATEX is much more powerful and flexible: you can define an arbitrary
design by changing the definitions in the class files or overwrite them by
packages. This is easier than you may think and happens more often
than you think. Many universities and publishers have their own LATEX
class but do not distribute it to the world.5
4 The “PostScript Reference Manual” is one document that uses such a design.
5 You can find a generic elsevier.cls on CTAN which you can use to prepare arti-
Which class and packages files a document will use is defined at the
beginning of the input file. The \documentclass command selects the
class and the \usepackage command specifies additional packages.
To generate a paper you need at least two files, the input file and a class
file.
These two files represent the work of the author and designer as explained
in the introduction. Even if the author and the designer are the same
person, this has some advantages:
cle before submission. This will be replaced by the magazine-specific class at the
publisher.
Please note that you are not allowed to change the standard classes dis-
tributed with LATEX. You have to change the name when you want to
make changes. That is another reason to put small changes in packages.
3.4.1 Defining the differences between the desired and the available layout
The first step is to define the difference between the layout you have and
the layout you want.
The next step is to find out where the original layout is defined. It is
best to search the files in the following order:6
The files are usually documented quite well so you should be able to
change things even if you don’t understand everything.
This file will only contain the definitions you want to change or the new
commands you want to define.
Defining new commands is easier when you find similar commands in the
original files which you can change.
It is always a good idea to include the reason you wrote the package, the
changes it makes and the new commands it defines in the file. You should
include the date of the last change and the LATEX version it works with,
just in case some internal LATEX commands you use will change.
To use the new package, you call it with the \usepackage command.
This command executes the code of your package and changes the layout
as desired.
Example:
\documentclass[11pt,twoside,a4paper]{article}
\usepackage{mysty} %<- This calls the package "mysty"
You shouldn’t need to change anything else in your input file, unless you
defined new commands or environments that are not available in standard
LATEX.
! → When you copy your input file to a different computer you have to include
your new packages as well. Otherwise the document can’t be processed.
Let’s assume that you want to write an article where the equations are
numbered separately in every section. In the LATEX manual you find a
notice that the report class does something similar for every chapter.
Looking into the file report.cls you will find the following commands
that deal with equation numbers:
\@addtoreset{equation}{chapter}
\def\theequation{\thechapter .\arabic{equation}}
% or in LaTeX2e since 1995/06/01:
\renewcommand\theequation{
\thechapter.\@arabic\c@equation
}
You don’t necessarily need to understand these two commands in detail.
Now you create an new file with the name eqpersec.sty7 and copy the
commands above into that file. After that you replace every occurrence
of chapter with section and add some comments.
% This is equation_per_section.sty
% Short name: eqpersec.sty
% Original file by Hubert Partl 1988
% Modified by Axel Kielhorn 1996/01/01
% to support LaTeX 1995/06/01 and later
%
% reset the equation counter at the start
% of a new section
%
\@addtoreset{equation}{section}
% Equationnumber = sectionnummer.equationnummer
% Use only one of the below
% depending on you LaTeX version
%
%\def\theequation{\thesection .\arabic{equation}}
% or in more recent versions of LaTeX
\renewcommand\theequation{
7 Depending on the computer you are using the name may be different like
EQPERSEC STY on a CYBER running NOS/VE. But note that you must not use
spaces in the filename.
To define the new layout we use the commands described in the LATEX
manual. For full details see the file refman.dtx.
Horizontal: First we define two new names for length that we will use often:
\fullwidth is the width of the whole page minus a margin of 1 inch on
every side.
fullwidth = paperwidth − 2 inch
From this the width of the text is calculated.
\leftmarginwidth is the width of the left margin that will be used for
headings and margin notes.
The headings have to be modified to make them extend into the left
margin.
In file classes.dtx we find the \@startsection command that defines
the layout of the headings. Only parameters 4 to 6 are relevant for us:
parameter 4 is the space above and parameter 5 the space below the
section. The 6th parameter does the actual formatting.
This is the original definition:
\newcommand\secshape{%
\leftskip=-\leftmarginwidth%
\rightskip=\@flushglue%
\hyphenpenalty=2000}
The margin notes should always appear on the left side of the text. The
normal layout puts them into the outer margin in twoside layout.
The file latex.dtx contains the definition of the \@addmarginpar com-
mand which is responsible for the margin notes. We don’t have to un-
derstand the whole definition; the important part is the internal variable
\@tempcnta that is either \@ne (1) when the note should appear on the
right side of the text or \m@ne (−1) when it should appear on the left
side.
This is done by the following lines:
\@tempcnta\@ne
\if@twocolumn
\if@firstcolumn \@tempcnta\m@ne \fi
\else
\if@mparswitch
\ifodd\c@page \else\@tempcnta\m@ne \fi
\fi
\if@reversemargin \@tempcnta -\@tempcnta \fi
\fi
which we simply replace by:
\@tempcnta\m@ne
The remaining lines that handle the setting of the margin note depending
on the parameter \@tempcnta are left unchanged.
The definitions described above are sufficient for simple applications but
→ Appendix ?? in practical use one may want some additional commands. You will find
the description for the whole new class in the appendix ??.
I. Mathematics
4 Complex Analysis
4.1 Complex Numbers
4.1.1 Introduction
Def. Complex Number A complex number is any number of the form z = a + ib where a and b
are real numbers and i is the imaginary unit. The real number a is called
the real part of z, and the real number b is called the imaginary part of
the complex number z.
Complex numbers z1 = a1 + ib1 and z2 = a2 + ib2 are equal iff a1 = a2
and b1 = b2 .
Complex numbers satisfy all of the axioms of a number field.
Def. Conjugate The complex conjugate of z = a + ib is z ∗ = a − ib. The following
Theo. For algebraic operations including addition, multiplication, division and
exponentiation, consider a sequence of algebraic operations over the n
complex numbers z1 , . . . , zn with the result w. If the same actions are
applied in the same order to z1∗ , . . . , zn∗ , then the result will be w∗ . For
example z1∗ z2∗ = (z1 z2 )∗
The roots of a polynomial with real-valued coefficients of arbitrary order
occur in complex conjugate pairs.
Def. Modulus The modulus of a complex number z = x + iy is the real number
√ p
|z| = zz ∗ = x2 + y 2
z = r(cos θ + i sin θ)
11
4.2 Analytic Functions
12
Index
author, 3
design, generic, 5
design, logical, 5
design, visual, 5
designer, 3
footings, 4
headings, 4
layout design, 3
line length, 4
line spacing, 4
manual, 4
margin notes, 4
Modulus, 11
page layout, 4
Polar form, 11
rules, 3
rules of thumb, 4
telephone directory, 4
Triangle inequality, 11
13