<< . .

. 21
( : 23)



. . >>

with phrases of your choice in the arguments of \reftextvario.
If you want to refer only to a page number using \varioref, you can use the com-
mand
\vpageref{key}

to produce the page number of the object marked with \label{key}. The phrases
used in the various special cases are the same as described above, except that when
the referred object and the reference fall on the same page, either the phrase “on this
page” or “on the current page” is produced. The command used to generate these is
\reftextcurrent whose default de¬nition is
\newcommand{\reftextcurrent}
{on \reftextvario{this}{the current} page}
You can change the phrases “this” and “the current” globally by rede¬ning this com-
mand. You can also make some local changes by using the two optional arguments that
\vpageref allows. Thus you can use the command
\vpageref[same page phrase][other page phrase]{key}

to refer to the page number of the object marked with \label{key}. The same page
phrase will be used if the object and the reference fall on the same page and the phrase
other page phrase will be used, if they fall on different pages. Thus for example, the
command
see the \vpageref[above table][table]{tabxy}
given in this document will produce

see the above table

if the reference occurs on the same page as Table XII.1 and

see the table on page 137

if they fall on different pages.

OUTSIDE”THE PACKAGE XR
POINTING
XII.4.

Sometimes you may want to refer to something in a document other than the one you
are working on. (This happens, for instance if you keep an article as separate ¬les.) The
package xr allows such external references.
If you want to refer to objects in a ¬le named other.tex in your current document,
load the package xr and set the external document as other.tex using the commands
\usepackage{xr} \externaldocument{other}

in the preamble of the current document. Then you can use the \ref and \pageref to
refer to anything that has been marked with the \label command in either the current
document or other.tex. Any number of such external documents can be speci¬ed.
If the same key is used to mark different objects in two such documents, there™ll be a
con¬‚ict. To get over this, you can use the optional argument available in \externaldocument
command. If you say
\externaldocument[a-]{other}

then a reference to \label{key} in other.tex could be made by \ref{a-key}. The pre¬x
need not be a-; it can be any convenient string.
lablst.tex 141
LOST USE
XII.5. THE KEYS?


lablst.tex
LOST USE
XII.5. THE KEYS?

One of the conveniences of using keys for cross references is that you need not keep track
of the actual numbers, but then you™ll have to remember the keys. You can produce the
list of keys used in a document by running LTEX on the ¬le lablst.tex. In our system,
A

we do this by ¬rst typing
latex lablst

LTEX responds as follows:
A

*********************************
* Enter input file name
* without the .tex extension:
*********************************

\lablstfile=

We type in the ¬le name as cref which is the source of this document and is presented
with another query.
**********************************************
* Enter document class used in file cref.tex
* with no options or extension:
**********************************************


\lablstclass=

So we type article. And is asked
********************************************
* Enter packages used in file cref.tex
* with no options or extensions:
********************************************

\lablstpackages=

Here only those packages used in the article which de¬ne commands used in section
titles etc. need be given. So we type
amsmath,array,enumerate

This produces a ¬le lablst.dvi which can be viewed to see a list of keys used in the
document.
Finally if your text editor is GNU Emacs, then you can use its RefTeX package to auto-
mate generation, insertion and location of keys at the editing stage.
142
TUTORIAL XIII


FOOTNOTES, MARGINPARS, AND ENDNOTES


LTEX has facilities to typeset “inserted” text, such as footnotes, marginal notes, ¬gures
A

and tables. This chapter looks more closely at different kinds of notes.

FOOTNOTES
XIII.1.

Footnotes are generated with the command
\footnote{footnote text}

which comes immediately after the word requiring an explanation in a footnote. The
text footnote text appears as a footnote in a smaller typeface at the bottom of the page.
The ¬rst line of the footnote is indented and is given the same footnote marker as that
inserted in the main text. The ¬rst footnote on a page is separated from the rest of the
page text by means of a short horizontal line.
The standard footnote marker is a small, raised number1 , which is sequentially num-
bered.
Footnotes produced with the \footnote command inside a minipage environment
use the mpfootnote counter and are typeset at the bottom of the parbox produced by the
minipage2 .
However, if you use the \footnotemark command in a minipage it will produce a
footnote mark in the same style and sequence as the main text footnotes”i.e., stepping
the mpfootnote counter and using the \thefootnote command for the representation.
This behavior allows you to produce a footnote inside your minipage that is typeset in se-
quence with the main text footnotes at the bottom of the page: you place a \footnotemark
inside the minipage and the corresponding \footnotetext after it. See below:
\begin{minipage}{5cm}
Footnotes in a minipage are numbered
Footnotes in a minipage are num- using lowercase letters.\footnote{%
bered using lowercase letters.a Inside minipage} \par This text
This text references a footnote at references a footnote at the bottom
the bottom of the page.3 of the page.\footnotemark
\end{minipage}
a Inside minipage
\footnotetext{At bottom of page}

