Commit f46285d1 by Karl Berry

(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.

From-SVN: r12571
parent 57e23b29
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
% This automatically updates the version number based on RCS. % This automatically updates the version number based on RCS.
\def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}} \def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}}
\deftexinfoversion$Revision: 2.174 $ \deftexinfoversion$Revision: 1.1 $
\message{Loading texinfo package [Version \texinfoversion]:} \message{Loading texinfo package [Version \texinfoversion]:}
% If in a .fmt file, print the version number % If in a .fmt file, print the version number
...@@ -592,6 +592,9 @@ where each line of input produces a line of output.} ...@@ -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.} ...@@ -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.} ...@@ -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.} ...@@ -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.} ...@@ -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.} ...@@ -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 ...@@ -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 ...@@ -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}}
% Section fonts are the base font at magstep2, which produces \def\subsecheading#1#2#3#4{\sectionheading{subsec}{#2.#3.#4}{#1}}
% a size a bit more than 14 points in the default situation.
\def\secheading #1#2#3{\secheadingi {#2.#3\enspace #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 }
% Subsubsection titles.
\let\subsubsecheadingskip = \subsecheadingskip
\let\subsubsecheadingbreak = \subsecheadingbreak
\def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec}{#2.#3.#4.#5}{#1}}
% Subsection fonts are the base font at magstep1,
% which produces a size of 12 points.
\def\subsecheading #1#2#3#4{\subsecheadingi {#2.#3.#4\enspace #1}} % Print any size section title.
\def\subsecheadingi #1{{\advance \subsecheadingskip by \parskip % %
\subsecheadingbreak}% % #1 is the section type (sec/subsec/subsubsec), #2 is the section
{\subsecfonts \vbox{\hyphenpenalty=10000\tolerance=5000 % number (maybe empty), #3 the text.
\parindent=0pt\raggedright \def\sectionheading#1#2#3{%
\rm #1\hfill}}% {%
\ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 } \expandafter\advance\csname #1headingskip\endcsname by \parskip
\csname #1headingbreak\endcsname
\def\subsubsecfonts{\subsecfonts} % Maybe this should change: }%
% Perhaps make sssec fonts scaled {%
% magstep half \csname #1fonts\endcsname \rm
\def\subsubsecheading #1#2#3#4#5{\subsubsecheadingi {#2.#3.#4.#5\enspace #1}} \def\secnum{#2}%
\def\subsubsecheadingi #1{{\advance \subsecheadingskip by \parskip % % Only insert the separating space if we have a section number.
\subsecheadingbreak}% \setbox0 = \hbox{#2\ifx\secnum\empty\else \enspace \fi}%
{\subsubsecfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
\parindent=0pt\raggedright \hangindent = \wd0 % zero if no section number
\rm #1\hfill}}% \unhbox0 #3}%
\ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000} }%
\ifdim\parskip<10pt \nobreak\kern10pt\nobreak\kern-\parskip\fi \nobreak
}
\message{toc printing,} \message{toc printing,}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment