From c6d93700abb2fcedf57a97a32e13ceb0822330a7 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 24 Oct 2010 23:43:01 +0000 Subject: section in own package + doc (21oct10) git-svn-id: svn://tug.org/texlive/trunk@20180 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/section/section.sty | 691 ++++++++++++++++++++++++ 1 file changed, 691 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/section/section.sty (limited to 'Master/texmf-dist/tex/latex/section') diff --git a/Master/texmf-dist/tex/latex/section/section.sty b/Master/texmf-dist/tex/latex/section/section.sty new file mode 100644 index 00000000000..11fdd0e9f79 --- /dev/null +++ b/Master/texmf-dist/tex/latex/section/section.sty @@ -0,0 +1,691 @@ +% SECTION.STY +% (c) (1992-1994) Oliver Pretzel (o.pretzel@ic.ac.uk) +% Created 29 Oct 94 version 1.4: 10 Mar 99. +% For use with Latex Standard Styles +% Adds control of section heading style to standard LaTeX. +% For LaTeX2.09 (OFSS and NFSS) and LaTeX2e. +% +% Optional features are set to standard. +% +% DOCUMENTATION at end of file +% +% WARNING: conflicts with REFMAN.STY. +% +% ALL RIGHTS RESERVED +% +% This file may be distributed freely. +% It may be modified for local use (please inform me of such modifications) +% Modified versions may only be distributed if +% 1. The name is changed +% 2. A statement acknowledging the modification heads the file. +% +% DO NOT USE \neq in this file +\chardef\neq\the\catcode`\@ +\makeatletter\@makeother\" +% +\typeout{`section.sty' <1.4>} +%************************* +\ifx\reset@font\undefined\let\reset@font\relax\fi +% +% Options +% +\ifx\secindent\undefined + \newdimen\secindent + \newskip\secpreskp + \newskip\secpstskp + \newdimen\subindent + \newskip\subpreskp + \newskip\subpstskp + \newskip\parpstskp + \newcount\c@hddepth +\fi +%implict multiplication removes stretch +\secindent0pt% no indentation +\secpreskp1.2\baselineskip plus .35\baselineskip minus.07\baselineskip +%\secpreskp3.5ex plus 1 ex minus.2ex +\secpreskp-\secpreskp +\secpstskp.8\baselineskip plus .07\baselineskip +%\secpstskp2.3ex plus .2ex +\subindent0pt +\subpreskp1.13\baselineskip plus .35\baselineskip minus.07\baselineskip +%\subpreskp3.25ex plus 1 ex minus.2ex +\subpreskp-\subpreskp +\subpstskp.53\baselineskip plus.07\baselineskip +%\subpstskp1.5ex plus.2ex +\parpstskp-.8\baselineskip +%\parpstskp-1em +\ifx\chapter\undefined + \def\chsize{\Large}\def\hdsize{\huge}\else + \def\chsize{\huge}\def\hdsize{\Huge} +\fi +\let\ttsize\LARGE +\let\ausize\large +\let\dasize\large +\let\hdpos\raggedright +\c@hddepth\z@ +\let\secsize\Large +\let\subsize\large +\let\fpind\relax +% +\def\nmdot{} +\def\cpdot{:} +\def\hdfnt{\reset@font\bf} +\def\ttfnt{\reset@font\rm} +\def\pgfnt{\reset@font\rm} +\def\mkfnt{\reset@font\sl} +\let\mkcse\uppercase +\def\hddot{} +\def\fefnt{\reset@font\bf} +\def\thfnt{\reset@font\it} +% +\def\fnum@figure{\figurename~\thefigure\cpdot} +\def\fnum@table{\tablename~\thetable\cpdot} +% +% +% theorems +% +\def\@begintheorem#1#2{% + \trivlist \item[\hskip \labelsep{\fefnt #1\ #2\hddot}]\thfnt} +\def\@opargbegintheorem#1#2#3{\trivlist + \item[\hskip \labelsep{\fefnt #1\ #2\ (#3)\hddot}]\thfnt} +% +{\@makeother\~ +\long\gdef\@ifempty#1#2#3{\if~#1~#2\else#3\fi} +} +\long\def\@gobifnul#1#2{\@ifempty{#1}\@empty{#1#2}} +%\@Alph and \@alph \relax added to allow \@ifempty test when counter<=0 +\def\@alph#1{% + \ifcase#1\or a\or b\or c\or d\or e\or f\or g\or h\or i\or j\or + k\or l\or m\or n\or o\or p\or q\or r\or s\or t\or u\or v\or w\or x\or + y\or z\else\@ctrerr\fi\relax} +\def\@Alph#1{% + \ifcase#1\or A\or B\or C\or D\or E\or F\or G\or H\or I\or J\or + K\or L\or M\or N\or O\or P\or Q\or R\or S\or T\or U\or V\or W\or X\or + Y\or Z\else\@ctrerr\fi\relax} +%LaTeX 209 +\ifx\@ialph\undefined\else\let\@ialph\undefined\let\@Ialph\undefined\fi +% +% Figures and Tables +% +\long\def\@makecaption#1#2{\vskip 10\p@ + \setbox\@tempboxa\hbox{#1\ #2}\ifdim \wd\@tempboxa >\hsize + #1\ #2\par\else\hbox to\hsize{\hfil\box\@tempboxa\hfil}\fi} +% +% Modified LateX Sectioning Commands +% +\ifx\chapter\undefined +% +%Article +% +\def\part{\par\vskip1.4\baselineskip\@tempskipa\z@ + \@tempskipb\baselineskip\@afterindentfalse\secdef\@part\@spart} +\def\@part[#1]#2{\ifnum \c@secnumdepth >\m@ne\@makesecdot{part}% + \addcontentsline{toc}{part}{\protect\numberline{\thepart\nmdot}{#1}}\else + \addcontentsline{toc}{part}{#1}\fi\@mkboth{}{} + {\parindent\z@\hdpos\interlinepenalty\@M\ifnum\c@secnumdepth>\m@ne + \@ifempty\thepart\@empty{\chsize\hdfnt\partname~\thepart\par\nobreak + \vskip\@tempskipa}\fi}\@spart{#2}} +\def\@spart#1{\@ifempty{#1}\removelastskip{\parindent\z@\hdpos + \interlinepenalty\@M\hdsize\hdfnt#1\par}\nobreak\vskip\@tempskipb + \fpind\@afterheading} +\def\maketitle{\par\begingroup\def\thefootnote{\fnsymbol{footnote}}% + \def\@makefnmark{\hbox to\z@{$\m@th^{\@thefnmark}$\hss}}% + \if@twocolumn\twocolumn[\@maketitle]% + \else\newpage\global\@topnum\z@\@maketitle\fi + \thispagestyle{empty}\@thanks\endgroup + \setcounter{footnote}{0}\let\maketitle\relax\let\@maketitle\relax + \def\@thanks{}\def\@author{}\def\@title{}\let\thanks\relax} +\def\@maketitle{\null \vskip \tw@ em\begin{center}% + {\ttsize\ttfnt\@title\par}\vskip1.2\baselineskip{\ausize\ttfnt%1.5em + \lineskip.4\baselineskip\begin{tabular}[t]{c}\@author\end{tabular}\par}%.5em + \vskip.8\baselineskip{\dasize\ttfnt\@date}\end{center}% 1em + \par\vskip1.2\baselineskip}% 1.5em +\if@twoside + \def\ps@headings{\let\@mkboth\markboth + \def\@oddfoot{}\def\@evenfoot{} + \def\@evenhead{\pgfnt\thepage\hfil\mkfnt\leftmark}% + \def\@oddhead{\mkfnt\rightmark\hfil\pgfnt\thepage}% + \def\sectionmark##1{\markboth{\mkcse{\ifnum\c@secnumdepth>\z@\@gobifnul + \thesection{\@ifempty{##1}\@empty{\nmdot\quad}}\fi##1}}{}}% + \def\subsectionmark##1{\markright{\ifnum\c@secnumdepth>\@ne\@gobifnul + \thesubsection{\@ifempty{##1}\@empty{\nmdot\quad}}\fi##1}}} +\else + \def\ps@headings{\let\@mkboth\markboth + \def\@oddfoot{}\def\@evenfoot{} + \def\@oddhead{\mkfnt\rightmark\hfil\pgfnt\thepage}% + \def\sectionmark##1{\markright{\mkcse{\ifnum\c@secnumdepth>\z@ + \@gobifnul\thesection{\@ifempty{##1}\@empty{\nmdot\quad}}\fi##1}}}} +\fi +\def\ps@myheadings{\let\@mkboth\@gobbletwo + \def\@oddhead{\mkfnt\rightmark \hfil\pgfnt\thepage}\def\@oddfoot{}% + \def\@evenhead{\pgfnt\thepage\hfil\mkfnt\leftmark}\def\@evenfoot{}% + \def\sectionmark##1{}\def\subsectionmark##1{}} +\def\tableofcontents{\makeheading{\contentsname + \@mkboth{\mkcse{\contentsname}}{\mkcse{\contentsname}}}% + \@starttoc{toc}} +\def\listoffigures{\makeheading{\listfigurename + \@mkboth{\mkcse{\listfigurename}}{\mkcse{\listfigurename}}}% + \@starttoc{lof}} +\def\listoftables{\makeheading{\listtablename\@mkboth + {\mkcse{\listtablename}}{\mkcse{\listtablename}}}% + \@starttoc{lot}} +\def\thebibliography#1{\makeheading{\refname\@mkboth + {\mkcse{\refname}}{\mkcse{\refname}}}\list + {\@biblabel{\arabic{enumiv}}}{\settowidth\labelwidth{\@biblabel{#1}}% + \leftmargin\labelwidth\advance\leftmargin\labelsep + \usecounter{enumiv}\let\p@enumiv\@empty + \def\theenumiv{\arabic{enumiv}}}% + \def\newblock{\hskip .11em plus.33em minus.07em}% + \sloppy\clubpenalty4000\widowpenalty4000\sfcode`\.=\@m\relax} +\def\theindex{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi + \columnseprule \z@\columnsep 35\p@\twocolumn[\makeheading{\indexname}]% + \@mkboth{\mkcse{\indexname}}{\mkcse{\indexname}}% + \thispagestyle{plain}\parindent\z@ + \parskip\z@ plus.3\p@\relax\let\item\@idxitem} +\def\l@part{\@tocheadline{0}{1.8\baselineskip}{3em}{\large\bf}}%2.25em +\def\l@section{\@tocheadline{1}{1em}{1.8em}{\bf}} +\def\makeheading{\section*} +\else +% +%Report/Book +% +\def\part{\cleardoublepage\thispagestyle{plain}% + \if@twocolumn\onecolumn\@tempswatrue\else \@tempswafalse\fi + \@tempskipa20\p@\@tempskipb\fill\hbox{}\vfil\secdef\@part\@spart} +\def\@part[#1]#2{\ifnum\c@secnumdepth>-2\@makesecdot{part}% + \addcontentsline{toc}{part}{\protect\numberline{\thepart\nmdot}#1}\else + \addcontentsline{toc}{part}{#1}\fi\@mkboth{}{}% + {\parindent\z@\hdpos\ifnum\c@secnumdepth>-2\@ifempty\thepart\@empty + {\chsize\hdfnt\partname~\thepart\par\vskip\@tempskipa}\fi + \@spart{#2}}} +\def\@spart#1{\@ifempty{#1}\removelastskip{\hdpos\hdsize\hdfnt#1\par}% + \vskip\@tempskipb\newpage\if@twoside\hbox{}\thispagestyle{empty}\newpage\fi + \if@tempswa\twocolumn\fi} +\let\@endpart\undefined +\def\@makeschapterhead#1#2#3#4{\vskip#2{\parindent\z@\hdpos + \if@nobreak\ifnum\c@secnumdepth>\m@ne\@ifempty\thechapter\@empty + {\chsize\hdfnt\@chapapp~\thechapter \par\nobreak\vskip#3}\fi\fi + \@ifempty{#1}\removelastkip{\hdsize\hdfnt#1\par}\nobreak\vskip#4}} +\def\@makechapterhead#1{\hbox{}\@makeschapterhead{#1}{50\p@}{20\p@}{40\p@}} +\def\@chapter[#1]#2{\ifnum\c@secnumdepth>\m@ne\@makesecdot{chapter}% +\typeout{\@chapapp\space\thechapter}\fi\@contmark{chapter}\z@{#1}% + \addtocontents{lof}{\protect\addvspace{10\p@}}% + \addtocontents{lot}{\protect\addvspace{10\p@}}\@nobreaktrue + \if@twocolumn\@topnewpage[\@makechapterhead{#2}]\else\@makechapterhead{#2}\fi + \fpind\@afterheading} +\def\@schapter#1{\@nobreakfalse\if@twocolumn + \@topnewpage[\@makechapterhead{#1}]\else + \@makechapterhead{#1}\fi\fpind\@afterheading} +\if@twoside + \def\ps@headings{\let\@mkboth\markboth\def\@oddfoot{}\def\@evenfoot{}% + \def\@evenhead{\pgfnt\thepage\hfil\mkfnt\leftmark}% + \def\@oddhead{\hbox{}\mkfnt\rightmark\hfil\pgfnt\thepage}% + \def\chaptermark##1{\markboth{\mkcse{\ifnum + \c@secnumdepth>\m@ne\expandafter\@gobifnul\@chapapp\ \@gobifnul + \thechapter{\@ifempty{##1}\@empty{\nmdot\quad}}\fi##1}}{}}% + \def\sectionmark##1{\markright{\mkcse{\ifnum \c@secnumdepth >\z@\@gobifnul + \thesection{\@ifempty{##1}\@empty{\nmdot\quad}}\fi ##1}}}} +\else + \def\ps@headings{\let\@mkboth\markboth + \def\@oddfoot{}\def\@evenfoot{}% + \def\@oddhead{\mkfnt \rightmark \hfil\pgfnt\thepage}% + \def\chaptermark##1{\markright {\mkcse{\ifnum + \c@secnumdepth>\m@ne \expandafter\@gobifnul\@chapapp\ \@gobifnul + \thechapter{\@ifempty{##1}\@empty{\nmdot\quad}}\fi##1}}}} +\fi +\def\ps@myheadings{\let\@mkboth\@gobbletwo + \def\@oddhead{\mkfnt\rightmark \hfil\pgfnt\thepage}% + \def\@oddfoot{}\def\@evenhead{\pgfnt \thepage\hfil\mkfnt + \leftmark}\def\@evenfoot{}% + \def\chaptermark##1{}\def\sectionmark##1{}% + \def\subsectionmark##1{}} +\def\maketitle{\begin{titlepage}% + \let\footnotesize\small \let\footnoterule\relax \setcounter{page}{0}% + \null \vfil \vskip 5\baselineskip \begin{center}% 60pt + {\ttsize\ttfnt\@title\par}\vskip2.45\baselineskip {\ausize\ttfnt\lineskip + .62\baselineskip%3em .75em + \begin{tabular}[t]{c}\@author \end{tabular}\par}% + \vskip 1.25\baselineskip {\dasize \ttfnt \@date \par} \end{center} \par%1.5em + \@thanks \vfil \null \end{titlepage}% + \setcounter{footnote}{0} \let\thanks\relax + \def\@thanks{}\def\@author{}\def\@title{}\let\maketitle\relax}% +\def\tableofcontents{\@restonecolfalse + \if@twocolumn\@restonecoltrue\onecolumn\fi\makeheading{\contentsname + \@mkboth{\mkcse{\contentsname}}{\mkcse{\contentsname}}}% + \@starttoc{toc}\if@restonecol\twocolumn\fi} +\def\listoffigures{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn\fi + \makeheading{\listfigurename\@mkboth{\mkcse{\listfigurename}}% + {\mkcse{\listfigurename}}}\@starttoc{lof}\if@restonecol\twocolumn\fi} +\def\listoftables{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn\fi + \makeheading{\listtablename\@mkboth{\mkcse{\listtablename}}% + {\mkcse{\listtablename}}}\@starttoc{lot}\if@restonecol\twocolumn\fi} +\def\thebibliography#1{\makeheading{\bibname\@mkboth + {\mkcse{\bibname}}{\mkcse{\bibname}}}\list + {\@biblabel{\arabic{enumiv}}}{\settowidth\labelwidth{\@biblabel{#1}}% + \leftmargin\labelwidth\advance\leftmargin\labelsep + \usecounter{enumiv}\let\p@enumiv\@empty + \def\theenumiv{\arabic{enumiv}}}% + \def\newblock{\hskip .11em plus.33em minus.07em}% + \sloppy\clubpenalty4000\widowpenalty4000\sfcode`\.=\@m} +\def\theindex{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi + \columnseprule\z@\columnsep 35\p@\twocolumn\makeheading{\indexname + \@mkboth{\mkcse{\indexname}}{\mkcse{\indexname}}}% + \thispagestyle{plain}\parindent\z@ + \parskip\z@ plus .3\p@\relax\let\item\@idxitem} +\def\l@part{\@tocheadline{\z@}{1.8\baselineskip}{3em}{\large\bf}}%2.25em +\def\l@chapter{\@tocheadline{\@ne}{1em}{1.8em}{\bf}} +\def\makeheading{\chapter*} +\fi +% +%Article, Book, Report +% +\def\section{\@startsection +{section}{\@ne}{\secindent}{\secpreskp}{\secpstskp}{\secsize\hdfnt}} +\def\subsection{\@startsection +{subsection}{\tw@}{\subindent}{\subpreskp}{\subpstskp}{\subsize\hdfnt}} +\def\subsubsection{\@startsection +{subsubsection}{3}{\subindent}{\subpreskp}{\subpstskp}{\normalsize\hdfnt}} +\def\paragraph{\@startsection{paragraph}{4}{\subindent}% +{\subpreskp}{\parpstskp}{\normalsize\hdfnt}} +\def\subparagraph{\@startsection{subparagraph}% +{5}{\parindent}{\subpreskp}{\parpstskp}{\normalsize\hdfnt}} +% +% section layout +% +\def\@makesecdot#1{\expandafter\let\expandafter\@secdot\csname the#1\endcsname + \ifx\@secdot\@empty\else\refstepcounter{#1}\toks@\expandafter{% + \csname p@#1\endcsname}\edef\@secdot{% + \the\toks@\expandafter\@gobifnul\csname the#1\endcsname\nmdot}\fi} + %not \@secdot +\def\@makesvsec#1{\ifind #1<\z@\def\@svsec{\llap{\@secdot}\hskip-#1}\else + \def\@svsec{\@gobifnul\@secdot\quad}\fi} +\def\@contmark#1#2#3{\csname #1mark\endcsname{#3}\addcontentsline + {toc}{#1}{\ifnum #2>\c@secnumdepth\else\protect\numberline{\@secdot}\fi#3}} +\def\@startsection#1#2#3#4#5#6{\if@noskipsec\leavevmode\fi + \par\@tempskipa #4\@afterindenttrue + \ifdim\@tempskipa<\z@\@tempskipa-\@tempskipa\@afterindentfalse\fi + \fpind\if@nobreak\everypar{}\else + \addpenalty{\@secpenalty}\addvspace{\@tempskipa}\fi\@ifstar + {\@ssect{#3}{#5}{#6}}{\@dblarg{\@sect{#1}{#2}{#3}{#5}{#6}}}} +\def\@sect#1#2#3#4#5[#6]#7{\@tempskipa #4\let\@svsec\@empty + \ifnum#2>\c@secnumdepth\else\@makesecdot{#1}\@makesvsec{#3}\fi + \ifdim\@tempskipa>\z@ + \begingroup#5\@hangfrom{\hskip #3\relax\@svsec}{\interlinepenalty + \@M\ifnum#2>\c@hddepth\else\hdpos\fi#7\par}\endgroup + \@contmark{#1}{#2}{#6}\else + \def\@svsechd{\@contmark{#1}{#2}{#6}#5\hskip#3\@svsec + \@gobifnul{#7}\hddot}\fi\@xsect{#4}} +\def\@ssect#1#2#3#4{\@tempskipa #2\relax\ifdim \@tempskipa>\z@ + \begingroup #3\@hangfrom{\ifind #1< \z@\else \hskip #1\fi}{\interlinepenalty + \@M\ifnum#2>\c@hddepth\else\hdpos\fi#4\par}\endgroup\else + \def\@svsechd{#3\ifind #1<\z@\else + \hskip #1\fi\@gobifnul{#4}\hddot}\fi\@xsect{#2}} +\let\ifind\ifdim +% +% contents lines +% +\def\@tocheadline#1#2#3#4#5#6{\ifnum#1>\c@tocdepth\else + \addpenalty\@secpenalty\vskip#2 plus\p@\begingroup + \interlinepenalty\@M\rightskip\@tocrmarg\parfillskip-\@tocrmarg + \secindent#3\noindent\leavevmode\hangindent\secindent + \reset@font\rm#4#5\@tocpagenum{#6}\par\endgroup + \penalty\@highpenalty\fi} +\def\@dottedtocline#1#2#3#4#5{\ifnum #1>\c@tocdepth \else + \vskip \z@ plus.2\p@\begingroup\leftskip#2\interlinepenalty\@M + \rightskip\@tocrmarg\parfillskip-\@tocrmarg\secindent#3% + \noindent\leavevmode\hangindent\secindent\reset@font\rm#4\nobreak\leaders + \hbox{$\m@th \mkern \@dotsep mu.\mkern \@dotsep mu$}\hfill \nobreak + \hbox to\@pnumwidth{\hfil\reset@font\rm #5}\par\endgroup\fi} +\def\@tocpagenum#1{\nobreak\hfill\nobreak\hbox to\@pnumwidth{\hss#1}} +\def\numberline#1{\hbox to \secindent{#1\hfil} } +% +% REDEFINITIONS here: +% +% This line must be last line of code +\catcode`\@\neq\let\neq\ne\endinput + +******************* + DOCUMENTATION +******************* +Leslie Lamport in writing LaTeX assumed that authors would write +complete .sty (.clo) files to implement the design decisions for their +publications. However, the overwhelming majority of LaTeX publications use the +standard styles supplied by Lamport. These implement a particular set of +typographic conventions, which while consistent are not of universal validity, +for instance many publishers and authors would like a full stop: +`4. Introduction' +rather than +`4 Introduction'. + +This file modifies the standard classes so that other conventions can be +more easily implemented. Careful use of the file will allow a greater +variation in the appearance of LaTeX documents. + +0. Changes to section implementation. +The file redefines the way LaTeX deals with negative indents for section +headings, placing the number in the margin and the heading itself flush +with the margin. With negative indents it sets starred section headings +flush (as it does when \thesection is empty. +Standard LaTeX indenting can be produced by typing +>> \let\ifind\iffalse +This file's version can be reestablished by typing +>> \let\ifind\ifdim + +The file also changes the way LaTeX reacts to empty numbers when sections have +non-negative indents, placing the heading where the number would go, rather +than further indented (as in standard LaTeX). +This effect can be removed by redefining an internal macro \@makesvsec (see +below). + +The indents, pre- and postskips for section headings are placed in registers +so that they are constant throughout a document and (just as the heading sizes) +do not react to surrounding size changes. You can change this back to ordinary +LaTeX behaviour by \def ing them as macros rather than setting the register +values (in that case you should probably use \smaller\larger from +SMALLER.STY for the \...size commands). + +WARNING LaTeX typesets headings that run on by manipulating \everypar. If you +make local changes to the heading style of such a section inside braces or a +group you must ensure that a non-empty paragraph occurs before the closing +brace. Otherwise some strange effects may occur, because the \everypar tokens +will be evaluated outside the group (this is a feature of LaTeX, not of +SECTION.STY). If your group ends with an empty section of this type just +follow it with \leavevmode or an explicit space: \ . + +A detailed description of the format of LaTeX sectioning commands is given +below (in paragraph 9). This is partially taken from the file LATEX.TEX. +We first list the macros for local control which you can use without knowing +this structure. + +The file sets vertical distances that LaTeX expressed in terms of `em's and +`ex's in equivalent `\baselineskip's, as `em' is a measure of the horizontal +size of a font and `ex' is not a true measure of the full height of a line. +Earlier vesions used `ex's. + +The original values are placed as comments. + +1. Sizing commands for Parts, Chapters and Titles etc +These are set to \large or whatever + +>> \chsize: Chapter, Part Heading (\LARGE\large) +>> \hdsize: Chapter, Part Title Text (\Huge\huge\LARGE) +>> \ttsize: Title of Document (\Huge\huge\LARGE) +>> \ausize: Author (\LARGE\Large) +>> \dasize: Date. (\Large\large) +>> \secsize: Section (\Large\large) +>> \subsize: Subsection (\large\normalsize) + subsubsection and below use \normalsize + +2. Layout commands for headings. +>> \hdpos: Positioning of heading (\raggedright) (\centering \raggedleft) + (see section 9); +>> counter hddpth (default 0) + Maximum section level for \hdpos (chapters and parts ALWAYS use hdpos). + To centre section headings and above: + \let\hdpos\centering\setcounter{hddepth}{1} +>> \fpind: Indenting of first paragraph after \Part \Chapter + and also to override setting via preskip for sections. + \let to \@afterindenttrue to indent, \@afterindentfalse for flush, + \relax: flush after \Part \Chapter, negative preskips; indented otherwise + (LaTeX default behaviour). + +3. Fonts +>> \ttfnt: font for title entries. +>> \hdfnt: font for all other headings (Part, Chapter..subparagraph). +>> \fefnt: font for theorem headings and description labels (fe=feature). +>> \thfnt: font for theorem statements. +>> \pgfnt: font for page numbers. +>> \mkfnt: font for page headings (mk=mark). +>> \mkcse: case for page headings. + These can also be used to add other initial commands such as spaces or + symbols. + +4. Optional punctuation (standard|my preference) + These marks are transferred via auxiliary files for tables of contents etc. + They should be \def'd if their current value is to be transferred, and \let + if the value in force when the file auxiliary is read should be used. + +>> \hddot ({}|.) (after inline headings, theorems etc) +>> \cpdot (:|.) (in figure/table captions - also apears in list of figures. +>> \nmdot ({}|.) (after section numbers etc) + +If these are \let to a single letter they are not expanded in the + .toc.. files. So to remove \cpdot from list of figures: + \let\cpdot\relax\listoffigures\let\cpdot: + +5. Spacing parameters. + The macros for chapters and parts have been altered so that all the + vertical spacing commands are in a single macro in each case. + +>> \part inserts initial vertical space directly (preceded by \hbox{} if it + is to be immovable) and passes the space between Part n and title + in \@tempskipa and the space below the heading in \@tempskipb. +>> Both \chapter and \chapter* call \@makechapterhead{chaptertitle}. + This passes {chaptertitle} on to \@makeschapterhead together with the + vertical spacing. Default setting is + \def\@makechapterhead#1{\hbox{}\@makeschapterhead{#1}{50\p@}{20\p@}{40\p@}} + \hbox{} makes first skip immovable, + the first length is space above the heading, + The second is the space between Chapter nn and the chapter title + The third is the space below the heading. + For both Part and Chapter the middle space is removed if either the + section name or title are missing. + If both are missing, the first space is also removed + +>> For sections and below the spaces are kept in registers: + \secpreskp and \secpsrskp \secindent used for \section + \subpreskp and \subpstskp \subindent used for \subsection/\subsubsection + \paragraph uses \subindent \subpreskp \parpstskp + \subparagraph uses \parindent \subpreskp \parpstskp + +>> \secindent \subindent Heading indentation +>> \secpreskp \subpreskp Space before +>> \secpstskp \subpstskp \parpstskp Space after. + +6. Internal modifications + + Sections with negative indents have heading flush with margin. + + If \thesection is \empty + \let\thesection\empty or \def\thesection{} + then section does not step the section counter. + If the section produces empty output for a value then + the section will start flush at the margin or \secindent if it is positive + and there will be no \nmdot. + It will produce (flush) page headings and a table of contents entry. + Similarly if \thechapter or \thepart are defined to be empty they will + suppress the heading line `Chapter..' and not step the counter. + To restore standard LaTeX behaviour temporarily define \thesection to be + \empty + \def\thesection{\empty} + In that case you can adjust post number spacing in the heading. + \section[Heading]{\hskip-1em Heading} + You can also redefine \@makesecdot see paragraph 7. + +WARNING \letting \thesection etc to an unexpandable token (like \relax) will +cause strange effects under LaTeX because its value will not be expanded. + + \maketitle suppresses page headings (\thispagestyle{empty}) and only resets + \@title etc locally. So place in a group if you want to preserve these for + later reference (eg. in headers). + +7. New internal macros + Place any modifications in the section REDEFINITIONS of the main code + +> \@secdot contains section number and \nmdot if the number is non-empty. +> \@makesecdot{NAME} defines \@secdot. + To make LaTeX step the section counter independently of the definition + of \thesection and always print \nmdot: + \def\@makesecdot#1{\refstepcounter{#1}% + \edef\@secdot{\csname the#1\endcsname}} + If you want \nmdot suppressed when \thesection produces no output: + \def\@makesecdot#1{\refstepcounter{#1}% + \edef\@secdot{\expandafter\@gobifnul\csname the#1\endcsname\nmdot}} +> \@makesvsec{INDENT} defines the \@svsec macro used by LaTeX to typeset the + section number.. Its parameter is the indent so that it can react + differently to negative indents. (it does NOT make the indent). + To obtain standard LaTeX behaviour: + \def\@makesvsec#1{\def\@svsec{\@secdot\quad}} + To make positioning commands apply to the heading ignoring the number: + \def\@makesvsec#1{\def\@svsec{\llap{@secdot\quad}}} + Do NOT forget the #1. +> \@contmark{NAME}{LEVEL}{HEADING} makes contents line and sectionmark. + + Contents headlines are defined by +> \@tocheadline + This allows these lines to be adjusted similarly to the \@dottedtocline + commands for other contents lines. The format of these is defined below (in + paragraph 11). +>@tocpagenum#1 sets #1 flush right in \@tocheadline. + Redefine (\let\@tocpagenum\@gobble) to remove page numbers. + \def\l@part{\@tocheadline{0}{2.25em}{3em}{\let\@tocpagenum\@gobble + \centering\large\bf}} + Centres parts lines of contents but leaves chapters unchanged + \def\l@part{\@tocheadline{0}{2.25em}{3em}{\let\@tocpagenum\@gobble + \centering\def\numberline##1{\hskip-\secindent + \hbox to\secindent{##1\hfil}}\large\bf}} + Same but centring ignores part number. + \def\l@part{\@tocheadline{0}{2.25em}{3em}{\let\@tocpagenum\@gobble + \centering\def\numberline##1{\hfilneg + \hbox to\z@{##1\hss}\hfil}\large\bf}} + Centres heading with number flush left + Contents lines use \secindent as a temporary register + +>\makeheading (set to \section*, \chapter*) + Makes headings for contents, index etc. + To put Contents itself in the contents list, redefine (locally): + \let\thesection\empty\let\makeheading\section + +8. Additional macros +> \@ifempty{test}{yes}{no} like \@ifundefined but tests for empty + (fails iff test starts with ~ of catcode 12 (other) ). +> \@gobifnul{a}{b} = \@ifempty{a}{}{ab}. + +9. Description of sectioning values + + \@startsection {NAME}{LEVEL}{INDENT}{PRESKIP}{POSTSKIP}{STYLE} + optional * [ALTHEADING]{HEADING} + Generic command to start a section. + + NAME : e.g., 'subsection' must be the name of a section counter + LEVEL : a number, denoting depth of section -- section=1; + number increases down the hierarchy. + INDENT : Indentation of heading from left margin + PRESKIP : Absolute value = skip to leave above the heading. + If negative, then paragraph indent of text following + heading is suppressed. + POSTSKIP : if positive, then skip to leave below heading, else + negative of skip to leave to right of run-on heading. + ALTHEADING : for page headings and contents. + STYLE : commands to set style + If '*' missing, then increments the counter. If it is present, then + there should be no [ALTHEADING] argument. + Uses the counter 'secnumdepth' whose value is the highest section + level that is to be numbered and entered into \@dottedtocline. + +10. Treatment of Section Entries + + NAME (fixed) Determines the counter to use. + + LEVEL (fixed) If level is greater than \counter{secnumdepth} (default 2) no + indexentry or number + + INDENTS: \secindent (sections), \subindent (subsections,...,paragraphs). + Subparagraphs have \parindent fixed. These are dimensions. + + Recommended: +-\parindent or 0pt + + If indent is negative then SECTION.STY causes the section number to be set + flush right that distance from margin. Heading or text follows at the margin + itself. + + Unnumbered headings are set at the margin if indent is negative. If the + indent is non-negative they are set flush left with the number position. + + PRESKIPS \secpreskp (sections), \subpreskp(subsections..subparagraphs) + POSTSKIPS \secpstskp (sections),\subpstskp(subsections,subsubsections) + \parpstskp (paragraphs,subparagraphs) + + Recommended: leave PRESKIPS' abs values unchanged, They are set -ve to + have flush first paragraphs. Use \secpreskp-\secpreskp to indent them. + Recommended: set POSTSKIPS to -1em or -\parindent to make sections run on. + + By assigning these values to registers SECTION.STY makes them independent of + the surrounding font and size. Set the registers if you want this, redefine + them as macros if you want them to be font and size dependent. + + STYLE \secsize \subsize \hdfnt size and fonts. + \secsize for sections, + \subsize for subsections. + Subsubsections and below have \normalsize (fixed). + \hdfnt is universal for all headings. + +11. Contents entries. + + \@tocheadline{LEVEL}{PRESKIP}{INDENT}{STYLE}{ENTRY}{PAGENUM} + \@dottedtocline{LEVEL}{MARGIN}{INDENT}{ENTRY}{PAGENUM} + + LEVEL : determines if entry made. + PRESKIP : vertical gap above. + INDENT : This must leave enough room for the chapter or section number + : It is added to the margin for the next level. + MARGIN : Left margin inherited from level above (zero for headlines). + STYLE : Font sizing and setting. + + LaTeX assumes that the ENTRY for sections be defined by a macro \l@section. + These are defined in the standard document styles but can be changed. + All entries of the \l@section commands are fixed. SECTION.STY does not + change the commands using \@dottedtocline in the style file. Those that do + not do so (\l@part, \l@chapter) are modified to use \@tocheadline. + + INDENT for sections in {article} and chapters in {report} is rather tight at + 1.5em. If you increase it should also increase the MARGINS for lower + sections. + +12. The following internal LaTeX macros are redefined: + + \part\@part\@spart\@endpart + \@chapter\@schapter (also \fi moved) + \@makechapterhead functions of these have been significantly + \@makeschapterhead changed. + + \ps@headings\ps@myheadings + \section\subsection + \subsubsection\paragraph + \subparagraph + \thebibliography + \theindex + \@begintheorem + \@oparbegintheorem + \@makecaption optional style features added + \@startsection \fpind and does not pass #4 to \@sect,\@ssect + \@sect,\@ssect ignored parameter removed + \llap \@secdot used to adjust spacing + if \p@section defined used for number style. + calls \@makesecdot + \@sect only: \@makesvsec and + \@contmark, which is moved in + \@svsechd so that \unskip in \@xsect works). + \maketitle\@maketitle suppress page number, reset \@title.. locally + \numberline adds space after number, so overfull box if + too close to heading. + +CHANGES + Ver 1.3 (3.Apr 98) + If \secindent < 0, then \section* produces a flush heading, not outdented. + \hdpos takes level as parameter and is used for all sections, not just + \part and \chapter. + `ex' measurements replaced by \baselineskip equivalents. + Ver 1.31 + Bugfix: \relax added to \@alph, \@Alph to enable use with \@ifempty test. + Ver 1.32 + Bugfixes: \hdpos added to \@ssect, unused macro \secpos removed, + \nobreak added after \thechapter in \makechapterhead + Ver 1.4 + \hdpos made simple macro again. Counter \hddepth determines when it + should be used. Functions of \@makechapterhead, \@smakechapterhead + changed to make editing vertical spacing of chapters easier. + \part\@part\@spart rewritten so that all spacing info in \part. + \part calls \@spart which finishes off the heading. + Memory use < 200 words. +End of SECTION.STY \ No newline at end of file -- cgit v1.2.3