20
0
Files
cdsc_tex/paper_template/cdsc-paper.sty
Benjamin Mako Hill f7e16a221c removed extra extraneous comments
Cuts the multi-line rationale blocks down to what a reader of the file
needs. The reasoning behind the tagging setup belongs in the commit
messages that introduced it, not repeated above every \DocumentMetadata
block.

Also trims the README: drops the consequence clause explaining what
happens when the standard is declared without the tagging, drops the
quoted TeX Live 2024 error message, and notes that sid has a new enough
TeX Live for anyone not on Overleaf. Adds the caveat that a veraPDF
PASS is necessary but not sufficient, since a document whose body text
is all artifact passes too.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-15 10:24:15 +09:00

133 lines
4.4 KiB
TeX

% Article-class styles and page layout for CDSC paper documents.
%
% This file replaces the older cdsc-memoir.sty. It targets the
% standard `article' class so the LaTeX tagging project can produce
% tagged, accessible PDFs --- memoir is currently incompatible with
% that work. The look-and-feel is kept as close to the previous
% cdsc-article chapterstyle as is practical.
%
% Headings and the title block use the class's own \@startsection and
% \@maketitle hooks, not titlesec and titling, which break tagging.
% See the Customizing section of the README.
%
% Copyright 2009-2026 Benjamin Mako Hill <mako@atdot.cc>
% Copyright 2008-2009 Kieran Healy <kjhealy@soc.duke.edu>
% Distributed as free software under the GNU GPL v3
\usepackage{xcolor}
%%% Page styles (replaces memoir's \makepagestyle / \makeevenhead etc.)
\usepackage{fancyhdr}
\setlength{\headheight}{14.5pt}
\addtolength{\topmargin}{-2.5pt}
% Basic: page number in small caps in the upper-right corner
\fancypagestyle{cdsc-page}{%
\fancyhf{}%
\fancyhead[R]{\scshape\thepage}%
\renewcommand{\headrulewidth}{0pt}%
}
% Variant with git revision info in the footer (requires the vc package).
\fancypagestyle{cdsc-page-git}{%
\fancyhf{}%
\fancyhead[R]{\scshape\thepage}%
\fancyfoot[C]{\texttt{\footnotesize\textcolor{BrickRed}{git revision \VCRevision\ on \VCDateTEX}}}%
\renewcommand{\headrulewidth}{0pt}%
}
% Variant with a build timestamp in the footer (useful on Overleaf/etc.)
\fancypagestyle{cdsc-page-overleaf}{%
\fancyhf{}%
\fancyhead[R]{\scshape\thepage}%
\fancyfoot[C]{\texttt{\footnotesize\textcolor{BrickRed}{Buildstamp/Version:~\today}}}%
\renewcommand{\headrulewidth}{0pt}%
}
\pagestyle{cdsc-page}
%%% Section headings. \@startsection takes {name}{level}{indent}
%%% {beforeskip}{afterskip}{style}; a negative afterskip runs the
%%% heading in to the following paragraph.
\makeatletter
% Sections: large small caps
\renewcommand\section{\@startsection{section}{1}{\z@}%
{-1.8ex \@plus -1ex \@minus -.2ex}%
{1.7ex \@plus .2ex}%
{\large\scshape}}
% Subsections: italic
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
{-3.25ex \@plus -1ex \@minus -.2ex}%
{1.5ex \@plus .2ex}%
{\normalsize\itshape}}
% Subsubsections: small bold, run in to the following paragraph
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
{-3.25ex \@plus -1ex \@minus -.2ex}%
{-0.5em}%
{\small\bfseries}}
% Period after the section number, when numbering is switched on below
\renewcommand{\@seccntformat}[1]{\csname the#1\endcsname.\hspace{0.5em}}
% By default, suppress numbering at the section level (matches the
% memoir template's default of \setsecnumdepth{chapter}). To enable
% numbered sections and subsections, comment the line below and
% uncomment the alternative.
\setcounter{secnumdepth}{0}
% \setcounter{secnumdepth}{2}
%%% Title block: flush left, italic title, author below it.
%%
%% \published{...}: a note about the publication status, printed in
%% small type at the very top of the title block. Use this for
%% draft/working-paper notices.
\newcommand{\puB}{}
\newcommand{\published}[1]{\gdef\puB{#1}}
% \raggedright, not \flushleft: flushleft is a trivlist and would leave
% a list open in the structure tree. The skips match titling's output;
% the date slot keeps its space even when \date{} is empty.
\renewcommand{\@maketitle}{%
\null
\vskip 2em%
\par\noindent\footnotesize\puB\par
\vskip 0.79em%
{\raggedright\LARGE\itshape\@title\par}%
\vskip 1.04em%
{\raggedright\large\lineskip 1em\@author\par}%
\vskip 0.79em%
{\raggedright\footnotesize\@date\par}%
\vskip 1em%
\par\vskip 2.44em%
}
\makeatother
%%% Abstract: runin style ("**Abstract:** the quick brown fox..."),
%%% indented from both margins (via the quote environment, which gives
%%% the side indent without adding first-line paragraph indentation).
\renewenvironment{abstract}%
{\par\addvspace{\medskipamount}\small
\begin{quote}\noindent\textbf{Abstract:}\hspace{0.5em}\ignorespaces}%
{\end{quote}\par\medskip}
%%% List spacing (replaces memoir's \firmlists --- tighter lists)
\usepackage{enumitem}
\setlist{topsep=0pt, partopsep=0pt}
%%% Caption font
\usepackage{caption}
\captionsetup{font=small}
%%% Footnote symbol command (for \thanks{} footnotes that should not
%%% have a numeric mark). Use as \symbolfootnote[0]{Footnote text}.
\long\def\symbolfootnote[#1]#2{\begingroup%
\def\thefootnote{\fnsymbol{footnote}}\footnote[#1]{#2}\endgroup}
\endinput