|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T U
Length: 3463 (0xd87) Types: TextFile Notes: Uncompressed file
└─⟦52210d11f⟧ Bits:30007239 EUUGD2: TeX 3 1992-12 └─⟦c319c2751⟧ »unix3.0/TeX3.0.tar.Z« └─⟦036c765ac⟧ └─⟦64c89c371⟧ »TeX3.0/TeXcontrib/urban/textroff/defs.tex.Z« └─⟦060c9c824⟧ Bits:30007080 DKUUG TeX 2/12/89 └─⟦64c89c371⟧ »./tex82/TeXcontrib/urban/textroff/defs.tex.Z« └─⟦52210d11f⟧ Bits:30007239 EUUGD2: TeX 3 1992-12 └─⟦63303ae94⟧ »unix3.14/TeX3.14.tar.Z« └─⟦c58930e5c⟧ └─⟦64c89c371⟧ »TeX3.14/TeXcontrib/urban/textroff/defs.tex.Z« └─⟦this⟧
\Section{Macros and Definitions} We have already shown one instance in which a \TeX\ control sequence was defined or modified by the user. This was the use of |\font| to define a font-switching control sequence. However, one can also define a new \TeX\ control sequence by using the primitive |\def|. Such new control sequences are called {\sl macros\/} as they are, in effect, short abbreviations for longer streams of commands. It is, of course, possible to define whole families of macros similar in function to the macro packages such as {\bf --me} or {\bf --mm} in \Troff/, or the `document formats' such as {\bf @Make(Report)} of |Scribe|. Knuth's {\sl\TeX book\/} was produced using such a package\note {This package is described in Appendix~E of that book. Some of Knuth's macros were stolen for this document.}, and the numbered section headings and footnotes for this document were produced by the author's own macros such as the |\Section| macro seen in the example at the beginning of the document. However, even when using a very complete macro package, one sometimes wishes to define often-used sequences for a particular paper. For example, this paper uses a macro, |\Unix|, which is similar to |\TeX| but produces `\Unix' in 10-point small-caps font. It was defined as follows: \begintt \font\csc=cmcsc10 % Small-caps font \def\Unix{{\csc Unix}} % Extra grouping for font-change \endtt As a result, whenever |\Unix| is seen in the input for this paper, \TeX\ substitutes the sequence |{\csc Unix}|. As another example, one might wish to refer to the backslash character many times in typewriter-font examples (for instance, if one were writing a document about \TeX). In this case, it might be useful to define a control sequence such as |\\| as follows: \begintt \def\\{\char`\\} \endtt After which an example like |\this\example\here| could be typed as \begintt {\tt \\this\\example\\here} \endtt If you have a file containing a group of useful macros and definitions, or even just a useful section of text that you wish to repeat, you can use the \TeX\ primitive |\input|, which operates much like the |.so| primitive of \Troff/. For example, the definitions of |\Section| and so on for this paper are contained in a file called |paperhead.tex|; the first line of this document is |\input paperhead|. If the file to be input isn't in the current working directory, a ``macro library'' directory is searched. This allows commonly-used macro packages, such as the American Mathematical Society's {$\cal A$\kern-.1667em\lower.5ex\hbox{$\cal M$}\kern-.125em $\cal S$-\TeX} package, to be publicly available with a minimum of fuss. It is also possible to generate a separate runnable version of \TeX\ that has a built-in set of macros other than those used by plain \TeX. One such system is the excellent L\kern-.2em\raise.3ex\hbox{\csc a}\kern-.09em\TeX\ document preparation system created by Leslie Lamport of SRI International, which presents a far more complete system for producing complex text documents than plain \TeX. More complex macros with parameters, etc., are possible, but are `big-league' material outside the scope of this paper. The grouping features of \TeX, combined with a powerful set of conditionals, give \TeX\ a structured-language-like appearance, compared to that of \Troff/. The Truly Ambitious should read ``{\sl The \TeX book\/}'' by Donald Knuth, which is the ultimate font of \TeX nical knowledge.