加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
secsty.sty 21.14 KB
一键复制 编辑 原始数据 按行查看 历史
xyt556 提交于 2018-10-10 14:56 . Initial ShareLaTeX Import
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600
%%
%% This is file `sectsty.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% sectsty.dtx (with options: `package')
%%
%% IMPORTANT NOTICE:
%%
%% For the copyright see the source file.
%%
%% You are *not* allowed to modify this file.
%%
%% You are *not* allowed to distribute this file.
%% For distribution of the original source see the terms
%% for copying and modification in the file sectsty.dtx.
%%
%%
%% \CheckSum{1463}
%% \CharacterTable
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%% Digits \0\1\2\3\4\5\6\7\8\9
%% Exclamation \! Double quote \" Hash (number) \#
%% Dollar \$ Percent \% Ampersand \&
%% Acute accent \' Left paren \( Right paren \)
%% Asterisk \* Plus \+ Comma \,
%% Minus \- Point \. Solidus \/
%% Colon \: Semicolon \; Less than \<
%% Equals \= Greater than \> Question mark \?
%% Commercial at \@ Left bracket \[ Backslash \\
%% Right bracket \] Circumflex \^ Underscore \_
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
\ProvidesPackage{sectsty}[1999/04/12 v2.0.1 Commands to change all
sectional heading styles]
\NeedsTeXFormat{LaTeX2e}[1998/06/01]
\long\def\SS@ocl#1#2#3{\ifnum #1>\SS@chatlevel #2\else #3\fi}
\def\SS@oclto#1#2{\SS@ocl{#1}{\typeout{#2}}{}}
\def\SS@chatlevel{3}
\DeclareOption{garrulous}{\def\SS@chatlevel{0}}
\DeclareOption{chatty}{\def\SS@chatlevel{1}}
\DeclareOption{taciturn}{\def\SS@chatlevel{2}}
\DeclareOption{yorkshire}{\def\SS@chatlevel{3}}
\ProcessOptions
\let\@svsec\relax
\newcommand{\nohang}{\let\@hangfrom\@empty}
\let\SS@origunderline\underline
\CheckCommand*{\underbar}[1]%
{\underline{\sbox\tw@{#1}\dp\tw@\z@\box\tw@}}
\newcommand*{\SS@ulemsectuline}[2]{%
\ifhmode% run-in head
\begingroup%
\def\hskip##1\relax##2\@@par{\endgroup\@@hskip##1\relax#1{##2}}%
\else% stand alone head
% \ifx\\\@centercr\let\@hangfrom\@empty\fi% deal with \@hangfrom prob
\protected@edef\@svsec{\noexpand#1{\@svsec\strut}}% added strut
\def\interlinepenalty##1##2\@@par{\@@interlinepenalty##1#1{##2}\@@par}%
\fi%
#2\@@par}% added strut here then removed it (stupid boy)
\let\@@hskip\hskip
\let\@@interlinepenalty\interlinepenalty
\CheckCommand*{\underline}[1]{%
\relax
\ifmmode\@@underline{#1}%
\else $\@@underline{\hbox{#1}}\m@th$\relax\fi}
\def\SS@underline#1{%
\relax
\ifmmode\@@underline{\strut#1}%
\else $\@@underline{\hbox{\strut#1}}\m@th$\relax\fi}
\def\SS@ulemheadingchapfudge#1#2{%
\ifSS@komascript%
\ifnum\SSsectlevel=1% chapter level
\ifx\SS@headingpart\SS@nopartid%
\SS@oclto{1}{Koma-script chapter number part}%
\let\SS@savechapterformat\chapterformat%
\def\chapterformat{#1{\SS@savechapterformat}}%
\def\@tempcmda{#2}%
\else%
\SS@oclto{1}{Koma-script chapter title part}%
\def\@tempcmda{#1{#2}}%
\fi%
\else%
\SS@oclto{1}{Koma-script not chapter}%
\def\@tempcmda{#1{#2}}%
\fi%
\else%
\SS@oclto{1}{Not Koma-script}%
\def\@tempcmda{#1{#2}}%
\fi%
\@tempcmda
}%
\AtBeginDocument{%
\@ifundefined{UL@box}%
{% if ulem has not been loaded
\SS@oclto{1}{ulem not loaded; underlining setup}%
\def\SS@makeulinesect{%
\def\underbar##1{\SS@origunderline{\sbox\tw@{##1}\dp\tw@\z@\box\tw@}}%
\def\underline{\SS@ulemsectuline{\SS@underline}}%
\def\ulemheading##1{\SS@ulemsectuline{\SS@underline}}}%
\def\SS@makeulinepartchap{%
\def\underbar##1{\SS@origunderline{\sbox\tw@{##1}\dp\tw@\z@\box\tw@}}%
\def\underline##1{\SS@ulemheadingchapfudge{\SS@underline}{##1}}%
\def\ulemheading##1##2{\SS@ulemheadingchapfudge{\SS@underline}{##2}}}%
}% endif ulem has not been loaded
{% If ulem has been loaded
\SS@oclto{1}{ulem loaded; underlining setup}%
\def\SS@makeulinesect{%
\def\underbar##1{\SS@origunderline{\sbox\tw@{##1}\dp\tw@\z@\box\tw@}}%
\def\underline{\SS@ulemsectuline{\uline}}%
\def\ulemheading##1##2{\SS@ulemsectuline{##1}{##2}}}%
\def\SS@makeulinepartchap{%
\def\underbar##1{\SS@origunderline{\sbox\tw@{##1}\dp\tw@\z@\box\tw@}}%
\def\underline##1{\SS@ulemheadingchapfudge{\uline}{##1}}%
\let\ulemheading\SS@ulemheadingchapfudge}
}% endif ulem has been loaded
}% end \AtBeginDocument
\def\SS@rr{\def\raggedright{%
\let\\\@centercr\@rightskip\@flushglue \rightskip\@rightskip}}
\newif\ifSS@komascript
\SS@komascriptfalse
\@ifclassloaded{scrartcl}{\SS@komascripttrue}{}
\@ifclassloaded{scrreprt}{\SS@komascripttrue}{}
\@ifclassloaded{scrbook} {\SS@komascripttrue}{}
\newcommand{\SS@sectid}[1]{\gdef\SSsectlevel{#1}}
\newcommand{\SS@nopart}{\global\let\SS@headingpart\SS@nopartid}
\newcommand{\SS@titlepart}{\global\let\SS@headingpart\SS@titlepartid}
\newcommand{\SS@nopartid}{number part}
\newcommand{\SS@titlepartid}{title part}
\newcommand{\SSifnumberpart}{%
\ifx\SS@headingpart\SS@nopartid
\expandafter\@firstoftwo
\else
\expandafter\@secondoftwo
\fi}
\newcommand{\SSiftitlepart}{%
\ifx\SS@headingpart\SS@titlepartid
\expandafter\@firstoftwo
\else
\expandafter\@secondoftwo
\fi}
\def\ifraggedleft#1#2{%
\edef\@tempcmda{\the\rightskip}%
\edef\@tempcmdb{\the\z@skip}%
\ifx\@tempcmda\@tempcmdb\@tempswatrue\else\@tempswafalse\fi
\edef\@tempcmda{\the\leftskip}%
\edef\@tempcmdb{\the\@flushglue}%
\if@tempswa
\ifx\@tempcmda\@tempcmdb\@tempswatrue\else\@tempswafalse\fi
\fi
\if@tempswa#1\else#2\fi}
\def\ifcentering{%
\edef\@tempcmda{\the\rightskip}%
\edef\@tempcmdb{\the\@flushglue}%
\ifx\@tempcmda\@tempcmdb\@tempswatrue\else\@tempswafalse\fi
\edef\@tempcmda{\the\leftskip}%
\edef\@tempcmdb{\the\@flushglue}%
\if@tempswa
\ifx\@tempcmda\@tempcmdb\@tempswatrue\else\@tempswafalse\fi
\fi
\if@tempswa\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
\newcommand{\sectionrule}[5]{%
\ifcentering{%
\PackageError{sectsty}%
{Can't use \protect\sectionrule\space with \protect\centering}%
{The \protect\sectionrule\space command doesn't work properly
with sectional headings that\MessageBreak are centred, so I'll
carry on as if you'd not used the \protect\sectionrule\space
command.}#5}%
{\ifSS@komascript
\ifnum\SSsectlevel>1
\SS@oclto{1}{KOMA-script; normal section rule}%
\SS@sectionrule{#1}{#2}{#3}{#4}{#5}%
\else
\SS@oclto{1}{KOMA-script; part/chap section rule}%
\SS@komapartchaprule{#1}{#2}{#3}{#4}{#5}%
\fi
\else
\SS@oclto{1}{No KOMA-script; normal section rule}%
\SS@sectionrule{#1}{#2}{#3}{#4}{#5}%
\fi}}
\def\SS@sectionrule#1#2#3#4#5{%
\ifraggedleft
{\SS@rlsectionrule{#1}{#2}{#3}{#4}{#5}}%
{\SS@normsectionrule{#1}{#2}{#3}{#4}{#5}}}
\def\SS@normsectionrule#1#2#3#4#5{%
\let\SS@@par\@@par\let\@@par\relax% very dodgy
\noindent\makebox[0pt][l]{\rule[#1]{\hsize}{#2}}%
#5\hfill\makebox[0pt][r]{\rule[#3]{\hsize}{#4}}%
\let\@@par\SS@@par\@@par}
\def\SS@rlsectionrule#1#2#3#4#5{%
\let\SS@@par\@@par\let\@@par\relax% very dodgy
\noindent\makebox[0pt][l]{\rule[#1]{\hsize}{#2}}\hfill%
#5\makebox[0pt][r]{\rule[#3]{\hsize}{#4}}%
\let\@@par\SS@@par\@@par}
\newif\ifSS@starform
\def\secdef#1#2{\@ifstar{\SS@starformtrue#2}{\SS@starformfalse\@dblarg{#1}}}
\def\SS@komapartchaprule#1#2#3#4#5{%
\ifraggedleft
{\SS@rlkomapartchaprule{#1}{#2}{#3}{#4}{#5}}%
{\SS@normkomapartchaprule{#1}{#2}{#3}{#4}{#5}}%
}
\def\SS@normkomapartchaprule#1#2#3#4#5{%
\SS@oclto{1}{SS@normkomapartchaprule}%
\ifSS@starform
\SS@normsectionrule{#1}{#2}{#3}{#4}{#5}%
\else
\SSifnumberpart
{\noindent\makebox[0pt][l]{\rule[#1]{\hsize}{#2}}#5}%
{#5\hfill\makebox[0pt][r]{\rule[#3]{\hsize}{#4}}}%
\fi
}
\def\SS@rlkomapartchaprule#1#2#3#4#5{%
\SS@oclto{1}{SS@rlkomapartchaprule}%
\ifSS@starform
\SS@rlsectionrule{#1}{#2}{#3}{#4}{#5}%
\else
\SSifnumberpart
{\noindent\makebox[0pt][l]{\rule[#1]{\hsize}{#2}}\hfill#5}%
{#5\makebox[0pt][r]{\rule[#3]{\hsize}{#4}}}%
\fi
}
\newcommand*{\partfont} [1]
{\gdef\SS@partnumberfont{\SS@sectid{0}\SS@nopart\SS@makeulinepartchap#1}
\gdef\SS@parttitlefont{\SS@sectid{0}\SS@titlepart\SS@makeulinepartchap#1}}
\newcommand*{\partnumberfont} [1]
{\gdef\SS@partnumberfont{\SS@sectid{0}\SS@nopart\SS@makeulinepartchap#1}}
\newcommand*{\parttitlefont} [1]
{\gdef\SS@parttitlefont{\SS@sectid{0}\SS@titlepart\SS@makeulinepartchap#1}}
\newcommand*{\chapterfont} [1]
{\gdef\SS@chapnumfont{\SS@sectid{1}\SS@nopart\SS@makeulinepartchap#1}
\gdef\SS@chaptitlefont{\SS@sectid{1}\SS@titlepart\SS@makeulinepartchap#1}}
\newcommand*{\chapternumberfont} [1]
{\gdef\SS@chapnumfont{\SS@sectid{1}\SS@nopart\SS@makeulinepartchap#1}}
\newcommand*{\chaptertitlefont} [1]
{\gdef\SS@chaptitlefont{\SS@sectid{1}\SS@titlepart\SS@makeulinepartchap#1}}
\newcommand*{\sectionfont} [1]
{\gdef\SS@sectfont{\SS@sectid{2}\SS@rr\SS@makeulinesect#1}}
\newcommand*{\subsectionfont} [1]
{\gdef\SS@subsectfont{\SS@sectid{3}\SS@rr\SS@makeulinesect#1}}
\newcommand*{\subsubsectionfont} [1]
{\gdef\SS@subsubsectfont{\SS@sectid{4}\SS@rr\SS@makeulinesect#1}}
\newcommand*{\paragraphfont} [1]
{\gdef\SS@parafont{\SS@sectid{5}\SS@rr\SS@makeulinesect#1}}
\newcommand*{\subparagraphfont} [1]
{\gdef\SS@subparafont{\SS@sectid{6}\SS@rr\SS@makeulinesect#1}}
\newcommand*{\minisecfont} [1]
{\gdef\SS@minisecfont{\SS@sectid{7}\SS@rr\SS@makeulinepartchap#1}}
\newcommand*{\allsectionsfont} [1] {\partfont{#1}
\chapterfont{#1}
\sectionfont{#1}
\subsectionfont{#1}
\subsubsectionfont{#1}
\paragraphfont{#1}
\subparagraphfont{#1}
\minisecfont{#1}}
\allsectionsfont{\relax}
\@tempswafalse
\@ifclassloaded{article} {\@tempswatrue\SS@oclto{1}{article detected}} {}
\@ifclassloaded{report} {\@tempswatrue\SS@oclto{1}{report detected}} {}
\@ifclassloaded{book} {\@tempswatrue\SS@oclto{1}{book detected}} {}
\@ifclassloaded{letter} {} {}
\@ifclassloaded{slides} {} {}
\@ifclassloaded{scrartcl}{\@tempswatrue\SS@oclto{1}{scrartcl detected}} {}
\@ifclassloaded{scrreprt}{\@tempswatrue\SS@oclto{1}{scrreprt detected}} {}
\@ifclassloaded{scrbook} {\@tempswatrue\SS@oclto{1}{scrbook detected}} {}
\if@tempswa\else
\PackageError{sectsty}%
{The sectsty package doesn't work with\MessageBreak
this document class}%
{The sectsty package only works with the following classes:
\MessageBreak
the standard LaTeX document classes\MessageBreak
article, report, and book; and\MessageBreak
the KOMA-Script classes\MessageBreak
scrartcl, scrbook, and scrreprt.}
\fi
\@tempswafalse
\@ifclassloaded{article} {\@tempswatrue\SS@oclto{1}{article detected}} {}
\@ifclassloaded{report} {\@tempswatrue\SS@oclto{1}{report detected}} {}
\@ifclassloaded{book} {\@tempswatrue\SS@oclto{1}{book detected}} {}
\@ifclassloaded{letter} {} {}
\@ifclassloaded{slides} {} {}
\@ifclassloaded{scrartcl}{} {}
\@ifclassloaded{scrreprt}{} {}
\@ifclassloaded{scrbook} {} {}
\if@tempswa
\SS@oclto{1}{section->subparagraph modifications for article, report,
and book classes}%
\renewcommand\section{\@startsection {section}{1}{\z@}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%
{\normalfont\Large\bfseries\SS@sectfont}}
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
{-3.25ex\@plus -1ex \@minus -.2ex}%
{1.5ex \@plus .2ex}%
{\normalfont\large\bfseries\SS@subsectfont}}
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
{-3.25ex\@plus -1ex \@minus -.2ex}%
{1.5ex \@plus .2ex}%
{\normalfont\normalsize\bfseries\SS@subsubsectfont}}
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
{3.25ex \@plus1ex \@minus.2ex}%
{-1em}%
{\normalfont\normalsize\bfseries\SS@parafont}}
\renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
{3.25ex \@plus1ex \@minus .2ex}%
{-1em}%
{\normalfont\normalsize\bfseries\SS@subparafont}}
\fi
\@tempswafalse
\@ifclassloaded{article} {} {}
\@ifclassloaded{report} {} {}
\@ifclassloaded{book} {} {}
\@ifclassloaded{letter} {} {}
\@ifclassloaded{slides} {} {}
\@ifclassloaded{scrartcl}{\@tempswatrue\SS@oclto{1}{scrartcl detected}} {}
\@ifclassloaded{scrreprt}{\@tempswatrue\SS@oclto{1}{scrreprt detected}} {}
\@ifclassloaded{scrbook} {\@tempswatrue\SS@oclto{1}{scrbook detected}} {}
\if@tempswa
\SS@oclto{1}{section->minisec modifications for scrartcl, scrreprt,
and scrbook classes}%
\renewcommand\section{\@startsection{section}{1}{\z@}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%
{\raggedsection\normalfont\size@section\sectfont\SS@sectfont}}
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
{-3.25ex\@plus -1ex \@minus -.2ex}%
{1.5ex \@plus .2ex}%
{\raggedsection\normalfont\size@subsection\sectfont\SS@subsectfont}}
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
{-3.25ex\@plus -1ex \@minus -.2ex}%
{1.5ex \@plus .2ex}%
{\raggedsection\normalfont\size@subsubsection\sectfont\SS@subsubsectfont}}
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
{3.25ex \@plus1ex \@minus.2ex}%
{-1em}%
{\raggedsection\normalfont\size@paragraph\sectfont\SS@parafont}}
\renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
{3.25ex \@plus1ex \@minus .2ex}%
{-1em}%
{\raggedsection\normalfont\size@subparagraph\sectfont\SS@subparafont}}
\renewcommand\minisec[1]{\@afterindentfalse \vskip 1.5ex
{\parindent \z@ \raggedsection\sectfont\SS@minisecfont {#1}\par\nobreak}%
\@afterheading}%
\fi
%% Code from |report.cls| June 1996
\@ifclassloaded{report}{%
\SS@oclto{1}{chapter modifications for report class}%
\def\@makechapterhead#1{%
\vspace*{50\p@}%
{\parindent \z@ \raggedright \normalfont
\ifnum \c@secnumdepth >\m@ne
\huge\bfseries\SS@chapnumfont{\@chapapp\space \thechapter}%
\par\nobreak
\vskip 20\p@
\fi
\interlinepenalty\@M
\raggedright \normalfont
\Huge \bfseries \SS@chaptitlefont {#1}\par\nobreak
\vskip 40\p@
}}
\def\@makeschapterhead#1{%
\vspace*{50\p@}%
{\parindent \z@ \raggedright
\normalfont
\interlinepenalty\@M
\Huge \bfseries \SS@chaptitlefont {#1}\par\nobreak
\vskip 40\p@
}}%
}{}
%% End code re-defining chapter stuff for report class
%% Chapter code from |book.cls| 1997/10/10 v1.3x
\@ifclassloaded{book}{%
\SS@oclto{1}{chapter modifications for book class}%
\def\@makechapterhead#1{%
\vspace*{50\p@}%
{\parindent \z@ \raggedright \normalfont
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\huge\bfseries\SS@chapnumfont {\@chapapp\space \thechapter}%
\par\nobreak
\vskip 20\p@
\fi
\fi
\interlinepenalty\@M
\raggedright \normalfont
\Huge \bfseries \SS@chaptitlefont {#1}\par\nobreak
\vskip 40\p@
}}
\def\@makeschapterhead#1{%
\vspace*{50\p@}%
{\parindent \z@ \raggedright
\normalfont
\interlinepenalty\@M
\Huge \bfseries \SS@chaptitlefont {#1}\par\nobreak
\vskip 40\p@
}}%
}{}
%% End code redefining chapter stuff from book.cls
%% Begin code redefining chapter stuff from scrreprt.cls
\@ifclassloaded{scrreprt}{%
\SS@oclto{1}{chapter modifications for scrreprt class}%
\def\@makechapterhead#1{\chapterheadstartvskip%
{\size@chapter{\sectfont\SS@chapnumfont
\@hangfrom{\ifnum \c@secnumdepth >\m@ne%
\chapterformat\fi}%
{\raggedsection \interlinepenalty \@M \SS@chaptitlefont {#1}\par}}%
\nobreak\chapterheadendvskip
}}
\def\@makeschapterhead#1{\chapterheadstartvskip%
{\parindent \z@ \raggedsection
\normalfont
\size@chapter\sectfont\SS@chaptitlefont {#1}\par
\nobreak\chapterheadendvskip
}}
}{}
%% End code redefining chapter stuff from scrreprt.cls
%% Begin code redefining chapter stuff from scrbook.cls
\@ifclassloaded{scrbook}{%
\SS@oclto{1}{chapter modifications for scrbook class}%
\def\@makechapterhead#1{\chapterheadstartvskip%
{\size@chapter{\sectfont\SS@chapnumfont
\@hangfrom{\ifnum \c@secnumdepth >\m@ne%
\if@mainmatter \chapterformat\fi\fi}%
{\raggedsection \interlinepenalty \@M \SS@chaptitlefont {#1}\par}}%
\nobreak\chapterheadendvskip
}}
\def\@makeschapterhead#1{\chapterheadstartvskip%
{\parindent \z@ \raggedsection
\normalfont
\size@chapter\sectfont\SS@chaptitlefont {#1}\par
\nobreak\chapterheadendvskip
}}%
}{}
% \end{macrocode}
%% End code redefining chapter stuff from scrbook.cls
%% Part code from book.cls 1997/10/10 v1.3x
\@ifclassloaded{book}{%
\SS@oclto{1}{part modifications for book class}%
\def\@part[#1]#2{%
\ifnum \c@secnumdepth >-2\relax
\refstepcounter{part}%
\addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
\else
\addcontentsline{toc}{part}{#1}%
\fi
\markboth{}{}%
{\centering
\interlinepenalty \@M
\normalfont
\ifnum \c@secnumdepth >-2\relax
\huge\bfseries\SS@partnumberfont {\partname~\thepart}%
\par
\vskip 20\p@
\fi
\centering \normalfont
\Huge \bfseries \SS@parttitlefont {#2}\par}%
\@endpart}
\def\@spart#1{%
{\centering
\interlinepenalty \@M
\normalfont \Huge \bfseries \SS@parttitlefont {#1}\par}%
\@endpart}
}{}
%% End code redefining part stuff from |book.cls|
%% Part code from |article.cls| 1997/10/10 v1.3x
\@ifclassloaded{article}{%
\SS@oclto{1}{part modifications for article class}%
\def\@part[#1]#2{%
\ifnum \c@secnumdepth >\m@ne
\refstepcounter{part}%
\addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
\else
\addcontentsline{toc}{part}{#1}%
\fi
{\parindent \z@ \raggedright
\interlinepenalty \@M
\normalfont
\ifnum \c@secnumdepth >\m@ne
\Large\bfseries\SS@partnumberfont {\partname~\thepart}%
\par\nobreak
\fi
\raggedright \normalfont
\huge \bfseries \SS@parttitlefont {#2}%
\markboth{}{}\par}%
\nobreak
\vskip 3ex
\@afterheading}
\def\@spart#1{%
{\parindent \z@ \raggedright
\interlinepenalty \@M
\normalfont
\huge \bfseries \SS@parttitlefont {#1}\par}%
\nobreak
\vskip 3ex
\@afterheading}
}{}
%% End code redefining part stuff from |article.cls|
%% Part code from |report.cls| 1997/10/10 v1.3x
\@ifclassloaded{report}{%
\SS@oclto{1}{part modifications for report class}%
\def\@part[#1]#2{%
\ifnum \c@secnumdepth >-2\relax
\refstepcounter{part}%
\addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
\else
\addcontentsline{toc}{part}{#1}%
\fi
\markboth{}{}%
{\centering
\interlinepenalty \@M
\normalfont
\ifnum \c@secnumdepth >-2\relax
\huge\bfseries\SS@partnumberfont {\partname~\thepart}%
\par
\vskip 20\p@
\fi
\centering \normalfont
\Huge \bfseries \SS@parttitlefont {#2}\par}%
\@endpart}
\def\@spart#1{%
{\centering
\interlinepenalty \@M
\normalfont
\Huge \bfseries \SS@parttitlefont {#1}\par}%
\@endpart}
}{}
%% End code redefining part stuff from report.cls
\@tempswafalse
\@ifclassloaded{scrreprt}{\@tempswatrue}{}
\@ifclassloaded{scrbook} {\@tempswatrue}{}
%% Part code from |scrbook.cls| 1998/07/17 v2.5e
\if@tempswa%
\SS@oclto{1}{part modifications for scrreprt and scrbook classes}%
\def\@part[#1]#2{%
\ifnum \c@secnumdepth >-2\relax
\refstepcounter{part}\@maybeasf%
\addcontentsline{toc}{part}{\protect\numberline{\thepart}#1}%
\else
\addcontentsline{toc}{part}{#1}%
\fi
\chaptermark{}
{\centering
\interlinepenalty \@M
\normalfont
\ifnum \c@secnumdepth >-2\relax
\size@partnumber\sectfont\SS@partnumberfont\partformat
\par
\vskip 20\p@
\fi
\size@part\sectfont\SS@parttitlefont {#2}\par}%
\@endpart}
\def\@spart#1{%
{\centering
\interlinepenalty \@M
\normalfont
\size@part\sectfont\SS@parttitlefont {#1}\chaptermark{}\par}%
\@endpart}%
\fi
%% End part code from |scrbook.cls| 1998/07/17 v2.5e
%% Part code from |scrartcl.cls| 1998/07/17 v2.5e
\@ifclassloaded{scrartcl}{%
\SS@oclto{1}{part modifications for scrartcl classes}%
\def\@part[#1]#2{%
\ifnum \c@secnumdepth >\m@ne
\refstepcounter{part}\@maybeasf%
\addcontentsline{toc}{part}{\protect\numberline{\thepart}#1}%
\else
\addcontentsline{toc}{part}{#1}%
\fi
{\parindent \z@ \raggedright
\interlinepenalty \@M
\normalfont
\ifnum \c@secnumdepth >\m@ne
\size@partnumber\sectfont\SS@partnumberfont\partformat
\par\nobreak
\fi
\size@part\sectfont\SS@parttitlefont {#2}%
\sectionmark{}\par}%
\nobreak
\vskip 3ex
\@afterheading}
\def\@spart#1{%
{\parindent \z@ \raggedright
\interlinepenalty \@M
\normalfont
\size@part\sectfont\SS@parttitlefont {#1}\sectionmark{}\par}%
\nobreak
\vskip 3ex
\@afterheading}%
}{}
\endinput
%%
%% End of file `sectsty.sty'.
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化