From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- macros/plain/contrib/misc/paragraphs.tex | 91 ++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 macros/plain/contrib/misc/paragraphs.tex (limited to 'macros/plain/contrib/misc/paragraphs.tex') diff --git a/macros/plain/contrib/misc/paragraphs.tex b/macros/plain/contrib/misc/paragraphs.tex new file mode 100644 index 0000000000..c618c54cfb --- /dev/null +++ b/macros/plain/contrib/misc/paragraphs.tex @@ -0,0 +1,91 @@ +% +% some of the old Tbase paragraphing macros (built on Plain TeX) +% +% These macros demonstrate common uses for the +% \hangindent, \hangafter, \indent, \noindent, \everypar, +% \lastbox, and \the commands. +% + +\catcode`\@=11\relax % make @ a letter for use in macro names + +% +% N.B. These macros do not set a ``paragraphing mode,'' as +% they used to in Tbase; they apply only to the immediately +% following paragraph. +% +% The right way to use one of the macros is, e.g., +% +% \ivp This is an inverted paragraph... +% and so on, and so on... +% +\def\ivp {% inverted paragraph, all but 1st line indented + \hangindent \parindent + \hangafter \@ne + \noindent} + +\def\ip {% indented paragraph, all lines indented + \hangindent \parindent + \hangafter \@ne + \indent} + +\def\ftp #1{% flush-tagged paragraph, like \ip but with tag on left margin + \hangindent \parindent + \hangafter \@ne + \noindent \hbox to\parindent{#1\hfil}\ignorespaces} + +\def\atp #1{% adjoint-tagged par, like \ftp but tag is next to first line + \hangindent \parindent + \hangafter \@ne + \indent \llap{#1\enspace}\ignorespaces} + +\def\bpar {% bullet-tagged paragraph + \ftp{$\bullet$}} + + +% +% vest paragraphs: +% After an interruption in the running text (such as a section +% title or in-line illustration), it is customary not to indent +% the first line of the next paragraph. The macro \vp arranges +% for this to be the case by making sure that \unindent gets +% called as soon as the paragraph starts. \unindent simply +% removes the \indent box that TeX automatically puts at the +% start of every paragraph (except those which start with +% \noindent). +% +\def\unindent {% + \setbox0=\lastbox} % get the indent box and discard it + +\def\vp {% + \everypar{\unindent\everypar{}}} + + +% +% the \heading macro puts out a bold-faced unindented heading, +% and then calls \vp to insure that the next paragraph does not +% start with an indentation. +% No break is allowed between the heading and the paragraph. +% +\def\heading #1{% + \vskip 1ex + {\bf\noindent #1\par} + \nobreak + \vskip.5ex + \vp} + + +% +% These next two macros are a convenient way of turning +% indentation off and then on again. The macro \fp +% sets \parindent to 0, but not before defining the macro \pp so +% that it restores \parindent to what it was. The \edef command +% in conjunction with the \the command actually put the +% value of \parindent into the text of the \pp command. +% Do \fp\show\pp to see what this means. +% +\def\fp {\edef\pp{\parindent=\the\parindent}\parindent=\z@} +\let\pp=\relax + + +% make @ back into a non-letter +\catcode`\@=12\relax -- cgit v1.2.3