The footnote numbering is incremented throughout the document for the article
class, where it is reset to 1 for each new chapter in the report and book classes.
1 See how the footnote is produced: “ ... raised number \footnote{See how the footnote is produced:
}.
...
2 With nested minipages, the footnote comes after the next \endminipage command, which could be at the

wrong place.
3 At bottom of page.



143
144 FOOTNOTES, MARGINPARS, ENDNOTES
XIII. AND


Footnotes in tabular material
XIII.1.1.

Footnotes appearing inside tabular material are not typeset by standard LTEX. Only
A

tabularx and longtable environments will treat footnotes correctly. But footnotes used
in these tables won™t appear just following the tables, but would appear at the bottom
of the page just like the footnotes used in the text. But in longtable you can place the
footnotes as table notes by placing the longtable in a minipage. See below:


Table XIII.1: PostScript type 1 fonts

Couriera cour, courb, courbi, couri
Nimbusb unmr, unmrs
URW Antiquab uaqrrc
URW Groteskb ugqp
Utopiac putb, putbi, putr, putri
a Donated by IBM.
b Donated by URW GmbH.
c Donated by Adobe.




\begin{minipage}{.47\textwidth}
\renewcommand{\thefootnote}{\thempfootnote}
\begin{longtable}{ll}
\caption{PostScript type 1 fonts}\\
Courier\footnote{Donated by IBM.} & cour,courb,courbi,couri \\
Nimbus\footnote{Donated by URW GmbH.} & unmr, unmrs \\
URW Antiqua\footnotemark[\value{mpfootnote}] & uaqrrc\\
URW Grotesk\footnotemark[\value{mpfootnote}] & ugqp\\
Utopia\footnote{Donated by Adobe.} & putb, putbi, putr, putri
\end{longtable}
\end{minipage}



You can also put your tabular or array environment inside a minipage environ-
ment, since in that case footnotes are typeset just following that environment. Note the
rede¬nition of \thefootnote that allows us to make use of the \footnotemark command
inside the minipage environment. Without this rede¬nition \footnotemark would have
generated a footnote mark in the style of the footnotes for the main page.
\begin{minipage}{.5\linewidth}
\renewcommand{\thefootnote}{\thempfootnote}
\begin{tabular}{ll}
\multicolumn{2}{c}{\bfseries PostScript type 1 fonts} \\
Courier\footnote{Donated by IBM.} & cour,courb,courbi,couri \\
Charter\footnote{Donated by Bitstream.} & bchb,bchbi,bchr,bchri\\
Nimbus\footnote{Donated by URW GmbH.} & unmr, unmrs \\
URW Antiqua\footnotemark[\value{mpfootnote}] & uaqrrc\\
URW Grotesk\footnotemark[\value{mpfootnote}] & ugqp\\
Utopia\footnote{Donated by Adobe.} & putb, putbi, putr, putri
\end{tabular}
\end{minipage}
145
FOOTNOTES
XIII.1.




PostScript type 1 fonts
Couriera cour, courb, courbi, couri
b
Charter bchb, bchbi, bchr, bchri
Nimbusc unmr, unmrs
c
URW Antiqua uaqrrc
URW Groteskc ugqp
Utopiad putb, putbi, putr, putri
a Donated by IBM.
b Donated by Bitstream.
c Donated by URW GmbH.
d Donated by Adobe.




Of course this approach does not automatically limit the width of the footnotes to
the width of the table, so a little iteration with the minipage width argument might be
necessary.
Another way to typeset table notes is with the package threeparttable by Donald
Arseneau. This package has the advantage that it indicates unambiguously that you are
dealing with notes inside tables and, moreover, it gives you full control of the actual refer-
ence marks and offers the possibility of having a caption for our tabular material. In this
sense, the threeparttable environment is similar to the non¬‚oating table environment.
\begin{threeparttable}
\caption{\textbf{PostScript type 1 fonts}}
\begin{tabular}{ll}
Courier\tnote{a} & cour, courb, courbi, couri\\
Charter\tnote{b} & bchb, bchbi, bchr, bchri \\
Nimbus\tnote{c} & unmr, unmrs \\
URW Antiqua\tnote{c} & uaqrrc\\
URW Grotesk\tnote{c} & ugqp\\
Utopia\tnote{d} & putb, putbi, putr, putri
\end{tabular}
\begin{tablenotes}
\item[a] Donated by IBM.
\item[b] Donated by Bitstream.
\item[c] Donated by URW GmbH.
\item[d] Donated by Adobe.
\end{tablenotes}
\end{threeparttable}


Table 14.2: PostScript type 1 fonts
Couriera cour, courb, courbi, couri
Charterb bchb, bchbi, bchr, bchri
Nimbusc unmr, unmrs
URW Antiquac uaqrrc
URW Groteskc ugqp
Utopiad putb, putbi, putr, putri
a Donated by IBM.
b Donated by Bitstream.
c Donated by URW GmbH.
d Donated by Adobe.
146 FOOTNOTES, MARGINPARS, ENDNOTES
XIII. AND


Customizing footnotes
XIII.1.2.

