From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- info/examples/tip/genhead.tip | 100 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 info/examples/tip/genhead.tip (limited to 'info/examples/tip/genhead.tip') diff --git a/info/examples/tip/genhead.tip b/info/examples/tip/genhead.tip new file mode 100644 index 0000000000..44588f7dfd --- /dev/null +++ b/info/examples/tip/genhead.tip @@ -0,0 +1,100 @@ +% This macro source file is from the four volume series +% "TeX in Practice" by Stephan von Bechtolsheim, published +% 1993 by Springer-Verlag, New York. +% Copyright 1993 Stephan von Bechtolsheim. +% No warranty or liability is assumed. +% This macro may be copied freely if no fees other than +% media cost or shipping charges are charged and as long +% as this copyright and the following source code itself +% is not changed. Please see the series for further information. +% +% Version: 1.0 +% Date: May 1, 1993 +% +% +% This source code is documented in 11.5.5, p. II-93. +% Original source in file "par2.TEX", starting line 2264. +\wlog{L: "genhead.tip" ["par2.TEX," l. 2264, p. II-93]}% +% This file DOES belong to format "texip." +\InputD{vsmax.tip} +\InputD{box-mac.tip} +\InputD{parin.tip} +\newtoks\EveryHeading +\EveryHeading = {} +\catcode`\@ = 11 +\newcount\@GenericHeadingCount +\newcount\@GenericHeadingIndent +\def\LineBreakHeading{% + \errmessage{% + \string\LineBreakHeading/\string\LineBreakToc: + can only be used inside a heading.}% +} +\let\LineBreakToc = \LineBreakHeading +\def\IgnoreInRunnningHead #1{% + #1% +} +\def\GenericHeading #1#2#3#4#5{% + \par + \the\EveryHeading + \@GenericHeadingCount = #1 + \@GenericHeadingIndent = #5 + \MaxVskip{#2}% + \ifdim\leftskip = 0pt + \else + \message{\string\GenericHeading: \noexpand\leftskip + is non-zero, forgotten to terminate a list?}% + \fi + \begingroup + \interlinepenalty = 10000 + \parindent = 0pt + \parskip = 0pt + \ifnum #4 = 1 + \hyphenpenalty = 10000 + \fi + \ifnum #3 = 1 + \rightskip = 0pt plus 50pt + \fi + \@GenericHeading +} +\def\@GenericHeading #1#2#3#4#5#6#7{% + #3% + \def\LineBreakHeading{\hfil\break}% + \def\LineBreakToc{ }% + \ifdim #4 > 0pt + \ifnum\@GenericHeadingIndent = 0 + \hangindent = #4 + \hangafter = 1 + \leavevmode + \hbox to #4{#5\hfil}% + \else + \leavevmode + \hbox to #4{#5\hfil}% + \fi + \else + \setbox0 = \hbox{#5\hskip -#4} + \ifnum\@GenericHeadingIndent = 0 + \hangindent = \wd0 + \hangafter = 1 + \leavevmode + \box0 + \else + \leavevmode + \box0 + \fi + \fi + #6% + \if\NameDefinedConditional{WriteToAuxSpecial}% + \def\LineBreakToc{\hfil\break}% + \def\LineBreakHeading{ }% + \WriteToAuxSpecial{toc}{\the\@GenericHeadingCount}% + {#5}{#7}{\PrintCounter{PageNo}}% + \fi + \par + \endgroup + \nobreak + \vskip #1 + \ifnum #2 = 0 + \SuppressNextParIndent + \fi +} +\catcode`\@ = 12 -- cgit v1.2.3