diff options
author | Norbert Preining <norbert@preining.info> | 2020-03-20 03:01:17 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2020-03-20 03:01:17 +0000 |
commit | c720a4409b388fa706f3eb1ce275f76f7d49d996 (patch) | |
tree | d9e0864c856e4b7abba585785d57bbf02aa1f9ad /macros/latex/contrib/turabian-formatting/turabian-researchpaper.cls | |
parent | c8b8ea37fe9cd71b53223dff23f291b2f158fc0f (diff) |
CTAN sync 202003200301
Diffstat (limited to 'macros/latex/contrib/turabian-formatting/turabian-researchpaper.cls')
-rw-r--r-- | macros/latex/contrib/turabian-formatting/turabian-researchpaper.cls | 209 |
1 files changed, 85 insertions, 124 deletions
diff --git a/macros/latex/contrib/turabian-formatting/turabian-researchpaper.cls b/macros/latex/contrib/turabian-formatting/turabian-researchpaper.cls index ae2b8ce881..e97d559a64 100644 --- a/macros/latex/contrib/turabian-formatting/turabian-researchpaper.cls +++ b/macros/latex/contrib/turabian-formatting/turabian-researchpaper.cls @@ -4,7 +4,7 @@ % and Dissertations," 9th edition. % % ============================== -% Copyright 2013-2018 Omar Abdool +% Copyright 2013-2020 Omar Abdool % % This work may be distributed and/or modified under the conditions of the LaTeX % Project Public License (LPPL), either version 1.3 of this license or (at your @@ -27,7 +27,7 @@ \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{turabian-researchpaper}[2018/08/01 Turabian Research Paper] +\ProvidesClass{turabian-researchpaper}[2020/03/19 Turabian Research Paper] % Default point size @@ -79,118 +79,69 @@ \RequirePackage{turabian-formatting} -% Part: formatting -\def\tf@partformat{\normalfont\bfseries\singlespacing\centering} - -\def\@part[#1]#2{% - \ifnum \c@secnumdepth >-2\relax - \refstepcounter{part}% - \addcontentsline{toc}{part}% - {\protect{\partname\space\thepart}}% - \else - \addcontentsline{toc}{part}{#1}% - \fi - \markboth{}{}% - { \tf@partformat - \interlinepenalty \@M - \ifnum \c@secnumdepth >-2\relax - \partname\nobreakspace\thepart - \par\nobreak - \vspace*{1\baselineskip}% - \fi - \ifstrempty{#2}% - {}% - {#2\par\nobreak}}% - \vspace{\dimexpr 3\tf@singlelineskip -\baselineskip \relax}} - -\def\@spart#1{% - { \tf@partformat - \interlinepenalty \@M - #1\par\nobreak}% - \vspace{\dimexpr 3\tf@singlelineskip -\baselineskip \relax}} - +% Sections: \section* adjustment to space after heading +\newif\if@adjustssect\@adjustssecttrue +\newlength\tf@ssectafterskip % Sections: command to disable differentiate and reformat \section* \gdef\noadjustssect{\@adjustssectionfalse} -% Sections: \section* adjustment to space after heading -\newif\if@adjustssection\@adjustssectiontrue -\newlength\tf@ssect@afterskip -\setlength\tf@ssect@afterskip{1\p@} +% Sections: \section* heading formatting hook +\def\tf@ssectformat#1{#1} -% Sections: adjustment to space after \section heading -\newif\if@tf@adjustsection\@tf@adjustsectionfalse -\newlength\tf@sect@afterskip -\setlength\tf@sect@afterskip{1\p@} - -% Sections: redefine \@startsection to differentiate starred version +% Sections: redefine \@startsection to support \if@adjustssect and \tf@ssectformat \def\@startsection#1#2#3#4#5#6{% \if@noskipsec \leavevmode \fi \par \@tempskipa #4\relax \@afterindenttrue \ifdim \@tempskipa <\z@ - \@tempskipa -\@tempskipa \tf@afterindent + \@tempskipa -\@tempskipa \@afterindentfalse \fi \if@nobreak \everypar{} \else \addpenalty\@secpenalty\addvspace\@tempskipa \fi - \setlength\tf@ssect@afterskip{\dimexpr #5 -\tf@adjaftersec \relax} - \if@adjustssection - \ifstrequal{#1}{section}% - {\setlength\tf@ssect@afterskip{% - \dimexpr 2\tf@singlelineskip -\tf@adjaftersec \relax}}% - {} - \fi - \setlength\tf@sect@afterskip{\dimexpr #5 -\tf@adjaftersec \relax} - \if@tf@adjustsection - \ifstrequal{#1}{section}% - {\setlength\tf@sect@afterskip{% - \dimexpr 2\tf@singlelineskip -\tf@adjaftersec \relax}}% - {} + \setlength\tf@ssectafterskip{#5} + \ifnum #2 =1 + \if@adjustssect \setlength\tf@ssectafterskip{2\tf@singlelineskip} \fi \fi \@ifstar - {\@ssect{#3}{#4}{\tf@ssect@afterskip}{#6}}% - {\@dblarg{\@sect{#1}{#2}{#3}{#4}{\tf@sect@afterskip}{#6}}}} + {\@ssect{#3}{#4}{\tf@ssectafterskip}{\tf@ssectformat{#6}}}% + {\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}} -% Sections: formatting between \@svsec and heading -\protected@edef\tf@secsep#1#2{\@empty} -% Sections: formatting of TOC \addcontentsline -\def\tf@tocline#1{\protect{\csname the#1\endcsname\quad}} +% Part: formatting (unsupported) +\def\tf@partformat{\normalfont\bfseries\centering} -% Sections: redefine \@sect to support optional two-line formatting -\def\@sect#1#2#3#4#5#6[#7]#8{% - \ifnum #2>\c@secnumdepth - \let\@svsec\@empty - \else - \refstepcounter{#1}% - \protected@edef\@svsec{\@seccntformat{#1}\relax}% - \fi - \@tempskipa #5\relax - \ifdim \@tempskipa>\z@ - \begingroup - #6{% - \@hangfrom{\hskip #3\relax\@svsec}% - \interlinepenalty \@M \tf@secsep{#1}{#8}#8\@@par}% - \endgroup - \csname #1mark\endcsname{#7}% - \addcontentsline{toc}{#1}{% - \ifnum #2>\c@secnumdepth \else - \tf@tocline{#1}% - \fi - #7}% +\def\@part[#1]#2{% + \@afterindenttrue + \ifnum \c@secnumdepth >\m@ne + \refstepcounter{part}% + \addcontentsline{toc}{part}{\protect{\partname\space\thepart}}% \else - \def\@svsechd{% - #6{\hskip #3\relax\@svsec #8}% - \csname #1mark\endcsname{#7}% - \addcontentsline{toc}{#1}{% - \ifnum #2>\c@secnumdepth \else - \tf@tocline{#1}% - \fi - #7}}% + \addcontentsline{toc}{part}{#1}% \fi - \@xsect{#5}} + \markboth{}{}% + \begingroup + \setlength\parskip{\tf@singlelineskip} + \singlespacing + \interlinepenalty \@M + \tf@partformat{% + \ifnum \c@secnumdepth >\m@ne + \partname\nobreakspace\thepart\relax\@@par + \fi% + #2\@@par}% + \endgroup + \vskip 2\tf@singlelineskip + \@afterheading} + +\def\@spart#1{% + \@afterindenttrue + { \singlespacing + \interlinepenalty \@M + \tf@partformat{#1\@@par}}% + \vskip 2\tf@singlelineskip + \@afterheading} % Title page: commands for use with \maketitle @@ -230,7 +181,7 @@ % Formatting for titlepage option \renewcommand{\maketitle}{% \begin{titlepage}% - \tf@setfnpunct{} + \def\tf@thefnpunct{\,\,} \renewcommand*{\thefootnote}{\fnsymbol{footnote}} \let\footnoterule\relax \normalfont\normalsize\centering\singlespacing @@ -276,7 +227,6 @@ % Table of Contents, List of Figures, and List of Tables: item number alignment -%\def\numberline#1{\hb@xt@\@tempdima{\hfil #1\hspace{1em}}} \def\@tocrmarg{0.75in} \def\@pnumwidth{3.5ex} @@ -288,30 +238,33 @@ \renewcommand*{\l@part}[2]{% \ifnum \c@tocdepth >-2\relax \addpenalty{-\@highpenalty}% - \addvspace{1\baselineskip}% + \vskip 2\tf@singlelineskip % \setlength\@tempdima{0.5in}% - \vskip \tf@singlelineskip - { \parindent \z@ - \rightskip \z@ + { \parindent \z@ \rightskip \z@ \parfillskip -\@rightskip \leavevmode \advance\leftskip\@tempdima \hskip -\leftskip \bfseries #1\nobreak\hfil \nobreak\par} + \if@compatibility + \global\@nobreaktrue + \everypar{\global\@nobreakfalse\everypar{}}% + \fi \fi} \renewcommand*{\l@section}[2]{% \ifnum \c@tocdepth >\z@ \addpenalty\@secpenalty - \setlength\@tempdima{\z@}% \vskip \tf@singlelineskip - { \parindent \z@ - \rightskip \@tocrmarg + \setlength\@tempdima{\z@}% + \begingroup + \parindent \z@ \rightskip \@tocrmarg \parfillskip -\rightskip \leavevmode \advance\leftskip\@tempdima \hskip -\leftskip - #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par} + #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par + \endgroup \fi} \renewcommand*{\l@subsection}{% @@ -344,31 +297,43 @@ % Appendixes: adjust formatting of section headings \def\tf@appendixsecfrmt{% - \DeclareRobustCommand{\@seccntformat}[1]{% - \ifstrequal{##1}{section}% - {\appendixname\space \csname the##1\endcsname}% - {\csname the##1\endcsname\quad}} - \DeclareRobustCommand{\tf@secsep}[2]{% - \ifstrequal{##1}{section}% - {\ifstrempty{##2}{}{\par\nobreak}}% - {\@empty}} - \def\tf@tocline##1{\appendixname\space \csname the##1\endcsname.\quad} - \@tf@adjustsectiontrue} + \def\thesection{\@Alph\c@section} + \protect\def\tf@makesectionhead##1##2##3##4##5{% + \vskip -\tf@singlelineskip\relax + \ifnum ##2 =1 + \begingroup + \singlespacing + \interlinepenalty \@M + ##4{\appendixname\space\thesection\relax\@@par ##5\@@par}% + \vskip \tf@singlelineskip + \endgroup + \else + \begingroup + \singlespacing + ##4{% + \@hangfrom{\hskip ##3\relax\@svsec}% + \interlinepenalty \@M ##5\@@par}% + \endgroup + \fi} + \def\tf@tocline##1##2{% + \ifnum ##2 =1 + \protect{\appendixname\space\thesection.\quad} + \else + \protect{\csname the##1\endcsname\quad} + \fi}} % Appendixes: make environment \newenvironment{appendixes}% {% \setcounter{secnumdepth}{1} - \tf@appendixsecfrmt - \setcounter{section}{0}% - \setcounter{subsection}{0}% - \gdef\thesection{\@Alph\c@section}% + \setcounter{section}{0} + \setcounter{subsection}{0} + \tf@appendixsecfrmt% }% {% \setcounter{secnumdepth}{0}% \setcounter{section}{0}% \setcounter{subsection}{0}% - \gdef\thesection{\@arabic\c@section}% }% % Appendixes: remove \appendix command @@ -377,14 +342,10 @@ % Endnotes: Notes heading formatted as \section* \if@endnotesformat - \renewcommand{\enoteheading}{% + \def\enoteheading{% \section*{\notesname}% - \markboth{\notesname}{\notesname}% - \addcontentsline{toc}{section}{\notesname}% - \vspace{\dimexpr -4\tf@singlelineskip +1\baselineskip \relax} - \singlespacing\mbox{}% - \def\tf@adjaftersec{\dimexpr \tf@singlelineskip -\p@ \relax} - \let\tf@afterindent\@afterindenttrue}% + \markboth{}{}% + \addcontentsline{toc}{section}{\notesname}} \fi |