| 1 |
%% file: TXSmisc.doc - Miscellaneious Macros - TeXsis version 2.18 |
| 2 |
%% @(#) $Id: TXSmisc.doc,v 18.2 2000/05/17 00:19:46 myers Exp $ |
| 3 |
%======================================================================* |
| 4 |
% (C) Copyright 1992 by Eric Myers and Frank E. Paige |
| 5 |
% This file is a part of TeXsis. Distribution and/or modifications |
| 6 |
% are allowed under the terms of the LaTeX Project Public License (LPPL). |
| 7 |
% See the file COPYING or ftp://ftp.texsis.org/texsis/LPPL |
| 8 |
%======================================================================* |
| 9 |
\ifx\undefined\bs \texsis\input TXSdocM.doc\input Manual.aux\draft\fi |
| 10 |
|
| 11 |
\section{Miscellaneous Macros \label{sect.misc}} |
| 12 |
|
| 13 |
There are a number of useful macros in \TeXsis\ which don't fit into any |
| 14 |
of the topics covered in previous sections but which still deserve some |
| 15 |
discussion. We will simply lump them all together in this final |
| 16 |
section. |
| 17 |
|
| 18 |
\subsection{{\tt\string\draft} mode} |
| 19 |
|
| 20 |
Saying \CS{draft} turns on a number of features which are useful for |
| 21 |
making a draft copy of a document. The disclaimer ``{\tt Preliminary |
| 22 |
Draft}'' is added to the bottom of each page of the document, along with |
| 23 |
the page number and a time and date stamp. The page number will let you |
| 24 |
keep track of the page order even when using a document format which |
| 25 |
does not print page numbers (such as the \cs{nuclproc} or |
| 26 |
\cs{NorthHollandTwo} camera-ready formats). The date/time stamp |
| 27 |
can help you tell later drafts from earlier versions of the same |
| 28 |
document. \CS{draft} sets \cs{eqnotracetrue} so that equations |
| 29 |
are marked with their internal labels in the right margin next to |
| 30 |
the equation number (as described in Section~\use{sect.eqns}). |
| 31 |
Other kinds of errors, such as trying to use undefined labels for citations |
| 32 |
equations, are also marked in the right-hand margin. \CS{draft} also |
| 33 |
sets \cs{overfullrule}|=1em| so that over full \cs{hbox}es are marked |
| 34 |
with a black box. |
| 35 |
Without \CS{draft}, initializing \TeXsis\ with \cs{texsis} sets |
| 36 |
\cs{overfullrule}|=0pt| so that over-full hboxes don't |
| 37 |
get these kinds of marks (while with plain \TeX\ you do get these |
| 38 |
marks). |
| 39 |
|
| 40 |
\bigskip |
| 41 |
%======================================================================* |
| 42 |
\subsection{Ignoring blocks of text} |
| 43 |
|
| 44 |
Sometimes you'd really like to take out a whole paragraph or an even |
| 45 |
larger section of a document, but only temporarily, and you don't want |
| 46 |
to actually delete it from the manuscript file. Recalling that in |
| 47 |
\TeX\ everything on a line following the comment character ``{\tt\%}'' is |
| 48 |
discarded, you could put a {\tt\%} on each line to be ignored, |
| 49 |
but that could be a lot of work. Instead, you can use \CS{comment}. |
| 50 |
The syntax is: |
| 51 |
\TeXexample |
| 52 |
\comment/* anything in here is ignored */ |
| 53 |
|endTeXexample |
| 54 |
\noindent |
| 55 |
Everything between the |/*| and the |*/| is completely ignored. By |
| 56 |
removing the |\comment/*| and the |*/| the text can easily be restored |
| 57 |
to its previous state. You can include several paragraphs of text in |
| 58 |
the material to be ignored, or even several pages, but with one |
| 59 |
important restriction: All the curly brackets |{| and |}| must match in |
| 60 |
the text to be ignored. If there is a |{| with no closing |}| in the |
| 61 |
commented text then \TeX\ will skip the |*/| while searching for the |
| 62 |
closing |}|! |
| 63 |
|
| 64 |
Along the same lines is \CS{Ignore}, which will ignore everything |
| 65 |
following it up to \cs{endIgnore} (with the same restrictions above |
| 66 |
about matching grouping brackets). The useful thing about these is that |
| 67 |
if an \cs{endIgnore} is encountered before an \CS{Ignore} then the |
| 68 |
\cs{endIgnore} is simply ignored. Is that too confusing? What this means |
| 69 |
is that if you have a document with a large block of conditional text |
| 70 |
that you may or may not want included you can choose to include the text |
| 71 |
by simply removing (or commenting out) the \CS{Ignore}. If the block of |
| 72 |
conditional text looks like |
| 73 |
\smallskip\goodbreak |
| 74 |
\def\1{\meta{unconditional text}}\def\2{\meta{more unconditional text}} |
| 75 |
\TeXexample |
| 76 |
|1 |
| 77 |
\Ignore |
| 78 |
Having obtained these eigenvalues we would like to |
| 79 |
know their degeneracies. For a given $l$ the ... |
| 80 |
... |
| 81 |
It is relatively easy to show that the number of |
| 82 |
independent components of such a tensor is ${N+l \choose l}$. |
| 83 |
\endIgnore |
| 84 |
|2 |
| 85 |
|endTeXexample |
| 86 |
\noindent |
| 87 |
then even if the block of text to be ignored spans many pages it can be |
| 88 |
restored simply by changing the ``|\Ignore|'' to ``|%\Ignore|.'' Then |
| 89 |
the |\Ignore| is itself ignored, and when \TeX\ reaches the |\endIgnore| |
| 90 |
this also does nothing. The effect is the same as if these two commands |
| 91 |
were completely removed from the manuscript file, but it is easily |
| 92 |
reversed. |
| 93 |
|
| 94 |
Why are there two ways to ignore blocks of text? \cs{comment} was |
| 95 |
created first, and some programmer-types may prefer it because of the |
| 96 |
similarity it bears to comments in the C programming language. |
| 97 |
\cs{Ignore} is newer and probably a little more useful, but \cs{comment} |
| 98 |
will remain for those who want to use it. |
| 99 |
|
| 100 |
%======================================================================* |
| 101 |
\subsection{Checkpoint/Restart \label{sect.chkpt}} |
| 102 |
|
| 103 |
The checkpoint/restart feature allows long documents to be printed in |
| 104 |
pieces. You can, for example, process and print the first chapter of a |
| 105 |
thesis (or a book) and then later do the same for following chapters. |
| 106 |
Saying \CS{checkpoint}|{NAME}| saves the settings of important counters |
| 107 |
like the current page number and the last equation number in a file |
| 108 |
called |NAME.chk|. Saying \CS{restart}|{NAME}| reads in this file and |
| 109 |
resets the counters to their previous values. |
| 110 |
\index{checkpoint}\index{restart}\index{restore|see{restart}} |
| 111 |
|
| 112 |
As an example consider a document with two major chapters. |
| 113 |
Using a Master File you would first process the first chapters |
| 114 |
with the following: |
| 115 |
\TeXexample |
| 116 |
\thesis |
| 117 |
\input chap1 |
| 118 |
\checkpoint{chap1} |
| 119 |
\bye |
| 120 |
|endTeXexample |
| 121 |
With this printed you could resume at the next page number with |
| 122 |
the correct subsequent numbers for equations, figures and tables |
| 123 |
by saying: |
| 124 |
\TeXexample |
| 125 |
\thesis |
| 126 |
\restart{chap1} |
| 127 |
\input chap2 |
| 128 |
\bye |
| 129 |
|endTeXexample |
| 130 |
\noindent |
| 131 |
Normally |\checkpoint| and |\restart| are silent, |
| 132 |
but you can say \CS{endstat} to see the values of the counters |
| 133 |
saved by |\checkpoint|. The output looks like this: |
| 134 |
\TeXexample |
| 135 |
% Last PAGE number IS 63. |
| 136 |
% Last CHAPTER number IS 0. |
| 137 |
% Last EQUATION number IS 47. |
| 138 |
% Last FIGURE number IS 1. |
| 139 |
% Last REFERENCE number IS 9. |
| 140 |
% Last SECTION number IS 13. |
| 141 |
% Last TABLE number IS 0. |
| 142 |
|endTeXexample |
| 143 |
|
| 144 |
Modern laser printer drivers or filter programs like |dvips|, |dvi2ps|, |
| 145 |
or QTeX have |
| 146 |
options that let you select which pages of a document are printed, |
| 147 |
or there is a useful program called |dviselect|, which can select |
| 148 |
certain pages out of a dvi file into a smaller dvi file. These offer |
| 149 |
other ways to selectively print only part of a document |
| 150 |
and still get the page and equation numbers correct. |
| 151 |
|
| 152 |
%======================================================================* |
| 153 |
\subsection{Other Goodies...} |
| 154 |
|
| 155 |
These macros do various useful things: |
| 156 |
\singlelinetrue % make label overhang |
| 157 |
\description{unobeyspaces}\clump % |
| 158 |
|
| 159 |
|
| 160 |
\itm{\CS{jtem}\arg{label}\arg{dimen}} |
| 161 |
Similar to plain \TeX's |\item|, but sets the label \arg{label} with a |
| 162 |
variable hanging indentation \arg{dimen}. |
| 163 |
|
| 164 |
\itm{\CS{leftpar}\arg{text}} |
| 165 |
Turns the \meta{text} into a paragraph with a ragged {\sl left} margin. |
| 166 |
|
| 167 |
\itm{\CS{pagecheck}\arg{dimen}} |
| 168 |
Checks the amount of space remaining on the current page, and if this is |
| 169 |
less then \meta{dimen} then skips to a new page. |
| 170 |
|
| 171 |
\itm{\CS{topspace}} |
| 172 |
Use this like \cs{vskip} to create a blank space to the top of a page |
| 173 |
(because any space inserted with \cs{vskip} is thrown out if it appears |
| 174 |
at the top of a page). Example: |\topspace 2.54cm|. |
| 175 |
|
| 176 |
\itm{\CS{unobeylines}} |
| 177 |
The opposite of \cs{obeylines}, so line endings are no longer respected. |
| 178 |
|
| 179 |
\itm{\CS{unobeyspaces}} |
| 180 |
The opposite of \cs{obeyspaces}, so that spaces in the manuscript file |
| 181 |
are not counted exactly. |
| 182 |
|
| 183 |
\enddescription |
| 184 |
|
| 185 |
%----------------------------------------% |
| 186 |
\pagecheck{3cm} |
| 187 |
|
| 188 |
\subsubsection{Underlines} |
| 189 |
|
| 190 |
These macros let you underline words or create a ``blank'' line: |
| 191 |
\index{underlines} |
| 192 |
|
| 193 |
\description{unobeyspaces}\clump % |
| 194 |
|
| 195 |
\itm{\CS{undertext}\arg{text}} |
| 196 |
Underlines the \meta{text}, as in this \undertext{example}. This is |
| 197 |
generally okay for words but not phrases or sentences. |
| 198 |
|
| 199 |
\itm{\CS{theBlank}\arg{length}} |
| 200 |
Creates an underline of the specified length where one can ``fill in the |
| 201 |
blank.'' For example, saying `` |Name: \theBlank{6cm}| produces: |
| 202 |
``\hbox{Name:~\theBlank{6cm}}''. |
| 203 |
|
| 204 |
\enddescription |
| 205 |
|
| 206 |
%----------------------------------------% |
| 207 |
\subsubsection{Boxes} |
| 208 |
|
| 209 |
These macros let you put boxes around text or equations, or |
| 210 |
something similar: |
| 211 |
\index{boxes} |
| 212 |
|
| 213 |
\description{unobeyspaces}\clump % |
| 214 |
|
| 215 |
\itm{\CS{tightbox}\arg{box}} |
| 216 |
Puts a ruled box around the argument (which must be a box), with no |
| 217 |
intervening space. |
| 218 |
Example: |\tightbox{\hbox{Boo}}| produces ``\tightbox{\hbox{Boo}}'', |
| 219 |
|
| 220 |
|
| 221 |
\itm{\CS{loosebox}\arg{box}} |
| 222 |
Puts a ``loose'' box around the \meta{box}, with about one \cs{jot} of |
| 223 |
space between the edge of the \meta{box} and the enclosing box. What you |
| 224 |
do with this resulting box is up to you. Rules are {\sl not\/} put |
| 225 |
around this outer box, but you can enclose it in a \CS{tightbox} to do |
| 226 |
so, as in |\tightbox{\loosebox{Boo}}|, which gives |
| 227 |
``\tightbox{\loosebox{Boo}}.'' If you want the contents of this box to |
| 228 |
match the baseline of the current line, lower it by a \cs{jot}, as in |
| 229 |
|\lower\jot\tightbox{\loosebox{Boo}}|, which gives |
| 230 |
``\lower\jot\tightbox{\loosebox{Boo}}''. |
| 231 |
|
| 232 |
|
| 233 |
\itm{\CS{spine}\arg{text}} |
| 234 |
Creates a label enclosed in a ruled box, suitable for the spine of a |
| 235 |
3-ring binder. The box will be at least 15~cm long, but will extend if |
| 236 |
the text requires more space. The default type size is 24~pt, but can |
| 237 |
be changed in the \meta{text}. If the label is longer than the width of |
| 238 |
a page then it should be printed in landscape mode. Instructions for |
| 239 |
installing the label in the spine of a binder are printed (but only once). |
| 240 |
|
| 241 |
\pagecheck{5\baselineskip} |
| 242 |
|
| 243 |
\itm{\CS{eqnbox}\arg{math-expr}} |
| 244 |
Puts a box around the mathematical expression \meta{math-expr}. |
| 245 |
This can be useful for highlighting an important result. |
| 246 |
You can use this in any kind of math |
| 247 |
mode, but usually you will want to use it in a displayed equation, |
| 248 |
like so: |
| 249 |
\TeXexample |
| 250 |
$$ |
| 251 |
\eqnbox{E=mc^2} |
| 252 |
\EQN 47$$ |
| 253 |
|endTeXexample |
| 254 |
which produces: |
| 255 |
$$ |
| 256 |
\eqnbox{E=mc^2} |
| 257 |
\EQN 47$$ |
| 258 |
In an in-line math expression it appears like so: \eqnbox{E=mc^2}.\n |
| 259 |
Be careful not to over-use this, or its utility is lost! |
| 260 |
|
| 261 |
\itm{\CS{eqnmark}} |
| 262 |
Putting a box around an equation can be to distracting, but it is nice |
| 263 |
to have a way to mark ``important'' results. This is an alternative |
| 264 |
to \CS{eqnbox}. Simply put \CS{eqnmark} at the beginning of the |
| 265 |
displayed equation, immediately after the |$$|, and it will put a marker |
| 266 |
defined by \CS{eqnmarker} at the left edge of the equation (the default |
| 267 |
is ``$\eqnmarker$''). |
| 268 |
For example, typing |
| 269 |
\TeXexample |
| 270 |
$$\eqnmark |
| 271 |
E=mc^2 |
| 272 |
\EQN 47$$ |
| 273 |
|endTeXexample |
| 274 |
\noindent |
| 275 |
produces |
| 276 |
$$\eqnmark |
| 277 |
E=mc^2 |
| 278 |
\EQN 47$$ |
| 279 |
Note that \CS{eqnmark} does not work with \cs{eqalignno} or \cs{EQNalign} |
| 280 |
(which is just as well, so that you can't overuse it). |
| 281 |
|
| 282 |
\enddescription |
| 283 |
|
| 284 |
%==================================================* |
| 285 |
|
| 286 |
\subsubsection{Read the Code} |
| 287 |
|
| 288 |
There are a number of other macros in \TeXsis\ which are not |
| 289 |
described in this manual, either because (a) we didn't have time |
| 290 |
to describe everything, or (b) they are works in progress. |
| 291 |
In either case, if you are familiar enough with \TeX\ to write |
| 292 |
some simple macros for yourself, then you are familar enough to |
| 293 |
read through the code and find other useful goodies, or learn some new |
| 294 |
tricks. Just keep in mind that anything not described in the manual |
| 295 |
may be subject to change in a future release. And let us know if you |
| 296 |
find any mistakes. |
| 297 |
|
| 298 |
%>>> EOF TXSmisc.doc <<< |