(paragraphindent): Move to more reasonable place in the source file.

(chapfonts, secfonts, subsecfonts, indexfonts): Call \setleading.
(\chfplain, \secheading, \plainsecheading, \subsecheading,
 \subsubheading): Rewrite to properly \hangindent the title.
(\sectionheading): New generic macro to print section titles.
This commit is contained in:
Karl Berry 1996-07-28 20:57:40 +00:00
parent cca242e6e3
commit 3863dbeb03

View File

@ -592,6 +592,9 @@ where each line of input produces a line of output.}
\let\c=\comment \let\c=\comment
% @paragraphindent is defined for the Info formatting commands only.
\let\paragraphindent=\comment
% Prevent errors for section commands. % Prevent errors for section commands.
% Used in @ignore and in failing conditionals. % Used in @ignore and in failing conditionals.
\def\ignoresections{% \def\ignoresections{%
@ -1028,7 +1031,7 @@ where each line of input produces a line of output.}
\setfont\deftt\ttshape{10}{\magstep1} \setfont\deftt\ttshape{10}{\magstep1}
\def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf} \def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf}
% Fonts for indices and small examples. % Fonts for indices and small examples (9pt).
% We actually use the slanted font rather than the italic, % We actually use the slanted font rather than the italic,
% because texinfo normally uses the slanted fonts for that. % because texinfo normally uses the slanted fonts for that.
% Do not make many font distinctions in general in the index, since they % Do not make many font distinctions in general in the index, since they
@ -1045,7 +1048,7 @@ where each line of input produces a line of output.}
\font\indi=cmmi9 \font\indi=cmmi9
\font\indsy=cmsy9 \font\indsy=cmsy9
% Fonts for headings % Chapter (and unnumbered) fonts (17.28pt).
\setfont\chaprm\rmbshape{12}{\magstep2} \setfont\chaprm\rmbshape{12}{\magstep2}
\setfont\chapit\itbshape{10}{\magstep3} \setfont\chapit\itbshape{10}{\magstep3}
\setfont\chapsl\slbshape{10}{\magstep3} \setfont\chapsl\slbshape{10}{\magstep3}
@ -1057,6 +1060,7 @@ where each line of input produces a line of output.}
\font\chapi=cmmi12 scaled \magstep2 \font\chapi=cmmi12 scaled \magstep2
\font\chapsy=cmsy10 scaled \magstep3 \font\chapsy=cmsy10 scaled \magstep3
% Section fonts (14.4pt).
\setfont\secrm\rmbshape{12}{\magstep1} \setfont\secrm\rmbshape{12}{\magstep1}
\setfont\secit\itbshape{10}{\magstep2} \setfont\secit\itbshape{10}{\magstep2}
\setfont\secsl\slbshape{10}{\magstep2} \setfont\secsl\slbshape{10}{\magstep2}
@ -1082,6 +1086,7 @@ where each line of input produces a line of output.}
%\let\ssecbf=\ssecrm %\let\ssecbf=\ssecrm
% Subsection fonts (13.15pt).
\setfont\ssecrm\rmbshape{12}{\magstephalf} \setfont\ssecrm\rmbshape{12}{\magstephalf}
\setfont\ssecit\itbshape{10}{1315} \setfont\ssecit\itbshape{10}{1315}
\setfont\ssecsl\slbshape{10}{1315} \setfont\ssecsl\slbshape{10}{1315}
@ -1127,22 +1132,23 @@ where each line of input produces a line of output.}
\let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
\let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
\let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl
\resetmathfonts} \resetmathfonts \setleading{19pt}}
\def\secfonts{% \def\secfonts{%
\let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
\let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
\let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl
\resetmathfonts} \resetmathfonts \setleading{16pt}}
\def\subsecfonts{% \def\subsecfonts{%
\let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
\let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
\let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl
\resetmathfonts} \resetmathfonts \setleading{15pt}}
\let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf?
\def\indexfonts{% \def\indexfonts{%
\let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl
\let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc
\let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy \let\tenttsl=\indttsl \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy \let\tenttsl=\indttsl
\resetmathfonts} \resetmathfonts \setleading{10pt}}
% Set up the default fonts, so we can use them for creating boxes. % Set up the default fonts, so we can use them for creating boxes.
% %
@ -2932,15 +2938,18 @@ width0pt\relax} \fi
\global\let\unnumbchapmacro=\unnchfplain \global\let\unnumbchapmacro=\unnchfplain
\global\let\centerchapmacro=\centerchfplain} \global\let\centerchapmacro=\centerchfplain}
% #1 is the text, #2 the chapter number.
\def\chfplain #1#2{% \def\chfplain #1#2{%
\pchapsepmacro \pchapsepmacro
{% {%
\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \chapfonts \rm
\parindent=0pt\raggedright \setbox0 = \hbox{#2\enspace}%
\rm #2\enspace #1}% \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
\hangindent = \wd0
\unhbox0 #1}%
}% }%
\bigskip \nobreak\bigskip % no page break after a chapter title
\penalty5000 \nobreak
} }
\def\unnchfplain #1{% \def\unnchfplain #1{%
@ -2981,51 +2990,44 @@ width0pt\relax} \fi
\global\let\unnumbchapmacro=\unnchfopen \global\let\unnumbchapmacro=\unnchfopen
\global\let\centerchapmacro=\centerchfopen} \global\let\centerchapmacro=\centerchfopen}
% Parameter controlling skip before section headings.
\newskip \subsecheadingskip \subsecheadingskip = 17pt plus 8pt minus 4pt
\def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}}
% Section titles.
\newskip \secheadingskip \secheadingskip = 21pt plus 8pt minus 4pt \newskip \secheadingskip \secheadingskip = 21pt plus 8pt minus 4pt
\def\secheadingbreak{\dobreak \secheadingskip {-1000}} \def\secheadingbreak{\dobreak \secheadingskip {-1000}}
\def\secheading#1#2#3{\sectionheading{sec}{#2.#3}{#1}}
\def\plainsecheading#1{\sectionheading{sec}{}{#1}}
% @paragraphindent is defined for the Info formatting commands only. % Subsection titles.
\let\paragraphindent=\comment \newskip \subsecheadingskip \subsecheadingskip = 17pt plus 8pt minus 4pt
\def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}}
\def\subsecheading#1#2#3#4{\sectionheading{subsec}{#2.#3.#4}{#1}}
% Section fonts are the base font at magstep2, which produces % Subsubsection titles.
% a size a bit more than 14 points in the default situation. \let\subsubsecheadingskip = \subsecheadingskip
\let\subsubsecheadingbreak = \subsecheadingbreak
\def\secheading #1#2#3{\secheadingi {#2.#3\enspace #1}} \def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec}{#2.#3.#4.#5}{#1}}
\def\plainsecheading #1{\secheadingi {#1}}
\def\secheadingi #1{{\advance \secheadingskip by \parskip %
\secheadingbreak}%
{\secfonts \vbox{\hyphenpenalty=10000\tolerance=5000
\parindent=0pt\raggedright
\rm #1\hfill}}%
\ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 }
% Subsection fonts are the base font at magstep1, % Print any size section title.
% which produces a size of 12 points. %
% #1 is the section type (sec/subsec/subsubsec), #2 is the section
\def\subsecheading #1#2#3#4{\subsecheadingi {#2.#3.#4\enspace #1}} % number (maybe empty), #3 the text.
\def\subsecheadingi #1{{\advance \subsecheadingskip by \parskip % \def\sectionheading#1#2#3{%
\subsecheadingbreak}% {%
{\subsecfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \expandafter\advance\csname #1headingskip\endcsname by \parskip
\parindent=0pt\raggedright \csname #1headingbreak\endcsname
\rm #1\hfill}}% }%
\ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 } {%
\csname #1fonts\endcsname \rm
\def\subsubsecfonts{\subsecfonts} % Maybe this should change: \def\secnum{#2}%
% Perhaps make sssec fonts scaled % Only insert the separating space if we have a section number.
% magstep half \setbox0 = \hbox{#2\ifx\secnum\empty\else \enspace \fi}%
\def\subsubsecheading #1#2#3#4#5{\subsubsecheadingi {#2.#3.#4.#5\enspace #1}} \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
\def\subsubsecheadingi #1{{\advance \subsecheadingskip by \parskip % \hangindent = \wd0 % zero if no section number
\subsecheadingbreak}% \unhbox0 #3}%
{\subsubsecfonts \vbox{\hyphenpenalty=10000\tolerance=5000 }%
\parindent=0pt\raggedright \ifdim\parskip<10pt \nobreak\kern10pt\nobreak\kern-\parskip\fi \nobreak
\rm #1\hfill}}% }
\ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000}
\message{toc printing,} \message{toc printing,}