If the user wishes the footnote numbering to be reset to 1 for each \section command
with the article class, this may be achieved by putting
\setcounter{footnote}{0}

before every section or using the following command at preamble4
\@addtoreset{footnote}{section}

The internal footnote counter has the name footnote. Each call to \footnote increments
this counter by one and prints the new value in Arabic numbering as the footnote marker.
A different style of marker can be implemented with the command
\renewcommand{\thefootnote}{number style}{footnote}

where number style is one of the counter print commands; \arabic, \roman, \Roman,
\alph, or \Alph. However, for the counter footnote, there is an additional counter print
command available, \fnsymbol, which prints the counter values 1“9 as one of nine sym-
bols:
† ‡ § ¶ †† ‡‡
It is up to the user to see that the footnote counter is reset to zero sometime before
the tenth \footnote call is made. If the user wants to add values above nine, then he
has to edit the de¬nition of \fnsymbol. See an example, which allows up to 12 footnotes
without resetting the counter:
\makeatletter
\def\@fnsymbol#1{\ensuremath{\ifcase#1\or *\or \dagger\or \ddagger\or
\mathsection\or \mathparagraph\or \|\or **\or \dagger\dagger
\or \ddagger\ddagger\or \mathsection\mathsection
\or \mathparagraph\mathparagraph \or \|\|\else\@ctrerr\fi}}
\renewcommand{\thefootnote}{\fnsymbol{footnote}}
\makeatother

An optional argument may be added to the \footnote command:
\footnote[num]{footnote text}

where num is a positive integer that is used instead of the value of the footnote counter
for the marker. In this case, the footnote counter is not incremented. For example—— ,
\renewcommand{\thefootnote}{\fnsymbol{footnote}}
For example\footnote[7]{The 7$ˆ{\rm th}$ symbol .... marker.},
\renewcommand{\thefootnote}{\arabic{footnote}}

where the last line is necessary to restore the footnote marker style to its standard form.
Otherwise, all future footnotes would be marked with symbols and not with numbers.

Footnote style parameters
XIII.1.3.

The appearance of the standard footnote can be changed by customizing the parameters
listed below:

The font size used inside footnotes.
\footnotesize
4 This command will only work within \makeatletter and \makeatother.
—— The 7th symbol appears as the footnote marker.
147
MARGINAL
XIII.2. NOTES


The height of a strut placed at the beginning of every footnote. If it is
\footnotesep
greater than the \baselineskip used for \footnotesize, then additional
vertical space will be inserted above each footnote.
A low-level TEX command that de¬nes the space between the main text
\skip\footins
and the start of the footnotes. You can change its value with the \setlength
or \addtolength commands by putting \skip\footins into the ¬rst argu-
ment, e.g.,
\addtolength{\skip\footins}{3mm}

A macro to draw the rule separating footnotes from the main text. It is
\footnoterule
executed right after the vertical space of \skip\footins. It should take
zero vertical space, i.e., it should use a negative skip to compensate for
any positive space it occupies, for example:
\renewcommand{\footnoterule{\vspace*{-3pt}%
\rule{.4\columnwidth}{0.4pt}\vspace*{2.6pt}

You can also construct a fancier “rule” e.g., one consisting of a series of dots:
\renewcommand{\footnoterule}{\vspace*{-3pt}%
\qquad\dotfill\qquad\vspace*{2.6pt}}


MARGINAL
XIII.2. NOTES

\marginpar{left-text}{right-text}
The \marginpar command generates a marginal note. This command typesets the text
given as an argument in the margin, the ¬rst line at the same height as the line in the
main text where the \marginpar command occurs. The marginal note appearing here This
is a
was generated with margi-
nal
... command occurs\marginpar{This is a marginal note}. The ... note

When only the mandatory argument right-text is speci¬ed, then the text goes to the right
margin for one-sided printing; to the outside margin for two-sided printing; and to the
nearest margin for two-column formatting. When you specify an optional argument, it
is used for the left margin, while the second (mandatory) argument is used for the right.
There are a few important things to understand when using marginal notes. First,
\marginpar command does not start a paragraph, that is, if it is used before the ¬rst
word of a paragraph, the vertical alignment may not match the beginning of the para-
graph. Secondly, if the margin is narrow, and the words are long (as in German), you
may have to precede the ¬rst word by a \hspace{0pt} command to allow hyphenation
of the ¬rst word. These two potential problems can be eased by de¬ning a command
\marginlabel{text}, which starts with an empty box \mbox{}, typesets a marginal note
ragged left, and adds a \hspace{0pt} in front of the argument.
\newcommand{\marginlabel}[1]
{\mbox{}\marginpar{\raggedleft\hspace{0pt}#1}}

By default, in one-sided printing the marginal notes go on the outside margin. These
defaults can be changed by the following declarations:
Marginal notes go into the opposite margin with respect to the de-
\reversemarginpar
fault one.
Marginal notes go into the default margin.
\normalmarginpar
148 FOOTNOTES, MARGINPARS, ENDNOTES
XIII. AND

<< . .

. 21
( : 23)



. . >>