| 1 |
%% file: TXSfmts.doc - Formats and Style Files - TeXsis version 2.18 |
| 2 |
%% @(#) $Id: TXSfmts.doc,v 18.3 2001/04/06 21:52:07 myers Exp $ |
| 3 |
%======================================================================* |
| 4 |
% (C) copyright 1994-2000 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\fi |
| 10 |
|
| 11 |
\section{Style Files and Specialized Formats \label{sect.fmts}} |
| 12 |
|
| 13 |
Section~\use{sect.papers} described the basic layout of a \TeXsis\ |
| 14 |
document and the |\paper|, |\preprint|, |\Manuscript| and |\book| macros |
| 15 |
for typesetting simple documents. It is often necessary to modify the |
| 16 |
details of the layouts for such documents, particularly when submitting |
| 17 |
camera ready manuscripts for conference proceedings. Since \TeXsis\ is |
| 18 |
built on plain \TeX, you can of course use the full power of \TeX\ to |
| 19 |
format a document as you please. However, \TeXsis\ contains macros to |
| 20 |
produce documents in several of the common formats used in the physics |
| 21 |
community. These and other specialized formats are described in this |
| 22 |
section. |
| 23 |
|
| 24 |
It would be very inefficient for \TeXsis\ to load the definitions of all |
| 25 |
of the possible document styles listed below when at most only one of |
| 26 |
them will be used. \TeXsis\ therefore puts these specialized |
| 27 |
definitions in files known as ``style'' files (which generally have |
| 28 |
filename extensions of ``|.txs|'') and only loads the particular style |
| 29 |
file when it is needed. Besides saving space this also allows for quite |
| 30 |
a bit of flexibility, because it is easy to modify style files or to |
| 31 |
create new ones. For example, if the proceedings of a conference must |
| 32 |
be typeset in a particular way (as is often the case) then the commands |
| 33 |
to set-up a document in exactly the right way can be put in a style file |
| 34 |
and e-mailed to all conference participants. Another use of specialized |
| 35 |
style files is to define a \cs{thesis} format which conforms to the |
| 36 |
rules and regulations of a particular university. |
| 37 |
|
| 38 |
|
| 39 |
%=========================* |
| 40 |
\subsection{Specialized Document Styles \label{sect.styles}} |
| 41 |
|
| 42 |
The following styles for various conference proceeding formats, |
| 43 |
journals, and thesis formats are distributed with \TeXsis~\fmtversion. |
| 44 |
Use these in place of |\paper| or |\preprint|. The name of the style |
| 45 |
file from which the definitions are loaded is shown in brackets. |
| 46 |
% |
| 47 |
\description{XNorthHollandTwo\quad}\clump |
| 48 |
% |
| 49 |
\itm{\CS{AIPproceedings}} |
| 50 |
Similar to |\paper|, but specialized to the American Institute of |
| 51 |
\hbox{Physics} (AIP) format. [AIP.txs] |
| 52 |
% |
| 53 |
\itm{\CS{IEEEproceedings}} |
| 54 |
An IEEE format using oversized double column paper. See \Sect{dcol}. |
| 55 |
[IEEE.txs] |
| 56 |
% |
| 57 |
\itm{\CS{IEEEreduced}} |
| 58 |
An IEEE format reduced to 75\% of full size and printed with 9~pt.\ |
| 59 |
type for $8\frac{1}{2}\,{\rm in} \times 11\,{\rm in}$ paper. [IEEE.txs] |
| 60 |
% |
| 61 |
\itm{\CS{NorthHolland} } |
| 62 |
Format for producing camera-ready copy for proceedings published by |
| 63 |
North-Holland/Elsevier. This is a single column format with titles |
| 64 |
and authors left justified and in eleven point type. [Elsevier.txs] |
| 65 |
% |
| 66 |
\itm{\CS{NorthHollandTwo}} |
| 67 |
The North-Holland double column format for oversized paper. |
| 68 |
[Elsevier.txs] |
| 69 |
% |
| 70 |
\itm{\CS{nuclproc}} |
| 71 |
The ``NUCLPROC'' style for Nuclear Physics Proceedings. [nuclproc.txs] |
| 72 |
% |
| 73 |
\itm{\CS{WorldScientific}} |
| 74 |
Similar to |\paper|, but specialized to the World Scientific |
| 75 |
proceedings format. [WorldSci.txs] |
| 76 |
% |
| 77 |
\itm{\CS{PhysRev}} |
| 78 |
Emulates the page layout and appearance of the {\sl Physical Review}. |
| 79 |
[PhysRev.txs] |
| 80 |
% |
| 81 |
\itm{\CS{PhysRevManuscript}} |
| 82 |
Similar to |\Manuscript| but customized for papers submitted to the |
| 83 |
{\sl Physical Review}. [PhysRev.txs] |
| 84 |
% |
| 85 |
\itm{\CS{thesis}} |
| 86 |
Similar to \cs{book}, but for printing a thesis. The default |
| 87 |
|\thesis| format conforms to the requirements of the Yale |
| 88 |
Graduate School, but it can (and probably should) be modified for |
| 89 |
your own installation. [thesis.txs] |
| 90 |
% |
| 91 |
\enddescription |
| 92 |
Other even more specialized styles are available, and some of them |
| 93 |
can be found on the \TeXsis\ anonymous ftp server, in the directory |
| 94 |
|/pub/texsis/styles|. |
| 95 |
|
| 96 |
\bigskip |
| 97 |
|
| 98 |
The IEEE and North Holland double column formats in the list above use |
| 99 |
the double column macros described in Sect.~\use{sect.dcol}. For |
| 100 |
example, \cs{NorthHollandTwo} sets up a document with an overall width |
| 101 |
of 21.3~cm, a page length of 27.1~cm and a column width of 10.0~cm. |
| 102 |
(Note that this is just about as wide or a little wider than most |
| 103 |
small laser printers can print, so provisions have been made for |
| 104 |
shifting the printed page horizontally to print one column at a time |
| 105 |
if necessary.) A document printed with this format might have the |
| 106 |
following basic structure: |
| 107 |
\TeXexample |
| 108 |
|smalltt\texsis |
| 109 |
\NorthHollandTwo % set up double columns |
| 110 |
\titlepage % but still single column mode |
| 111 |
|
| 112 |
|<title page material> |
| 113 |
|
| 114 |
\endtitlepage % ends the title material |
| 115 |
\doublecolumns % now start double column mode |
| 116 |
|
| 117 |
|<text of paper> |
| 118 |
|
| 119 |
\enddoublecolumns % balance the final columns |
| 120 |
\bye |
| 121 |
|endTeXexample |
| 122 |
\noindent |
| 123 |
Saying \cs{NorthHollandTwo} only defines the double column layout; it |
| 124 |
does not turn on double column mode. The title material is printed in |
| 125 |
single column format across the full page width, then the main body is |
| 126 |
printed in double column format once \cs{doublecolumns} appears. It is |
| 127 |
important to say \cs{enddoublecolumns} at the end of the document to |
| 128 |
balance the columns on the last page. Formatting text in balanced |
| 129 |
double columns can be quite tricky, so you should read \Sect{dcol} |
| 130 |
carefully before trying to use any of the double column macros. |
| 131 |
|
| 132 |
%==============================* |
| 133 |
\subsubsection{Physical Review Formats} |
| 134 |
|
| 135 |
The \CS{PhysRevManuscript} style is similar to \cs{Manuscript} but is |
| 136 |
customized to satisfy the requirements for manuscripts submitted to |
| 137 |
the {\sl Physical Review}. It uses true double |
| 138 |
spacing, and it places the tables and figure captions at the end of |
| 139 |
the document. By simply switching from this to \cs{preprint} you should |
| 140 |
be able to produce a version suitable for distribution as a preprint |
| 141 |
from the same manuscript file. |
| 142 |
|
| 143 |
The \CS{PhysRev} and \CS{PhysRevLett} styles are not intended for |
| 144 |
submission but rather emulate the page layouts in the {\sl Physical |
| 145 |
Review} and {\sl Physical Review Letters} respectively. We have |
| 146 |
attempted to reproduce accurately the double column layout, headlines, |
| 147 |
footlines, reference style, etc., used in the actual journals. This |
| 148 |
is still work in progress, but it may be useful both to see how a |
| 149 |
paper would look in print and as an example for constructing other |
| 150 |
styles. Setting up the headlines and page numbering requires calling |
| 151 |
a few extra macros: |
| 152 |
% |
| 153 |
\example |
| 154 |
|\texsis| \n |
| 155 |
|\PhysRev| \n |
| 156 |
|\TitleBanner{|\meta{Running Title Headline}|}| \n |
| 157 |
|\AuthorBanner{|\meta{Running Author Headline}|}| \n |
| 158 |
|\VolumeBanner{|\meta{series}|}{|\meta{vol}|}{|\meta{issue}% |
| 159 |
|}{|\meta{page}|}| \n |
| 160 |
|\titlepage| \n |
| 161 |
... |
| 162 |
\endexample |
| 163 |
% |
| 164 |
In |\VolumeBanner| the \meta{series} should be one of A, B, C, D, E, |
| 165 |
for the {\sl Physical Review} or L for {\sl Physical Review Letters}; |
| 166 |
the volume, issue, and starting page arguments are self-explanatory. |
| 167 |
Both \CS{PhysRev} and \CS{PhysRevLett} typeset the document in double |
| 168 |
columns, so to make full use of these layouts you will need to read |
| 169 |
about the double column macros described in \Sect{dcol}. |
| 170 |
In particular, you should be aware of the following: in both the |
| 171 |
\CS{PhysRev} and \CS{PhysRevLett} styles, double column mode is begun |
| 172 |
automatically at the end of the title material (\cs{endtitlepage}). |
| 173 |
Since any double column material is inside a group, any definitions made |
| 174 |
at that point will only be defined inside that group. If you want to |
| 175 |
define macros for use in the rest of your paper, you should do so before |
| 176 |
the title material (or use \cs{gdef}). |
| 177 |
|
| 178 |
|
| 179 |
%=========================* |
| 180 |
\subsubsection{Thesis or Dissertation Format} |
| 181 |
|
| 182 |
The style file {\tt \idx{thesis.txs}} contains two alternative |
| 183 |
definitions of \CS{thesis}, one for Yale University (called |
| 184 |
|\YaleThesis|) and the other for the University of Texas at Austin |
| 185 |
(called |\UTthesis|). The default is that saying \CS{thesis} gives you |
| 186 |
|\YaleThesis|, but this is easily changed by saying |\let\thesis=\UTthesis|. |
| 187 |
|
| 188 |
If you are not at Yale or UT you will need to change the |
| 189 |
macros in |thesis.txs| to create your own version of the \CS{thesis} |
| 190 |
macro. Every university has different requirements for how a thesis is |
| 191 |
typed or typeset, and these requirements often conflict. Perhaps the |
| 192 |
first thing you should do if you want to write a thesis using \TeXsis\ |
| 193 |
is find out if someone else at your university has already done so, and |
| 194 |
then copy their definition of \CS{thesis}. If you end up creating a |
| 195 |
new style file for your university then we hope that you will make it |
| 196 |
available for other students to use. We would also be willing to help, |
| 197 |
by putting such style files on the \TeXsis\ anonymous ftp server. |
| 198 |
If you have such a file (or other macros) you would like to contribute, |
| 199 |
send us e-mail at {\tt [email protected]}. |
| 200 |
|
| 201 |
|
| 202 |
%=========================* |
| 203 |
\subsection{Creating New Styles} |
| 204 |
|
| 205 |
It is very easy to create a new document style and style file. |
| 206 |
By convention, \TeXsis\ style files end with the filename extension |
| 207 |
``|.txs|,'' so all you need to do is put the definitions and macros |
| 208 |
defining this new document style into such a file, and then read that |
| 209 |
file in when beginning the document. For example, suppose you create a |
| 210 |
style file called |mine.txs| which contains a document style called |
| 211 |
|\mystyle|, which is a slightly altered version of \cs{paper}: |
| 212 |
\TeXexample |
| 213 |
\def\mystyle{\paper |
| 214 |
\hsize=|<dimen> |
| 215 |
\vsize=|<dimen> |
| 216 |
\showsectIDfalse |
| 217 |
... |
| 218 |
} |
| 219 |
|endTeXexample |
| 220 |
\noindent |
| 221 |
You could then simply read in this file at the beginning of the document, |
| 222 |
with \cs{input}, and then invoke |\mystyle|, like so, |
| 223 |
\TeXexample |
| 224 |
\input mine.txs |
| 225 |
\mystyle |
| 226 |
|endTeXexample |
| 227 |
|
| 228 |
However, you may have noticed that none of the special document styles |
| 229 |
mentioned in \Sect{styles} were actually loaded with \cs{input}, |
| 230 |
although they are in fact read from a style file. This was done using |
| 231 |
the \CS{autoload} command. Saying |
| 232 |
\TeXexample |
| 233 |
\autoload\AIPproceeings{AIP.txs} |
| 234 |
|endTeXexample |
| 235 |
defines |\AIPproceeings| to be a simpler instruction which, if invoked, |
| 236 |
automatically loads the style file |AIP.txs|, which contains the real |
| 237 |
definition of |\AIPproceedings|. After the style file has been loaded |
| 238 |
this real |\AIPproceedings| is automatically called. It then appears as |
| 239 |
if the definition of the macro was in \TeXsis's memory all the time, |
| 240 |
though it really was only loaded from the file when called for. |
| 241 |
|
| 242 |
As a practical example of using \CS{autoload}, suppose that you are a |
| 243 |
student at Excited State University and you want to create a customized |
| 244 |
\cs{thesis} macro which will load automatically from a style file called |
| 245 |
|ESUthesis.txs|. You could copy the macros in the file |thesis.txs| |
| 246 |
to this new file, and then edit them as needed. Then, to make the |
| 247 |
new definition load automatically you would say |
| 248 |
\TeXexample |
| 249 |
\autoload\thesis{ESUthesis.txs} |
| 250 |
|endTeXexample |
| 251 |
\noindent |
| 252 |
To make this new definition of \cs{thesis} available to |
| 253 |
anyone using \TeXsis\ on your machine you would want to put this |
| 254 |
\CS{autoload} command in the file |TXSsite.tex| before building the |
| 255 |
\TeXsis\ format. This is described in more detail in Appendix~\use{install}. |
| 256 |
To make the new definition automatically available just to you in your |
| 257 |
thesis directory you could put the command in a file called |
| 258 |
|TXSmods.tex| in that directory. |
| 259 |
|
| 260 |
Important note: many \TeXsis\ style files and source files use the ``|@|'' |
| 261 |
character in the names of macros which are to be ``hidden'' from the |
| 262 |
casual user. Since ``|@|'' is not a letter these macros can't normally |
| 263 |
be used. If you are writing a style file which needs to use these |
| 264 |
hidden macros you should say \CS{ATunlock} first, to make ``|@|'' a |
| 265 |
letter, and then \CS{ATlock} when you are done to turn ``|@|'' back |
| 266 |
into a non-letter. |
| 267 |
|
| 268 |
|
| 269 |
|
| 270 |
|
| 271 |
\Ignore % The stuff below is maybe way too technical? |
| 272 |
|
| 273 |
You may also need to make changes in some of more complicated macros. |
| 274 |
This is most easily made by copying the original definition from one |
| 275 |
of the |TXSxxxx.tex| files into |mine.txs| and editing it. For |
| 276 |
example, if you want the abstract to be in 9~pt.\ type, copy the |
| 277 |
definition of |\abstract| from |TXStitle.tex| and add |\ninepoint| to |
| 278 |
it: |
| 279 |
% |
| 280 |
\TeXexample |
| 281 |
|smalltt\def\abstract{% begin abstract of a paper or treatise |
| 282 |
\endmode % end any previous field |
| 283 |
\bigskip\bigskip % some space above |
| 284 |
\centerline{ABSTRACT}% % ``ABSTRACT'' |
| 285 |
\medskip % space below that |
| 286 |
\bgroup % begin \abstract group |
| 287 |
\let\endmode=\endabstract % \endmode ends \abstract |
| 288 |
\narrower\narrower % bring in margins |
| 289 |
\ninepoint % NEW FOR \mystyle STYLE |
| 290 |
\singlespaced} % single spaced |
| 291 |
|endTeXexample |
| 292 |
|
| 293 |
While some of the macros you need to change may be complicated, the |
| 294 |
changes \hbox{you} will actually need to make will probably still be fairly |
| 295 |
simple. For example, in the definition of |\section| in |TXSsects.tex| |
| 296 |
you probably want to change only the part that actually prints the |
| 297 |
section heading. This is a small part of the whole and is reasonably |
| 298 |
well commented. The default is to print the section head left |
| 299 |
justified, ragged right, with a hanging indentation whose width is set |
| 300 |
by the section number: |
| 301 |
% |
| 302 |
\TeXexample |
| 303 |
|smalltt% |
| 304 |
% Print the Section title: |
| 305 |
% |
| 306 |
\ifx\tbf\undefined\def\tbf{\bf}\fi % default \tbf is \bf |
| 307 |
\vbox{% % keep heading in \vbox |
| 308 |
{\raggedright % |
| 309 |
\pretolerance=2000\hyphenpenalty=2000 % no hyphenation |
| 310 |
\setbox0=\hbox{\noindent\tbf\@fullID}%% find width of ID |
| 311 |
\hangindent=\wd0 \hangafter=1 % for hanging indent |
| 312 |
\noindent\unhbox0{\tbf{#1}}\relax % number and title |
| 313 |
\medskip}}% % |
| 314 |
\nobreak % |
| 315 |
|endTeXexample |
| 316 |
% |
| 317 |
If instead you want the section headings to be centered with two |
| 318 |
spaces (|\ \ |) after the number, you can replace this part of the |
| 319 |
|\section| macro |
| 320 |
% |
| 321 |
\TeXexample |
| 322 |
|smalltt% |
| 323 |
% Print the Section title: |
| 324 |
% |
| 325 |
\ifx\tbf\undefined\def\tbf{\bf}\fi % default \tbf is \bf |
| 326 |
\vbox{% % keep heading in \vbox |
| 327 |
{\raggedcenter % USE RAGGED CENTER |
| 328 |
\tbf\@fullID\ \ #1 % ID AND TITLE |
| 329 |
\endraggedcenter % END RAGGED CENTER |
| 330 |
\medskip}}% % |
| 331 |
\nobreak % |
| 332 |
|endTeXexample |
| 333 |
% |
| 334 |
\noindent |
| 335 |
You can leave the rest of the \cs{section} macro alone and it will work |
| 336 |
as before. |
| 337 |
|
| 338 |
\endIgnore |
| 339 |
|
| 340 |
|
| 341 |
|
| 342 |
%==================================================* |
| 343 |
\subsection{Overhead Transparencies (Slides)} |
| 344 |
|
| 345 |
\TeXsis\ contains a simple \CS{slides} format for making overhead |
| 346 |
transparencies or similar material. |
| 347 |
While \TeX\ is not a convenient language for graphical page layout, it |
| 348 |
is sometimes useful to be able to convert a paper to transparencies or |
| 349 |
visa versa.\Footnote*{However, until recently one of the |
| 350 |
authors of \TeXsis\ preferred to make neatly lettered transparencies by |
| 351 |
hand, using colored pens, rather than using a printer that could only |
| 352 |
print in black and white. |
| 353 |
He's changed his mind now that it is possible to produce text |
| 354 |
in color.} |
| 355 |
If you want to use |\slides|, simply begin your manuscript file with |
| 356 |
% |
| 357 |
\TeXexample |
| 358 |
\slides |
| 359 |
|endTeXexample |
| 360 |
instead of (or in addition to) |\texsis|. |
| 361 |
% |
| 362 |
This will produce |
| 363 |
%% NOT ANYMORE $8\frac{1}{2}\,{\rm in} \times 10\frac{1}{2}\,{\rm in}$ |
| 364 |
pages with $1\,{\rm in}$ margins in |
| 365 |
the ``portrait'' orientation with 24~pt.\ type, with a ragged right |
| 366 |
margin and lots of incentive to suppress hyphenation. |
| 367 |
%% NOT ANYMORE and bottom margins. |
| 368 |
\CS{slides} also defines \CS{bl} to insert a blank line and |
| 369 |
\CS{np} to create a new page, since these are often useful for slides. |
| 370 |
Since the \CS{slides} format is very simple, it is not loaded from a |
| 371 |
style file. |
| 372 |
|
| 373 |
%==================================================* |
| 374 |
\subsection{Color PostScript Output \label{sect.color}} |
| 375 |
|
| 376 |
Now that color printers are fairly common, it is useful to have some |
| 377 |
way to produce text that is printed in different colors. |
| 378 |
The simplest use of this is for producing overhead transparencies, as |
| 379 |
with the \CS{slides} format. |
| 380 |
\TeXsis\ has a simple set of macros, in the style file {\tt |
| 381 |
color.txs}, which lets you change the colors of text printed using |
| 382 |
PostScript. |
| 383 |
This only works for PostScript output produced by\index{Rokicki, |
| 384 |
Tomas} Tom Rokicki's {\tt dvips} program,\cite{Rokicki} using the |
| 385 |
profile file {\tt color.pro} that is usually included with {\tt |
| 386 |
dvips}. |
| 387 |
|
| 388 |
To use these macros, you must first input the definitions, |
| 389 |
\TeXexample |
| 390 |
\input color.txs |
| 391 |
|endTeXexample |
| 392 |
To change the color of all text which follows, use the command \CS{SetColor}, |
| 393 |
as in |
| 394 |
\TeXexample |
| 395 |
\SetColor{Green} |
| 396 |
|endTeXexample |
| 397 |
Keep in mind that this will change \undertext{all} |
| 398 |
text, including page numbers and headlines and footlines. To print a |
| 399 |
small portion of text in some other color, use |
| 400 |
\CS{colorit}, |
| 401 |
as in |
| 402 |
\TeXexample |
| 403 |
\colorit{Red}{The text inside these brackets is colored Red} |
| 404 |
|endTeXexample |
| 405 |
You can change the color of the background using \CS{background}, |
| 406 |
as in |
| 407 |
\TeXexample |
| 408 |
\background{Yellow} |
| 409 |
|endTeXexample |
| 410 |
|
| 411 |
\bigskip |
| 412 |
\pagecheck{2in} |
| 413 |
|
| 414 |
The 12 basic colors available are |
| 415 |
\example |
| 416 |
\settabs 4\columns |
| 417 |
\+& Black & White & Gray \cr |
| 418 |
\+& Red & Green & Blue \cr |
| 419 |
\+& Cyan & Magenta & Yellow \cr |
| 420 |
\+& Purple & Orange & Brown \cr |
| 421 |
\endexample |
| 422 |
Note that the case is important---the names must begin with an initial |
| 423 |
capital letter. |
| 424 |
|
| 425 |
For the basic colors listed above some shortcuts are also defined. |
| 426 |
Specifically, you can simply use the color name as a command, with the |
| 427 |
text to be colored as a single argument, as in |
| 428 |
\TeXexample |
| 429 |
\Red{This text is colored Red} |
| 430 |
|endTeXexample |
| 431 |
or you can say |\text|\meta{Color} to change the text color, |
| 432 |
as in |
| 433 |
\TeXexample |
| 434 |
\textGreen |
| 435 |
|endTeXexample |
| 436 |
You can add shortcuts for other colors besides the basics |
| 437 |
with the \CS{addColor} command. Saying |
| 438 |
\TeXexample |
| 439 |
\addColor{Salmon} |
| 440 |
|endTeXexample |
| 441 |
will define |\Salmon| and |\textSalmon| as shortcuts |
| 442 |
for |\colorit{Salmon}{|\meta{text}|}| and |\setColor{Salmon}|. |
| 443 |
|
| 444 |
Although the basic colors listed above should be enough for most |
| 445 |
simple applications, there are actually a whole host of other colors |
| 446 |
available. In fact, all of the colors found in a box of 64 Crayola |
| 447 |
Crayons are defined in {\tt color.pro} for |dvips|. You can define |
| 448 |
short-cuts for all of these simply by saying \CS{Crayolas}. |
| 449 |
You can produce a list of all of the colors, with each printed in its |
| 450 |
own color, by saying \CS{ListColors}. |
| 451 |
|
| 452 |
The commands so far have just about the same syntax as those in the |
| 453 |
macro package called {\tt COLORDVI.TEX}, by Jim |
| 454 |
Hafner\reference{colordvi} Hafner, Jim, the {\tt COLORDVI.TEX} macros |
| 455 |
are included in the {\tt dvips} distribution. See \Ref{Rokicki} |
| 456 |
\endreference\space |
| 457 |
(although the internal workings are slightly different). |
| 458 |
Any plain \TeX\ file which uses {\tt COLORDVI.TEX} should also work |
| 459 |
using {\tt color.txs}. |
| 460 |
But the {\tt color.txs} macros also include commands to specifically |
| 461 |
manipulate the PostScript color stack. |
| 462 |
To change the color temporarily by pushing it onto the stack, and then |
| 463 |
revert to the previous color by popping the stack, use \CS{PushColor} |
| 464 |
and \CS{PopColor}, as in |
| 465 |
\TeXexample |
| 466 |
This text is in some color, probably black. |
| 467 |
\PushColor{Purple} |
| 468 |
This text will be purple. |
| 469 |
\PopColor |
| 470 |
This text will be back in the previous color. |
| 471 |
|endTeXexample |
| 472 |
|
| 473 |
Be aware that the color changes have nothing to do with TeX's grouping |
| 474 |
mechanism (\ie\ curly brackets), but are based only on the PostScript |
| 475 |
color stack. |
| 476 |
If you really want the color to change back when a \TeX\ group ends |
| 477 |
(whenever that might happen), you can use |
| 478 |
\cs{aftergroup}, as in |
| 479 |
\TeXexample |
| 480 |
\begingroup\PushColor{Red}\aftergroup\PopColor |
| 481 |
|endTeXexample |
| 482 |
Then later when the group is ended, the \CS{PopColor} is automatically |
| 483 |
executed and the color reverts to its previous value. |
| 484 |
One nice way this can be used is to color all displayed equations, |
| 485 |
by putting this all in \cs{everydisplay}, like so |
| 486 |
\TeXexample |
| 487 |
\everydisplay={\PushColor{BurntOrange}\aftergroup\PopColor} |
| 488 |
|endTeXexample |
| 489 |
A displayed equation is always constructed within a new group, and |
| 490 |
when it ends the \CS{PopColor} on the \cs{aftergroup} stack is invoked |
| 491 |
automatically and the text reverts to the previous color. |
| 492 |
|
| 493 |
\bigskip |
| 494 |
|
| 495 |
|
| 496 |
If the 64 colors listed by \CS{ListColors} are not enough for your |
| 497 |
purposes, you can also define your own, using \CS{SetCmykColor} or |
| 498 |
\CS{PushCmykColor}. |
| 499 |
Colors are specified as a quadruple of intensity values between 0.0 and 1.0 |
| 500 |
(CMYK means Cyan, Magenta, Yellow, and blacK). For example: |
| 501 |
\TeXexample |
| 502 |
\SetCmykColor{.2 .3 .4 .1} |
| 503 |
|endTeXexample |
| 504 |
will give you a nice tan, while |
| 505 |
\TeXexample |
| 506 |
\PushCmykColor{.5 .5 .1 .2} Old Blue Eyes \PopColor |
| 507 |
|endTeXexample |
| 508 |
will print the text in the shade of blue specified by that particular |
| 509 |
CMYK quadruple. |
| 510 |
|
| 511 |
|
| 512 |
%==================================================* |
| 513 |
\subsection{Twin Page Output} |
| 514 |
|
| 515 |
It is sometimes desirable to produce preprints or other documents in a |
| 516 |
compact format with two pages on each physical page in landscape |
| 517 |
orientation. While this can be done with \cs{SetDoubleColumns}, a much |
| 518 |
simpler approach is sufficient. \TeXsis\ contains a macro called |
| 519 |
\CS{twinout} which redefines the output routine to produce two pages |
| 520 |
per page, without attempting to balance columns or allowing spanned |
| 521 |
equations, tables, etc. (thus avoiding many of the possible problems |
| 522 |
with the more powerful double column macros). \CS{twinout} can be used |
| 523 |
with any of the standard formats described in \Sect{papers} or |
| 524 |
\Sect{fmts} or even with Plain \TeX. Since \CS{twinout} does not |
| 525 |
select fonts, the user must do so:\index{twin page output} |
| 526 |
% |
| 527 |
\TeXexample |
| 528 |
\texsis |
| 529 |
\tenpoint |
| 530 |
\def\Tbf{\twelvebf} |
| 531 |
\def\tbf{\tenbf} |
| 532 |
\twinout |
| 533 |
|<text> |
| 534 |
|endTeXexample |
| 535 |
Alternatively, the \CS{twinformat} command can be used to produce any |
| 536 |
\TeXsis\ format in \CS{twinout} layout with 10~pt fonts. Thus the above |
| 537 |
commands can be replaced by |
| 538 |
\TeXexample |
| 539 |
\texsis |
| 540 |
\twinformat |
| 541 |
|<text> |
| 542 |
|endTeXexample |
| 543 |
Here \CS{twinformat} automatically sets up 10~pt fonts and appropriate |
| 544 |
values for the title bold face fonts, just as in the previous example. |
| 545 |
\CS{twinout} use the following dimensions: |
| 546 |
% |
| 547 |
\description{Xnormhsize\qquad}\clump |
| 548 |
% |
| 549 |
\itm{\CS{twinhsize}} |
| 550 |
Total width for twin column output. |
| 551 |
% |
| 552 |
\itm{\CS{twinvsize}} |
| 553 |
Column height for twin column output. |
| 554 |
% |
| 555 |
\itm{\CS{twincsize}} |
| 556 |
Column width for twin column output. |
| 557 |
% |
| 558 |
\itm{\CS{normhsize}} |
| 559 |
Normal value of \cs{hsize} in portrait mode. |
| 560 |
% |
| 561 |
\itm{\CS{normvsize}} |
| 562 |
Normal value of \cs{vsize} in portrait mode. |
| 563 |
% |
| 564 |
\enddescription |
| 565 |
All of these have sensible default values for $8.5\,{\rm in} \times |
| 566 |
11\,{\rm in}$ paper but can be reset before \CS{twinout} is called. The |
| 567 |
"normal" sizes should print properly with the default device driver |
| 568 |
and printer. Appropriate default values for all these dimensions can |
| 569 |
be set in |TXSsite.tex|. |
| 570 |
|
| 571 |
\CS{twinout} puts \cs{LandscapeSpecial} on each page. This is null by |
| 572 |
default but can be redefined to be an appropriate \cs{special} command |
| 573 |
to produce landscape output with your device driver and printer. For |
| 574 |
example, with |dvips|\cite{Rokicki}\index{dvips}\index{Rokicki, Tomas} |
| 575 |
and a PostScript printer, use |
| 576 |
\TeXexample |
| 577 |
\def\LandscapeSpecial{\special{papersize=11in,8.5in}} |
| 578 |
|endTeXexample |
| 579 |
A default value can be set in |TXSsite.tex|. |
| 580 |
|
| 581 |
\CS{twinprint} is a substitute for \cs{preprint} which sets the |
| 582 |
title, author, and other titlepage material full size in landscape mode |
| 583 |
and then switches to \CS{twinout} twin column output with 10~pt type for |
| 584 |
the text of the paper. A typical preprint might read: |
| 585 |
\TeXexample |
| 586 |
\twinprint |
| 587 |
\titlepage |
| 588 |
\title |
| 589 |
|<paper title> |
| 590 |
\endtitle |
| 591 |
\author |
| 592 |
|<author's name and address> |
| 593 |
\endauthor |
| 594 |
\abstract |
| 595 |
|<text of abstract> |
| 596 |
\endabstract |
| 597 |
\endtitlepage |
| 598 |
|<text of paper> |
| 599 |
\bye |
| 600 |
|endTeXexample |
| 601 |
\nobreak\noindent |
| 602 |
This produces a nice, compact format for preprints. |
| 603 |
|
| 604 |
%>>> EOF TXSfmts.doc <<< |