| 1 |
% \iffalse meta-comment |
| 2 |
% |
| 3 |
% Copyright (C) 2021 by Philippe Faist <[email protected]> |
| 4 |
% ------------------------------------------------------- |
| 5 |
% |
| 6 |
% This file may be distributed and/or modified under the |
| 7 |
% conditions of the LaTeX Project Public License, either version 1.3 |
| 8 |
% of this license or (at your option) any later version. |
| 9 |
% The latest version of this license is in: |
| 10 |
% |
| 11 |
% http://www.latex-project.org/lppl.txt |
| 12 |
% |
| 13 |
% and version 1.3 or later is part of all distributions of LaTeX |
| 14 |
% version 2005/12/01 or later. |
| 15 |
% |
| 16 |
% \fi |
| 17 |
% |
| 18 |
% \iffalse |
| 19 |
%<*driver> |
| 20 |
\ProvidesFile{phfextendedabstract.dtx} |
| 21 |
%</driver> |
| 22 |
%<package>\NeedsTeXFormat{LaTeX2e}[2005/12/01] |
| 23 |
%<package>\ProvidesClass{phfextendedabstract} |
| 24 |
%<*package> |
| 25 |
[2021/09/08 v1.0 phfextendedabstract class] |
| 26 |
%</package> |
| 27 |
% |
| 28 |
%<*driver> |
| 29 |
\documentclass{ltxdoc} |
| 30 |
\usepackage{xcolor} |
| 31 |
\usepackage[preset=xpkgdoc]{phfnote} |
| 32 |
\usepackage{needspace} |
| 33 |
|
| 34 |
\makeatletter |
| 35 |
\newsavebox\phfeaDocVirtualPage@contents |
| 36 |
\newenvironment{phfeaDocVirtualPage}{% |
| 37 |
\par% |
| 38 |
\begingroup% |
| 39 |
\makeatletter% |
| 40 |
\begin{lrbox}{\phfeaDocVirtualPage@contents}% |
| 41 |
\begin{minipage}{12cm}\relax% |
| 42 |
\def\rmdefault{cmr}\def\sfdefault{cmbr}\normalfont% |
| 43 |
\def\shortlipsum{Lorem ipsum dolor sit amet, consectetuer |
| 44 |
adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, |
| 45 |
adipiscing vitae, felis. Curabitur dictum gravida |
| 46 |
mauris. Nam arcu libero, nonummy eget, consectetuer id, |
| 47 |
vulputate a, magna.}% |
| 48 |
\let\RequirePackage\@gobble% |
| 49 |
\def\morepagecontents{\par\vspace{1em}\centering\ldots}% |
| 50 |
\ignorespaces% |
| 51 |
}% |
| 52 |
{% |
| 53 |
\end{minipage}% |
| 54 |
\end{lrbox}% |
| 55 |
%%\centering% |
| 56 |
\begin{tcolorbox}[text width=6cm,sharp corners,% |
| 57 |
before={\par\vspace{5pt}\centering\nopagebreak\parindent=0pt},after={\par\vspace{5pt}},% |
| 58 |
leftrule=0.4pt,toprule=0.4pt,rightrule=0.6pt,bottomrule=0.6pt,% |
| 59 |
colframe=black,colback=white]% |
| 60 |
\scalebox{0.5}{\usebox{\phfeaDocVirtualPage@contents}}% |
| 61 |
\end{tcolorbox}% |
| 62 |
%%\par% |
| 63 |
\endgroup% |
| 64 |
} |
| 65 |
\def\phfeaSectionDecoration{% only for doc purposes |
| 66 |
\raisebox{0.2ex}{{% |
| 67 |
\notesmaller[0.4]\phfeaSectionDecorationSymbol}}% |
| 68 |
\hspace*{1.5ex}% |
| 69 |
} |
| 70 |
\def\phfeaSectionDecorationSymbol{\ensuremath{\blacksquare}}% only for doc purposes |
| 71 |
\def\phfeaParagraphDecoration{% only for doc purposes |
| 72 |
\raisebox{0.2ex}{{% |
| 73 |
\notesmaller[0.6]\phfeaParagraphDecorationSymbol}}% |
| 74 |
\hspace*{1ex}% |
| 75 |
} |
| 76 |
\def\phfeaParagraphDecorationSymbol{\ensuremath{\triangleright}}% only for doc purposes |
| 77 |
|
| 78 |
\def\eqsign@{=} |
| 79 |
\def\eqsign{\protect\eqsign@} |
| 80 |
\robustify\eqsign |
| 81 |
\makeatother |
| 82 |
|
| 83 |
\def\RevTeX{{\small R\raise-0.2ex\hbox{\textsc{ev}}}\TeX} |
| 84 |
|
| 85 |
\EnableCrossrefs |
| 86 |
\CodelineIndex |
| 87 |
\RecordChanges |
| 88 |
\begin{document} |
| 89 |
\DocInput{phfextendedabstract.dtx} |
| 90 |
\end{document} |
| 91 |
%</driver> |
| 92 |
% \fi |
| 93 |
% |
| 94 |
% \CheckSum{0} |
| 95 |
% |
| 96 |
% \CharacterTable |
| 97 |
% {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 |
| 98 |
% 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 |
| 99 |
% Digits \0\1\2\3\4\5\6\7\8\9 |
| 100 |
% Exclamation \! Double quote \" Hash (number) \# |
| 101 |
% Dollar \$ Percent \% Ampersand \& |
| 102 |
% Acute accent \' Left paren \( Right paren \) |
| 103 |
% Asterisk \* Plus \+ Comma \, |
| 104 |
% Minus \- Point \. Solidus \/ |
| 105 |
% Colon \: Semicolon \; Less than \< |
| 106 |
% Equals \= Greater than \> Question mark \? |
| 107 |
% Commercial at \@ Left bracket \[ Backslash \\ |
| 108 |
% Right bracket \] Circumflex \^ Underscore \_ |
| 109 |
% Grave accent \` Left brace \{ Vertical bar \| |
| 110 |
% Right brace \} Tilde \~} |
| 111 |
% |
| 112 |
% |
| 113 |
% \changes{v1.0}{2021/07/29}{Initial version} |
| 114 |
% |
| 115 |
% \GetFileInfo{phfextendedabstract.dtx} |
| 116 |
% |
| 117 |
% \DoNotIndex{\newcommand,\newenvironment,\def,\gdef,\edef,\xdef,\if,\else,\fi,\ifx} |
| 118 |
% |
| 119 |
% \title{\phfqitltxPkgTitle{phfextendedabstract}} |
| 120 |
% \author{Philippe Faist\quad\email{[email protected]}} |
| 121 |
% \date{\pkgfmtdate\filedate} |
| 122 |
% |
| 123 |
% \maketitle |
| 124 |
% |
| 125 |
% \begin{abstract} |
| 126 |
% \pkgname{phfextendedabstract}---Typeset extended abstracts for conferences, |
| 127 |
% such as often encountered in quantum information theory. |
| 128 |
% \end{abstract} |
| 129 |
% |
| 130 |
% \inlinetoc |
| 131 |
% |
| 132 |
% \section{Introduction} |
| 133 |
% |
| 134 |
% Several conferences in Quantum Information Theory (and presumably in other |
| 135 |
% fields, too) require the submission of \emph{extended abstracts}. An extended |
| 136 |
% abstract is a summary of a scientific result, presented at a high level, and |
| 137 |
% consisting of at most a small handful of pages. |
| 138 |
% |
| 139 |
% I found myself repeatedly copying my \LaTeX\ preamble from one submission to |
| 140 |
% another with definitions for a format that I elaborated and liked. So at some |
| 141 |
% point I collected the main definitions into this class file. |
| 142 |
% |
| 143 |
% The \pkgname{phfextendedabstract} class sets up the document for an extended |
| 144 |
% abstract submission as a single-column document, typeset by default at 11 |
| 145 |
% point size, with at most two sectioning levels (|\section|\,s and |
| 146 |
% |\paragraph|\,s). It is based on the \RevTeX\ class. |
| 147 |
% |
| 148 |
% The extended abstract style looks approximately like this: |
| 149 |
% \nopagebreak |
| 150 |
% \iffalse COMMENT: Spacings are copied/emulated ! They might appear wrong!! \fi |
| 151 |
% \begin{phfeaDocVirtualPage} |
| 152 |
% {\parskip=8pt\relax |
| 153 |
% {\sffamily\Large\centering Title of my extended abstract\par} |
| 154 |
% {\centering Author One,\ \ Author Two,\ \ and\ \ Author Three\par} |
| 155 |
% }\vspace{0.2cm} |
| 156 |
% \parskip=3pt\relax |
| 157 |
% |
| 158 |
% \noindent{\normalfont\normalsize\sffamily\fontseries{sb}\selectfont |
| 159 |
% \makebox[0pt][r]{\phfeaSectionDecoration}Introduction.} |
| 160 |
% \shortlipsum |
| 161 |
% |
| 162 |
% \noindent{\normalfont\normalsize\sffamily\fontseries{sb}\selectfont |
| 163 |
% \makebox[0pt][r]{\phfeaSectionDecoration}Results.} |
| 164 |
% \shortlipsum |
| 165 |
% |
| 166 |
% \noindent{\normalfont\normalsize\sffamily\small |
| 167 |
% \makebox[0pt][r]{\phfeaParagraphDecoration}First result.} |
| 168 |
% \ldots |
| 169 |
% |
| 170 |
% \noindent{\normalfont\normalsize\sffamily\small |
| 171 |
% \makebox[0pt][r]{\phfeaParagraphDecoration}Second result.} |
| 172 |
% \ldots |
| 173 |
% |
| 174 |
% \noindent{\normalfont\normalsize\sffamily\fontseries{sb}\selectfont |
| 175 |
% \makebox[0pt][r]{\phfeaSectionDecoration}Discussion.} |
| 176 |
% \shortlipsum |
| 177 |
% \hspace*{1.5ex}% |
| 178 |
% |
| 179 |
% \end{phfeaDocVirtualPage} |
| 180 |
% |
| 181 |
% |
| 182 |
% \section{Main features} |
| 183 |
% |
| 184 |
% Here are the main features of the \pkgname{phfextendedabstract} class: |
| 185 |
% \begin{itemize} |
| 186 |
% \item The class \pkgname{phfextendedabstract} loads the \pkgname{revtex4-2} |
| 187 |
% class, so you can directly use \RevTeX's features such as author |
| 188 |
% affiliations, etc. |
| 189 |
% |
| 190 |
% \item Only two sectioning commands are enabled: |\section| and |\paragraph|. |
| 191 |
% Both have run-in headings. If you find yourself needing additional |
| 192 |
% sectioning levels, it might be that your extended abstract is too detailed |
| 193 |
% and you might want to think about how to keep it at a higher level. It |
| 194 |
% might also be that \pkgname{phfextendedabstract} is too limited for your |
| 195 |
% needs. |
| 196 |
% |
| 197 |
% By default, section and paragraphs have ``decorations'' (by default a symbol |
| 198 |
% in the margin) to guide the reader through the overall high-level structure |
| 199 |
% of the document. (Disable them with the |noheadingdecorations| class |
| 200 |
% option.) |
| 201 |
% |
| 202 |
% \item You can easily scale all vertical spacing dimensions (section and |
| 203 |
% paragraph spacing, vertical space around theorems and list environments, |
| 204 |
% etc.) by a common factor with a class option. Do you have those extra two |
| 205 |
% lines that make you exceed your 3-page limit? Try squeezing everything |
| 206 |
% together with a class option like |compressverticalspacing=0.7|. |
| 207 |
% |
| 208 |
% \item The \pkgname{phfnote} package is loaded in order to provide a set of |
| 209 |
% default \LaTeX\ packages and set up hyperlinks. A generous default set of |
| 210 |
% standard LaTeX packages are loaded, including \pkgname{caption} and |
| 211 |
% \pkgname{enumitem}; see \pkgname{phfnote}'s documentation for the option |
| 212 |
% |pkgset=extended|. |
| 213 |
% |
| 214 |
% \textbf{You are expected to include |
| 215 |
% \phfverb{\usepackage}\phfverb{{hyperref}} somewhere in your preamble.} We |
| 216 |
% deliberately don't include \pkgname{hyperref} when loading the class in |
| 217 |
% order to give you greater control of package loading order (most packages |
| 218 |
% you might want to use must be loaded before \pkgname{hyperref}). |
| 219 |
% |
| 220 |
% \item The page margins are tweaked with the \pkgname{geometry} package. |
| 221 |
% (Simply call |\geometry{...}| if you'd like to further change them. Refer |
| 222 |
% to the \pkgname{geometry} package's documentation.) |
| 223 |
% |
| 224 |
% \item Lists, i.e.\@ the |itemize| and |enumerate| environments, are customized |
| 225 |
% using the \pkgname{enumitem} package so that they take up less space. You |
| 226 |
% also get a |enumerate*| environment that typesets its items in-line, in a |
| 227 |
% single paragraph. |
| 228 |
% |
| 229 |
% (Note that this customization won't work if you choose to load a package set |
| 230 |
% via a |pkgset=| option that doesn't include \pkgname{enumitem}.) |
| 231 |
% |
| 232 |
% \item By default we load the \pkgname{phfthm} package and set a customized |
| 233 |
% theorem style so that it stands out but also so that it contrasts well with |
| 234 |
% the section and paragraph headings. |
| 235 |
% |
| 236 |
% \end{itemize} |
| 237 |
% |
| 238 |
% Check out the class option documentation in \autoref{sec:class-options} to get |
| 239 |
% a better idea of how to customize \pkgname{phfextendedabstract}'s behavior! |
| 240 |
% |
| 241 |
% |
| 242 |
% \section{Example Usage} |
| 243 |
% |
| 244 |
% Here's a simple template: |
| 245 |
% \begin{verbatim} |
| 246 |
% \documentclass[papertype=a4paper]{phfextendedabstract} |
| 247 |
% |
| 248 |
% \usepackage{hyperref} |
| 249 |
% |
| 250 |
% \begin{document} |
| 251 |
% \title{Title goes here} |
| 252 |
% \author{Author 1} |
| 253 |
% \author{Author 2} |
| 254 |
% \maketitle |
| 255 |
% |
| 256 |
% \section{Introduction.} |
| 257 |
% Lorem ipsum ... |
| 258 |
% |
| 259 |
% \section{Results.} |
| 260 |
% We had some cool results about |
| 261 |
% \begin{enumerate*} % inline enumeration |
| 262 |
% \item a first result, |
| 263 |
% \item a second result, % and |
| 264 |
% \item a final result. |
| 265 |
% \end{enumerate*} |
| 266 |
% |
| 267 |
% \paragraph{First result.} |
| 268 |
% Here's a first result ... |
| 269 |
% |
| 270 |
% \paragraph{Second result.} |
| 271 |
% Here's another result ... |
| 272 |
% |
| 273 |
% ... |
| 274 |
% |
| 275 |
% \end{document} |
| 276 |
% \end{verbatim} |
| 277 |
% |
| 278 |
% (Try it out!) |
| 279 |
% |
| 280 |
% |
| 281 |
% \section{Class options} |
| 282 |
% \label{sec:class-options} |
| 283 |
% |
| 284 |
% Here is a summary of class options: |
| 285 |
% \begin{pkgoptions} |
| 286 |
% \item[papertype=a4paper,letterpaper,\meta{paper type},\meta{empty}] Specify |
| 287 |
% the paper type to use (A4 or letter). The argument given to this option is |
| 288 |
% directly specified as an option to the underlying \RevTeX\ class. |
| 289 |
% \item[ptsize=10pt,11pt,12pt] Default font size to use. Again the argument |
| 290 |
% given to this option is directly specified as an option to the underlying |
| 291 |
% \RevTeX\ class. |
| 292 |
% \item[sectiondecorations=\meta{true or false}] Whether or not to ``decorate'' |
| 293 |
% section headings, by default with a small black square typeset in the margin |
| 294 |
% of the section heading. |
| 295 |
% \item[paragraphdecorations=\meta{true or false}] Whether or not to |
| 296 |
% ``decorate'' paragraph headings, by default with a small right-pointing |
| 297 |
% outlined triangle typeset in the margin of the paragraph heading. |
| 298 |
% \item[noheadingdecorations] Shorthand for |
| 299 |
% |sectiondecorations=false,paragraphdecorations=false|. |
| 300 |
% \item[compressverticalspacing=\meta{factor}] Real factor by which to multiply |
| 301 |
% the vertical spacing between sections, paragraphs, theorems, paragraphs, |
| 302 |
% list environments such as |itemize| and |enumerate|, etc. If you need to |
| 303 |
% compress the sections a bit to fit more content on a fixed number of pages |
| 304 |
% (e.g.\@ because of page number constraints), you can set this option to a |
| 305 |
% factor that's less than one. A \meta{factor} that's less than one |
| 306 |
% compresses sections together, a \meta{factor} equal to |1| does nothing, and |
| 307 |
% a \meta{factor} greater than one expands the sections further apart. |
| 308 |
% \item[loadtheorems=\meta{true or false}] If |loadtheorems=true| (the default), |
| 309 |
% then the \pkgname{phfthm} package is loaded with some suitable default |
| 310 |
% options and a custom theorem style. (The theorem style |
| 311 |
% |phfextendedabstractthm| is defined regardless of this package option.) |
| 312 |
% \item[sansstyle=\meta{true or false}] Use sans serif style by default for the |
| 313 |
% main title as well as for section and paragraph headings. For greater |
| 314 |
% degree of control, see \autoref{sec:customize-title-and-headings-style}. |
| 315 |
% \item[usehyperref=\meta{true or false}] Should we set up the document for use |
| 316 |
% with the \pkgname{hyperref} package or not? This option influences how we |
| 317 |
% load the \pkgname{phfnote} package. If this option is set to |true| (the |
| 318 |
% default), then the \pkgname{phfnote} package is loaded with |
| 319 |
% |hyperrefdefs={defer,noemail}|. This means that the document is set up for |
| 320 |
% use with \pkgname{hyperref}, although you will still need to say |
| 321 |
% |\usepackage{hyperref}| somewhere in your preamble. If |usehyperref=false|, |
| 322 |
% then the \pkgname{phfnote} package is loaded with hyperref options disabled. |
| 323 |
% |
| 324 |
% (The |noemail| option is specified to \pkgname{phfnote} to avoid |
| 325 |
% interference with \RevTeX's own |\email| command used to specify email |
| 326 |
% addresses for individual authors.) |
| 327 |
% \item[pkgset=\meta{\pkgname{phfnote} package set name}] The \pkgname{phfnote} |
| 328 |
% package (which we load internally) loads a bunch of standard packages for |
| 329 |
% your convenience, such as \pkgname{enumitem} or \pkgname{microtype}. You |
| 330 |
% can influence this behavior by specifying a ``package set'' to load. By |
| 331 |
% default, the |pkgset=extended| package set is loaded. If you don't want to |
| 332 |
% load any additional packages beyond those that are strictly necessary, use |
| 333 |
% |pkgset=none| or |pkgset=minimal|. See \pkgname{phfnote}'s documentation |
| 334 |
% for the package option |pkgset=...| for more information and a list of |
| 335 |
% possible package set names. |
| 336 |
% \end{pkgoptions} |
| 337 |
% |
| 338 |
% |
| 339 |
% \section{Macros and environments} |
| 340 |
% |
| 341 |
% \subsection{Sections and paragraphs} |
| 342 |
% |
| 343 |
% \DescribeMacro{\section} \DescribeMacro{\paragraph} This class only provides |
| 344 |
% two sectioning levels: |\section| and |\paragraph|. Both produce run-in |
| 345 |
% headings. |
| 346 |
% |
| 347 |
% By default, sections and paragraphs produce a small ``decoration'' in the left |
| 348 |
% margin, to guide the reader's eye through the document's high-level structure. |
| 349 |
% |
| 350 |
% You can disable/enable section and paragraph decorations with the |
| 351 |
% |sectiondecorations|, |paragraphdecorations| and |noheadingdecorations| class |
| 352 |
% options. |
| 353 |
% |
| 354 |
% The |\section| and |\paragraph| macros also accept a special syntax: If they |
| 355 |
% are immediately followed by an exclamation mark (|!|), then they do not |
| 356 |
% produce the corresponding decoration. E.g.: |
| 357 |
% \begin{verbatim} |
| 358 |
% \section!{A section heading without its decoration} |
| 359 |
% \end{verbatim} |
| 360 |
% |
| 361 |
% Also, section and paragraphs will not produce any horizontal space if the |
| 362 |
% title is empty. You can use this feature to produce the spacing and |
| 363 |
% decoration of a section, but not the heading: |
| 364 |
% \begin{verbatim} |
| 365 |
% \section{} This line has the vertical spacing and decoration |
| 366 |
% associated with a section, but with no run-in heading. |
| 367 |
% |
| 368 |
% \section!{} This line has the vertical spacing associated |
| 369 |
% with a section, but with no decoration or run-in heading. |
| 370 |
% \end{verbatim} |
| 371 |
% |
| 372 |
% You can also use the additional syntax |<|\emph{\ldots}|>| to specify a custom |
| 373 |
% decoration instead of the default one. (But you should only use this |
| 374 |
% sparingly! Redefine |\phfeaSectionDecorationSymbol| if you want to change the |
| 375 |
% symbol for all sections!) For instance: |
| 376 |
% |
| 377 |
% \begin{verbatim} |
| 378 |
% \section<\guilsinglright>{} \emph{Manuscript in preparation.} |
| 379 |
% \end{verbatim} |
| 380 |
% |
| 381 |
% Here's a summary of the argument structure for |\section| and |\paragraph|: |
| 382 |
% |
| 383 |
% |\section|{\large\textbar}|\paragraph| |
| 384 |
% \emph{[} |*| \emph{]} \emph{[} |!| \emph{]} |
| 385 |
% \emph{[} |<|\meta{decoration}|>| \emph{]} |
| 386 |
% \emph{[} \oarg{alt title} \emph{]} |
| 387 |
% \marg{title} |
| 388 |
% |
| 389 |
% The optional star and optional alternative title are passed on to the standard |
| 390 |
% \LaTeX\ sectioning commands. The alternative title is typically used for the |
| 391 |
% table of contents and for PDF bookmarks. |
| 392 |
% |
| 393 |
% \DescribeMacro{\phfeaSectionDecoration} |
| 394 |
% \DescribeMacro{\phfeaParagraphDecoration} You can use the |
| 395 |
% |\phfeaSectionDecoration{<symbol>}| and |\phfeaParagraphDecoration{<symbol>}| |
| 396 |
% to manually place a section or paragraph decoration at any place: |
| 397 |
% \begin{verbatim} |
| 398 |
% \phfeaSectionDecoration{$\to$} Check out our website at |
| 399 |
% \href{https://github.com/phfaist/phfqitltx}{github.com/phfaist/phfqitltx} |
| 400 |
% \end{verbatim} |
| 401 |
% |
| 402 |
% If the |sectiondecorations=false| class option was specified, the macro |
| 403 |
% |\phfeaSectionDecoration{...}| produces no output. Similarly, |
| 404 |
% |\phfeaParagraphDecoration{...}| does nothing if |paragraphdecoration=false| |
| 405 |
% was specified. |
| 406 |
% |
| 407 |
% \DescribeMacro{\phfeaSectionDecorationSymbol} |
| 408 |
% \DescribeMacro{\phfeaParagraphDecorationSymbol} |
| 409 |
% The default section and paragraph symbols (including size and vertical |
| 410 |
% adjustments) are stored in the |\phfeaSectionDecorationSymbol| and |
| 411 |
% |\phfeaParagraphDecorationSymbol| macros. You can redefine these macros to |
| 412 |
% set custom decoration symbols: |
| 413 |
% \begin{verbatim} |
| 414 |
% \renewcommand{\phfeaSectionDecorationSymbol}{\Large$\Rightarrow$} |
| 415 |
% \renewcommand{\phfeaParagraphDecorationSymbol}{\raisebox{1pt}{\tiny $>$}} |
| 416 |
% \end{verbatim} |
| 417 |
% |
| 418 |
% You can customize section and paragraph headings, including spacing and style, |
| 419 |
% by redefining the following macros. |
| 420 |
% |
| 421 |
% \DescribeMacro{\phfeaSectionBeforeSkip} |
| 422 |
% \DescribeMacro{\phfeaSectionAfterHSkip} The macro |\phfeaSectionBeforeSkip| |
| 423 |
% (it's a macro, not a length) is used to specify the vertical spacing before a |
| 424 |
% new section heading. The macro (not length) |\phfeaSectionAfterHSkip| is the |
| 425 |
% horizontal space between the end of the section heading and the beginning of |
| 426 |
% the section text contents. You can redefine these macros to set your custom |
| 427 |
% spacings. (If you're looking to compress the vertical spacings to save on the |
| 428 |
% number of pages, look at the |compressverticalspacings=| class option and the |
| 429 |
% |\phfeaVerticalSpacingCompressionFactor| macro.) |
| 430 |
% |
| 431 |
% \DescribeMacro{\phfeaParagraphBeforeSkip} |
| 432 |
% \DescribeMacro{\phfeaParagraphAfterHSkip} The macros |
| 433 |
% |\phfeaParagraphBeforeSkip| and |\phfeaParagraphAfterHSkip| behave similarly |
| 434 |
% for paragraphs. |
| 435 |
% |
| 436 |
% \DescribeMacro{\phfeaSectionStyle} \DescribeMacro{\phfeaParagraphStyle} The |
| 437 |
% macros |\phfeaSectionStyle| and |\phfeaParagraphStyle| are used to set the |
| 438 |
% style of the section and paragraph headings. By default, the default |
| 439 |
% sans/heading style is used at the normal size and in bold face series for |
| 440 |
% sections, and the normal sans style is used at a smaller size for paragraph |
| 441 |
% headings. |
| 442 |
% |
| 443 |
% \DescribeMacro{\phfeaSectionFormatHeading} |
| 444 |
% \DescribeMacro{\phfeaParagraphFormatHeading} The macros |
| 445 |
% |\phfeaSectionFormatHeading{...}| and |\phfeaParagraphFormatHeading{...}| can |
| 446 |
% be redefined to format the section and paragraph headings, respectively. You |
| 447 |
% can redefine these macros to add punctuation, to capitalize the title, etc. |
| 448 |
% For instance: |
| 449 |
% \begin{verbatim} |
| 450 |
% \renewcommand\phfeaSectionFormatHeading[1]{\MakeUppercase{#1}\ ---} |
| 451 |
% \end{verbatim} |
| 452 |
% |
| 453 |
% The macros |\phfeaSectionFormatHeading{...}| and |
| 454 |
% |\phfeaParagraphFormatHeading{...}| are not called if the section/paragraph |
| 455 |
% title argument is empty. |
| 456 |
% |
| 457 |
% |
| 458 |
% \subsection{Vertical spacing} |
| 459 |
% |
| 460 |
% \DescribeMacro{\phfeaVerticalSpacingCompressionFactor} To |
| 461 |
% conveniently globally adjust the vertical spacings in the document (including |
| 462 |
% the section and paragraph vertical spacings, as well as the spacing above and |
| 463 |
% below theorems, itemize, and enumerate environments), you can also use the |
| 464 |
% |compressverticalspacing=X| class option. Alternatively, you can redefine the |
| 465 |
% macro |\phfeaVerticalSpacingCompressionFactor| to the desired compression |
| 466 |
% factor: |
| 467 |
% \begin{verbatim} |
| 468 |
% \renewcommand\phfeaVerticalSpacingCompressionFactor{0.7} |
| 469 |
% \end{verbatim} |
| 470 |
% |
| 471 |
% \DescribeMacro{\phfeaDefineTheoremStyle} Because the theorem style |
| 472 |
% |phfextendedabstracthm| is defined at the time that the class is loaded, any |
| 473 |
% customization of |\phfeaVerticalSpacingCompressionFactor| and |
| 474 |
% |\phfeaListsVerticalSkip| that happen later in the preamble aren't taken into |
| 475 |
% account. If you change these values in your preamble, you should call |
| 476 |
% |\phfeaDefineTheoremStyle| to redefine the theorem style after your |
| 477 |
% customization. |
| 478 |
% |
| 479 |
% \DescribeMacro{\phfeaDisplayVerticalSpacingFactorWeight} The |
| 480 |
% vertical spacing factor also affects the vertical spacing around equations, |
| 481 |
% but to a lesser extent. (Compressing the space around the equations by too |
| 482 |
% much would not look nice.) For the spacing between equations, we take the |
| 483 |
% weighted average of $1$ and the vertical spacing compression factor, where the |
| 484 |
% weight is given in the macro |\phfeaDisplayVerticalSpacingFactorWeight|. A |
| 485 |
% weight of |0| means the vertical compression factor doesn't affect the |
| 486 |
% vertical spacing around equations at all; a weight of |1| means the spacing |
| 487 |
% around the equations is scaled exactly by the vertical compression factor. |
| 488 |
% |
| 489 |
% \DescribeMacro{\phfeaParskipVerticalSpacingFactorWeight} A similar mechanism |
| 490 |
% happens for how we adjust |\parskip|, the spacing between paragraphs. |
| 491 |
% |
| 492 |
% |
| 493 |
% \subsection{List environments} |
| 494 |
% |
| 495 |
% \DescribeEnv{enumerate*} This class provides an |enumerate|-like |
| 496 |
% environment which typesets its items inline, as a list. For example, here is |
| 497 |
% an inline paragraph with (a) one, (b) two, and (c) three points. |
| 498 |
% \iffalse yeah, I cheated for this doc code, whatever \fi |
| 499 |
% |
| 500 |
% The |enumerate*| can be used exactly like you'd use the |enumerate| |
| 501 |
% environment from the \pkgname{enumitem} package, for instance: |
| 502 |
% \begin{verbatim} |
| 503 |
% here is an inline paragraph with \begin{enumerate*}[label=(\alph*)] |
| 504 |
% \item one, |
| 505 |
% \item two, |
| 506 |
% \item three |
| 507 |
% \end{enumerate*} |
| 508 |
% points. |
| 509 |
% \end{verbatim} |
| 510 |
% |
| 511 |
% Check \pkgname{enumitem}'s documentation for inline lists. You can specify |
| 512 |
% for instance the keys |before={{}}|, |itemjoin={{ }}|, and \relax\relax\relax |
| 513 |
% |itemjoin*={{ and }}| either as an optional argument to |
| 514 |
% |\begin{enumerate*}| \iffalse\end{enumerate*}\fi or using |
| 515 |
% |\setlist|: |
| 516 |
% \begin{verbatim} |
| 517 |
% \setlist[enumerate*]{% |
| 518 |
% itemjoin*={{ et }}% |
| 519 |
% } |
| 520 |
% \end{verbatim} |
| 521 |
% |
| 522 |
% \DescribeMacro{\phfeaListsVerticalSkip} \DescribeMacro{\phfeaListsItemSep} |
| 523 |
% \DescribeMacro{\phfeaListsParSep} For (non-inline) list environments such as |
| 524 |
% |itemize| and |enumerate|, you can redefine |\phfeaListsVerticalSkip|, |
| 525 |
% |\phfeaListsItemSep|, and |\phfeaListsParSep| to set the |topsep|, |itemsep| |
| 526 |
% and |parsep| properties of all of \pkgname{enumitem}'s list environments. |
| 527 |
% These correspond to the vertical space above and below lists, the space |
| 528 |
% between items, and the space between paragraphs within an item. All these |
| 529 |
% spacings automatically get compressed according to the |
| 530 |
% |\phfeaVerticalSpacingCompressionFactor|. |
| 531 |
% |
| 532 |
% Note that |\phfeaListsVerticalSkip| is also used for the spacing above and |
| 533 |
% below theorem environments. |
| 534 |
% |
| 535 |
% |
| 536 |
% \subsection{Customization of the main title and general headings style} |
| 537 |
% \label{sec:customize-title-and-headings-style} |
| 538 |
% |
| 539 |
% \DescribeMacro{\phfeaHeadingStyle} The macro |\phfeaHeadingStyle| is defined to be |
| 540 |
% |\sffamily|, unless the |sansstyle=false| class option is provided |
| 541 |
% in which case the macro expands to nothing. You can redefine it to give a |
| 542 |
% different general style to your main title and your section and paragraph |
| 543 |
% headings. |
| 544 |
% |
| 545 |
% \DescribeMacro{\phfeaTitleStyle} The macro |\phfeaTitleStyle| sets the font |
| 546 |
% style for the main document title. By default the macro is defined to |
| 547 |
% |\phfeaHeadingStyle\Large|. Redefine this macro to change the title style. |
| 548 |
% |
| 549 |
% For instance, if you prefer \RevTeX's own simple boldface title, you can use: |
| 550 |
% \begin{verbatim} |
| 551 |
% \renewcommand\phfeaTitleStyle{\bfseries} |
| 552 |
% \end{verbatim} |
| 553 |
% |
| 554 |
% |
| 555 |
% |
| 556 |
% |
| 557 |
% |
| 558 |
% \StopEventually{\vskip 3cm plus 2cm minus 2cm\relax\PrintChanges |
| 559 |
% \vskip 3cm plus 2cm minus 2cm\relax\PrintIndex} |
| 560 |
% |
| 561 |
% |
| 562 |
% |
| 563 |
% \section{Implementation} |
| 564 |
% |
| 565 |
% Here come the gory details. |
| 566 |
% |
| 567 |
% |
| 568 |
% \paragraph{Class options} |
| 569 |
% We process these first, to see which options we should pass on to |
| 570 |
% \RevTeX. |
| 571 |
% \begin{macrocode} |
| 572 |
\RequirePackage{kvoptions} |
| 573 |
\SetupKeyvalOptions{% |
| 574 |
family=phfea,% |
| 575 |
prefix=phfeaopt@% |
| 576 |
} |
| 577 |
\DeclareStringOption[]{papertype} |
| 578 |
\DeclareStringOption[11pt]{ptsize} |
| 579 |
\DeclareBoolOption[true]{sectiondecorations} |
| 580 |
\DeclareBoolOption[true]{paragraphdecorations} |
| 581 |
\DeclareVoidOption{noheadingdecorations}{% |
| 582 |
\phfeaopt@sectiondecorationsfalse |
| 583 |
\phfeaopt@paragraphdecorationsfalse |
| 584 |
} |
| 585 |
\DeclareBoolOption[true]{loadtheorems} |
| 586 |
\DeclareBoolOption[true]{sansstyle} |
| 587 |
\DeclareStringOption[1]{compressverticalspacing} |
| 588 |
\DeclareBoolOption[true]{usehyperref} |
| 589 |
\DeclareStringOption[extended]{pkgset} |
| 590 |
\ProcessKeyvalOptions* |
| 591 |
% \end{macrocode} |
| 592 |
% |
| 593 |
% |
| 594 |
% \paragraph{Load \RevTeX, the base class} |
| 595 |
% |
| 596 |
% \begin{macrocode} |
| 597 |
\providecommand\phfea@revtexopts{% |
| 598 |
aps,pra,% |
| 599 |
notitlepage,reprint,% |
| 600 |
onecolumn,tightenlines,% |
| 601 |
superscriptaddress,% |
| 602 |
nofootinbib% |
| 603 |
} |
| 604 |
\PassOptionsToClass{% |
| 605 |
\phfea@revtexopts,% |
| 606 |
\phfeaopt@ptsize,% |
| 607 |
\phfeaopt@papertype,% |
| 608 |
}{revtex4-2} |
| 609 |
\LoadClass{revtex4-2} |
| 610 |
% \end{macrocode} |
| 611 |
% |
| 612 |
% We will also need the \pkgname{xparse} command for defining some of our |
| 613 |
% commands. |
| 614 |
% \begin{macrocode} |
| 615 |
\RequirePackage{xparse} |
| 616 |
% \end{macrocode} |
| 617 |
% |
| 618 |
% \paragraph{Load \pkgname{phfnote} for the basic document setup} |
| 619 |
% |
| 620 |
% \begin{macrocode} |
| 621 |
\PassOptionsToPackage{% |
| 622 |
preset=reset,% |
| 623 |
pkgset=\phfeaopt@pkgset,% |
| 624 |
\ifphfeaopt@usehyperref |
| 625 |
hyperrefdefs={defer,noemail},% |
| 626 |
\fi |
| 627 |
}{phfnote} |
| 628 |
\RequirePackage{phfnote} |
| 629 |
% \end{macrocode} |
| 630 |
% |
| 631 |
% |
| 632 |
% \paragraph{Page geometry} |
| 633 |
% |
| 634 |
% Set a default page geometry. Works both for A4 paper and for letter paper. |
| 635 |
% It's optimized for 11pt size, though. |
| 636 |
% \begin{macrocode} |
| 637 |
\RequirePackage{geometry} |
| 638 |
\geometry{hmargin=0.75in,vmargin=0.75in,marginparwidth=0.5in,marginparsep=0.125in} |
| 639 |
% \end{macrocode} |
| 640 |
% |
| 641 |
% |
| 642 |
% \paragraph{Default sans serif font} |
| 643 |
% |
| 644 |
% \begin{macro}{\phfeaHeadingStyle} |
| 645 |
% Unless instructed not to do so, \iffalse load the ``Source Sans Pro'' font |
| 646 |
% as default sans serif font, using the semibold glyphs in place of bold. By |
| 647 |
% default, this font will \else set the sans serif font family to \fi be used |
| 648 |
% for section headings and the main title. |
| 649 |
% \begin{macrocode} |
| 650 |
\ifphfeaopt@sansstyle |
| 651 |
\def\phfeaHeadingStyle{\sffamily} |
| 652 |
\else |
| 653 |
\def\phfeaHeadingStyle{} |
| 654 |
\fi |
| 655 |
% \end{macrocode} |
| 656 |
% \end{macro} |
| 657 |
% |
| 658 |
% |
| 659 |
% \paragraph{Default title format} |
| 660 |
% |
| 661 |
% \begin{macro}{\phfeaTitleStyle} |
| 662 |
% Change \RevTeX\ title format. Title style can be customized by redefining |
| 663 |
% |\phfeaTitleStyle|. |
| 664 |
% \begin{macrocode} |
| 665 |
\def\phfeaTitleStyle{\phfeaHeadingStyle\Large} |
| 666 |
\def\frontmatter@title@format{\phfeaTitleStyle\centering\parskip\z@skip} |
| 667 |
% \end{macrocode} |
| 668 |
% \end{macro} |
| 669 |
% |
| 670 |
% |
| 671 |
% \paragraph{Vertical spacing compression factor} |
| 672 |
% |
| 673 |
% Define a general factor by which the section and paragraph spacings will be |
| 674 |
% compressed. This macro is set by the |compressverticalspacing=X| package |
| 675 |
% option. |
| 676 |
% \begin{macrocode} |
| 677 |
\edef\phfeaVerticalSpacingCompressionFactor{\phfeaopt@compressverticalspacing} |
| 678 |
% \end{macrocode} |
| 679 |
% |
| 680 |
% Tool for scaling glue expressions (for use with our vertical compression |
| 681 |
% factor):\footnote{Thanks \url{https://tex.stackexchange.com/a/198966/32188}\,!} |
| 682 |
% \begin{macrocode} |
| 683 |
\def\phfea@scaleglue#1#2{% {factor}{glueexpr} |
| 684 |
\glueexpr#2*\numexpr\dimexpr#1pt\relax\relax/65536\relax |
| 685 |
} |
| 686 |
\def\phfea@scalegluedpt#1#2{% {factor given as dimexpr in pt}{glueexpr} |
| 687 |
\glueexpr#2*\numexpr#1\relax/65536\relax |
| 688 |
} |
| 689 |
% \end{macrocode} |
| 690 |
% |
| 691 |
% Adjust spacing around display equations according to the vertical compression |
| 692 |
% factor. Do this only at the beginning of the document, since the user might |
| 693 |
% still want to adjust |\phfeaVerticalSpacingCompressionFactor| in their |
| 694 |
% preamble. |
| 695 |
% |
| 696 |
% \begin{macro}{\phfeaDisplayVerticalSpacingFactorWeight} |
| 697 |
% We only apply a fraction of the scaling, because it's ugly if we compress |
| 698 |
% equations too much. Define |\phfeaDisplayVerticalSpacingFactorWeight| as $w$ and |
| 699 |
% $\alpha$ as the vertical scaling factor. The new skips are computed as |
| 700 |
% \begin{equation*} |
| 701 |
% \phfverb{oldskip}\quad\rightarrow\quad |
| 702 |
% (1-w)\,\phfverb{oldskip} + w\,\alpha\,\phfverb{oldskip}\ . |
| 703 |
% \end{equation*} |
| 704 |
% (For $w=0$ we have $\phfverb{oldskip}\rightarrow\phfverb{oldskip}$. For $w=1$ |
| 705 |
% the full scaling factor is applied, |
| 706 |
% $\phfverb{oldskip}\rightarrow \alpha\,\phfverb{oldskip}$.) By default, |
| 707 |
% $w=1/2$: |
| 708 |
% \begin{macrocode} |
| 709 |
\def\phfeaDisplayVerticalSpacingFactorWeight{.5} |
| 710 |
% \end{macrocode} |
| 711 |
% \end{macro} |
| 712 |
% Tool to compute the new spacing for each of the relevant display-related |
| 713 |
% skips: |
| 714 |
% \begin{macrocode} |
| 715 |
\def\phfea@adjustskipweighted#1#2{% |
| 716 |
#1=\glueexpr |
| 717 |
\phfea@scalegluedpt{% |
| 718 |
\dimexpr 1\p@ - #2\p@\relax |
| 719 |
}{#1}% |
| 720 |
+ |
| 721 |
\phfea@scaleglue{% |
| 722 |
#2% |
| 723 |
}{% |
| 724 |
\phfea@scaleglue{% |
| 725 |
\phfeaVerticalSpacingCompressionFactor |
| 726 |
}{% |
| 727 |
#1 |
| 728 |
}% |
| 729 |
}% |
| 730 |
\relax |
| 731 |
} |
| 732 |
% \end{macrocode} |
| 733 |
% And schedule this adjustment to be carried out at the beginning of the |
| 734 |
% document. |
| 735 |
% \begin{macrocode} |
| 736 |
\AtBeginDocument{% |
| 737 |
\phfea@adjustskipweighted\abovedisplayskip\phfeaDisplayVerticalSpacingFactorWeight |
| 738 |
\phfea@adjustskipweighted\belowdisplayskip\phfeaDisplayVerticalSpacingFactorWeight |
| 739 |
\phfea@adjustskipweighted\abovedisplayshortskip\phfeaDisplayVerticalSpacingFactorWeight |
| 740 |
\phfea@adjustskipweighted\belowdisplayshortskip\phfeaDisplayVerticalSpacingFactorWeight |
| 741 |
} |
| 742 |
% \end{macrocode} |
| 743 |
% |
| 744 |
% \begin{macro}{\phfeaParskipVerticalSpacingFactorWeight} |
| 745 |
% A similar mechanism affects how we adjust the paragraph skip length |
| 746 |
% |\parskip|. |
| 747 |
% \begin{macrocode} |
| 748 |
\def\phfeaParskipVerticalSpacingFactorWeight{1} |
| 749 |
\AtBeginDocument{% |
| 750 |
\phfea@adjustskipweighted\parskip\phfeaParskipVerticalSpacingFactorWeight |
| 751 |
} |
| 752 |
% \end{macrocode} |
| 753 |
% \end{macro} |
| 754 |
% |
| 755 |
% \paragraph{Setup specific for sectioning} |
| 756 |
% |
| 757 |
% By design, there are only two sectioning levels in a |
| 758 |
% \pkgname{phfextendedabstract} document: sections (|\section|) and paragraphs |
| 759 |
% (|\paragraph|). Any other sectioning command (e.g., |\subsection|) will |
| 760 |
% produce an error. |
| 761 |
% |
| 762 |
% Neither of these two section levels is numbered. |
| 763 |
% \begin{macrocode} |
| 764 |
\setcounter{secnumdepth}{0} |
| 765 |
\setcounter{tocdepth}{1} |
| 766 |
% \end{macrocode} |
| 767 |
% |
| 768 |
% \begin{macro}{\phfeaSectionBeforeSkip} |
| 769 |
% \begin{macro}{\phfeaSectionAfterHSkip} |
| 770 |
% \begin{macro}{\phfeaSectionStyle} |
| 771 |
% \begin{macro}{\phfeaSectionDecoration} |
| 772 |
% \begin{macro}{\phfeaSectionDecorationSymbol} |
| 773 |
% Some helper and customization macros for |\section|. |
| 774 |
% \begin{macrocode} |
| 775 |
\def\phfeaSectionBeforeSkip{1.5ex plus 0.8ex minus 0.25ex} |
| 776 |
\def\phfeaSectionAfterHSkip{1em plus 0.2em} |
| 777 |
\def\phfeaSectionStyle{\normalfont\normalsize\phfeaHeadingStyle\bfseries} |
| 778 |
\def\phfeaSectionFormatHeading#1{#1} |
| 779 |
\def\phfeaSectionDecorationSymbol{% |
| 780 |
\raisebox{0.2ex}{{\notesmaller[0.4]{\ensuremath{\blacksquare}}}}} |
| 781 |
\ifphfeaopt@sectiondecorations |
| 782 |
\def\phfeaSectionDecoration#1{% |
| 783 |
\makebox[\z@][r]{{#1}\hspace*{1.5ex}}% |
| 784 |
} |
| 785 |
\else |
| 786 |
\def\phfeaSectionDecoration#1{} |
| 787 |
\fi |
| 788 |
% \end{macrocode} |
| 789 |
% \end{macro} |
| 790 |
% \end{macro} |
| 791 |
% \end{macro} |
| 792 |
% \end{macro} |
| 793 |
% \end{macro} |
| 794 |
% |
| 795 |
% \needspace{5\baselineskip} |
| 796 |
% \begin{macro}{\phfeaParagraphBeforeSkip} |
| 797 |
% \begin{macro}{\phfeaParagraphAfterHSkip} |
| 798 |
% \begin{macro}{\phfeaParagraphStyle} |
| 799 |
% \begin{macro}{\phfeaParagraphDecoration} |
| 800 |
% \begin{macro}{\phfeaParagraphDecorationSymbol} |
| 801 |
% Same helper and customization macros, now for |\paragraph|. |
| 802 |
% \begin{macrocode} |
| 803 |
\def\phfeaParagraphBeforeSkip{0.6ex plus 0.4ex minus 0.1ex} |
| 804 |
\def\phfeaParagraphAfterHSkip{0.75em plus 0.15em} |
| 805 |
\def\phfeaParagraphStyle{\normalfont\normalsize\phfeaHeadingStyle\small} |
| 806 |
\def\phfeaParagraphFormatHeading#1{#1} |
| 807 |
\def\phfeaParagraphDecorationSymbol{% |
| 808 |
\raisebox{0.2ex}{{\notesmaller[0.6]{\ensuremath{\triangleright}}}}} |
| 809 |
\ifphfeaopt@paragraphdecorations |
| 810 |
\def\phfeaParagraphDecoration#1{% |
| 811 |
\makebox[\z@][r]{{#1}\hspace*{1ex}}% |
| 812 |
} |
| 813 |
\else |
| 814 |
\def\phfeaParagraphDecoration#1{} |
| 815 |
\fi |
| 816 |
% \end{macrocode} |
| 817 |
% \end{macro} |
| 818 |
% \end{macro} |
| 819 |
% \end{macro} |
| 820 |
% \end{macro} |
| 821 |
% \end{macro} |
| 822 |
% |
| 823 |
% Now we redefine |\section| and |\paragraph| for formatting. Also allow |
| 824 |
% |\section!| and |\paragraph!| that remove the decoration and |\section<...>| |
| 825 |
% and |\paragraph<...>| that replace the decoration. In all cases, the indent |
| 826 |
% is removed if the main argument (section/paragraph title) is an empty |
| 827 |
% argument. We also accept a starred version and an optional argument, and pass |
| 828 |
% those on to |\@startsection|; these options are sometimes useful in order to |
| 829 |
% work around fragile tokens in the title, etc. |
| 830 |
% |
| 831 |
% We start with the generic code that will call |\@startsection| for both |
| 832 |
% sections and paragraphs. The generic code will be given the level number (|1| |
| 833 |
% or |2|) and will produce the correct |\@startsection| code for that level, |
| 834 |
% fetching its information from the correctly named macros. We first define |
| 835 |
% some simple definitions that specify where to look for those level-specific |
| 836 |
% macros. |
| 837 |
% \begin{macrocode} |
| 838 |
\def\phfea@ss@levelname#1{\ifcase#1\or section\or paragraph\fi} |
| 839 |
\def\phfea@ss@levelName#1{\ifcase#1\or Section\or Paragraph\fi} |
| 840 |
\def\phfea@ss@get#1#2{% <levelno><MacroPostfixName> |
| 841 |
\csname phfea\phfea@ss@levelName{#1}#2\endcsname} |
| 842 |
\def\phfea@ss@getnoexpand#1#2{% <levelno><MacroPostfixName> |
| 843 |
\expandafter\noexpand\csname phfea\phfea@ss@levelName{#1}#2\endcsname} |
| 844 |
% \end{macrocode} |
| 845 |
% |
| 846 |
% \begin{macro}{\phfea@startsection} |
| 847 |
% We now define the main internal |\phfea@startsection| macro which will |
| 848 |
% produce the correct |\@startsection| command for the given section level. |
| 849 |
% The arguments to |\phfea@startsection| are: |
| 850 |
% \begin{itemize}[itemsep=0pt,topsep=0pt] |
| 851 |
% \item[\#1:] level number, |1| or |2|; |
| 852 |
% \item[\#2:] an optional star; |
| 853 |
% \item[\#3:] an optional |!| character (meaning, don't display the decoration); |
| 854 |
% \item[\#4:] an optional |<|\meta{decoration tokens}|>| argument to |
| 855 |
% replace the decoration; |
| 856 |
% \item[\#5:] an optional argument, the alternative title to write in the AUX |
| 857 |
% file (e.g.\@ for use in the table of contents); |
| 858 |
% \item[\#6:] a mandatory argument, the title of the section/paragraph. |
| 859 |
% \end{itemize} |
| 860 |
% \begin{macrocode} |
| 861 |
\newtoks\phfea@ss@decorationtoks |
| 862 |
\newtoks\phfea@ss@alttitle |
| 863 |
\newtoks\phfea@ss@title |
| 864 |
\NewDocumentCommand{\phfea@startsection}{m s t! d<> o m}{% |
| 865 |
% \end{macrocode} |
| 866 |
% Store the alternative title and title in token registers. |
| 867 |
% \begin{macrocode} |
| 868 |
\phfea@ss@decorationtoks={#4}% |
| 869 |
\phfea@ss@alttitle={#5}% |
| 870 |
\phfea@ss@title={#6}% |
| 871 |
% \end{macrocode} |
| 872 |
% Inform the user in case of option inconsistencies or redundancies. |
| 873 |
% \begin{macrocode} |
| 874 |
\IfNoValueF{#4}{% |
| 875 |
\IfBooleanT{#3}{% |
| 876 |
\PackageWarning{phfextendedabstract}{section/paragraph: `!' |
| 877 |
modifier ignored when custom decoration `<...>' is specified}% |
| 878 |
}% |
| 879 |
}% |
| 880 |
% \end{macrocode} |
| 881 |
% Now define a temporary macro |\x| that will contain the correct code for a |
| 882 |
% call to \LaTeX' low-level |\@startsection| command. Remember to prefix all |
| 883 |
% macros by |\noexpand| unless they should be expanded in the preparation of |
| 884 |
% that code for |\@startsection|. \LaTeX' |\@startsection| takes a lot of |
| 885 |
% arguments, let's be careful not to miss any. Also, we can use the convenient |
| 886 |
% construct |\phfea@ss@getnoexpand{#1}{XyzProperty}| which in this |\edef| will |
| 887 |
% expand to |
| 888 |
% |\noexpand\phfea|\emph{$\langle$}|Section|\emph{\textbar}\relax |
| 889 |
% |Paragraph|\emph{$\rangle$}|XyzProperty|. |
| 890 |
% \begin{macrocode} |
| 891 |
\edef\x{% |
| 892 |
\noexpand\@startsection{\phfea@ss@levelname{#1}}% |
| 893 |
% \end{macrocode} |
| 894 |
% First come the \meta{level number} and \meta{indent} arguments: |
| 895 |
% \begin{macrocode} |
| 896 |
{#1}% |
| 897 |
{\z@}% |
| 898 |
% \end{macrocode} |
| 899 |
% Then comes the \meta{before skip} argument. Use |\phfea@scaleglue| to account for |
| 900 |
% the vertical compression factor. |
| 901 |
% \begin{macrocode} |
| 902 |
{% |
| 903 |
\noexpand\phfea@scaleglue{\noexpand\phfeaVerticalSpacingCompressionFactor}{% |
| 904 |
\noexpand\glueexpr\phfea@ss@getnoexpand{#1}{BeforeSkip}\noexpand\relax |
| 905 |
}% |
| 906 |
}% |
| 907 |
% \end{macrocode} |
| 908 |
% Then comes the \meta{after skip} argument. Set the after skip to zero if the |
| 909 |
% title is empty, otherwise specify the given |
| 910 |
% |\phfeaSection/ParagraphAfterHSkip| as a negative value to indicate we want a |
| 911 |
% run-in heading. Note that while the syntax `|1.5\glueexpr...|' doesn't |
| 912 |
% preserve plus/minus stretchability components as it coerces the glue to a |
| 913 |
% dimen, the syntax `|-\glueexpr...|' does preserve these components (presumably |
| 914 |
% because $-1$ is integer?). |
| 915 |
% \begin{macrocode} |
| 916 |
{\if\relax\detokenize{#6}\relax |
| 917 |
\noexpand\z@ |
| 918 |
\else |
| 919 |
-\noexpand\glueexpr\phfea@ss@getnoexpand{#1}{AfterHSkip}\noexpand\relax |
| 920 |
\fi}% |
| 921 |
% \end{macrocode} |
| 922 |
% The \meta{style} argument to specify the section heading's font style. We |
| 923 |
% provide a decoration, possibly a custom decoration if provided with the |
| 924 |
% |<...>| syntax; we remove the default decoration if the no-decoration argument |
| 925 |
% (a |!| character) was specified. |
| 926 |
% \begin{macrocode} |
| 927 |
{% |
| 928 |
\IfNoValueTF{#4}{% |
| 929 |
\IfBooleanTF{#3}{% with "!", no custom decoration --> nothing |
| 930 |
}{% no "!", no custom decoration |
| 931 |
\phfea@ss@getnoexpand{#1}{Decoration}% |
| 932 |
\phfea@ss@getnoexpand{#1}{DecorationSymbol}% |
| 933 |
}% |
| 934 |
}{% with custom decoration (ignores "!" argument) |
| 935 |
\phfea@ss@getnoexpand{#1}{Decoration}% |
| 936 |
{\the\phfea@ss@decorationtoks}% |
| 937 |
}% |
| 938 |
\phfea@ss@getnoexpand{#1}{Style}% |
| 939 |
}% |
| 940 |
% \end{macrocode} |
| 941 |
% An optional |*| indicates the starred version of the sectioning commands. If |
| 942 |
% the user increased the |secnumcounter| to have numbered sections, then the |
| 943 |
% starred variant gives a section heading without any section number or TOC |
| 944 |
% entry. |
| 945 |
% \begin{macrocode} |
| 946 |
\IfBooleanT{#2}{*}% |
| 947 |
% \end{macrocode} |
| 948 |
% Now comes the optional \meta{alternative title} argument that will be written |
| 949 |
% to the AUX file. We always provide this argument to |\@startsection|, |
| 950 |
% specifying by default the main title argument |#6| (non-starred variant) or an |
| 951 |
% empty argument (for a starred variant). We do this because otherwise, |
| 952 |
% |\@startsection| will copy all the other commands we add in its argument |
| 953 |
% (e.g., title formatting, etc.) and will write them to the AUX file. |
| 954 |
% \begin{macrocode} |
| 955 |
\IfValueTF{#4}{[\the\phfea@ss@alttitle]}{% |
| 956 |
\IfBooleanTF{#2}{[]}{[\the\phfea@ss@title]}% |
| 957 |
}% |
| 958 |
% \end{macrocode} |
| 959 |
% Finally, this is the main \meta{section title} argument. |
| 960 |
% If the title is not empty, we also provide the title wrapped in a |
| 961 |
% corresponding |\phfeaSection/ParagraphFormatHeading| macro call. Everything |
| 962 |
% should be protected in |\texorpdfstring| calls to avoid \emph{pdflatex} from |
| 963 |
% complaining about invalid junk in PDF bookmark strings. |
| 964 |
% \begin{macrocode} |
| 965 |
{% |
| 966 |
\if\relax\detokenize{#6}\relax\else |
| 967 |
\noexpand\texorpdfstring{% |
| 968 |
\phfea@ss@getnoexpand{#1}{FormatHeading}{\the\phfea@ss@title}% |
| 969 |
}{% |
| 970 |
\the\phfea@ss@title |
| 971 |
}% |
| 972 |
\fi |
| 973 |
}% |
| 974 |
}% |
| 975 |
%\message{**** EMITTING @startsection: |\detokenize\expandafter{\x}| ***}% |
| 976 |
\x |
| 977 |
} |
| 978 |
% \end{macrocode} |
| 979 |
% \end{macro} |
| 980 |
% |
| 981 |
% \begin{macro}{\section} |
| 982 |
% \begin{macro}{\paragraph} |
| 983 |
% Define |\section| and |\paragraph| as sectioning levels 1 and 2. |
| 984 |
% \begin{macrocode} |
| 985 |
\def\section{\phfea@startsection{1}} |
| 986 |
\def\paragraph{\phfea@startsection{2}} |
| 987 |
% \end{macrocode} |
| 988 |
% \end{macro} |
| 989 |
% \end{macro} |
| 990 |
% |
| 991 |
% Provide an explanative error message if the user attempts to use |
| 992 |
% |\subsection|, |\subsubsection| or |\subparagraph|. |
| 993 |
% \begin{macrocode} |
| 994 |
\def\phfea@nosectioncmd#1{% |
| 995 |
\ClassError{phfextendedabstract}{% |
| 996 |
% |
| 997 |
There is no `\string#1' command in `phfextendedabstract' |
| 998 |
documents. You can only use `\string\section' and |
| 999 |
`\string\paragraph'. If you find yourself needing additional |
| 1000 |
sectioning levels, it might be that your extended abstract is too |
| 1001 |
detailed and you should stick to a higher level description of |
| 1002 |
your results. If you do need additional section levels, it is |
| 1003 |
likely that you will be better off with a different document |
| 1004 |
class. If you'd like to stick with `phfextendedabstract' and you |
| 1005 |
really know what you're doing, then you could redefine the |
| 1006 |
sectioning commands as necessary based on `\string\@startsection' |
| 1007 |
as is done in standard LaTeX classes. Good luck! |
| 1008 |
% |
| 1009 |
}{}% |
| 1010 |
} |
| 1011 |
\def\phfea@nosectioncmd@def#1{% |
| 1012 |
\def#1{\phfea@nosectioncmd#1}% |
| 1013 |
} |
| 1014 |
\phfea@nosectioncmd@def\part |
| 1015 |
\phfea@nosectioncmd@def\chapter |
| 1016 |
\phfea@nosectioncmd@def\subsection |
| 1017 |
\phfea@nosectioncmd@def\subsubsection |
| 1018 |
\phfea@nosectioncmd@def\subparagraph |
| 1019 |
% \end{macrocode} |
| 1020 |
% |
| 1021 |
% |
| 1022 |
% \paragraph{Set up itemization and enumeration environments} |
| 1023 |
% |
| 1024 |
% Provide customizable lengths for lists via macros (item sep, |
| 1025 |
% paragraph sep and vertical skip above and below list environments). |
| 1026 |
% \begin{macro}{\phfeaListsVerticalSkip} |
| 1027 |
% \begin{macro}{\phfeaListsItemSep} |
| 1028 |
% \begin{macro}{\phfeaListsParSep} |
| 1029 |
% \begin{macrocode} |
| 1030 |
\def\phfeaListsVerticalSkip{0.6ex plus 0.4ex minus 0.1ex} |
| 1031 |
\def\phfeaListsItemSep{0.3ex plus 0.15ex minus 0.1ex} |
| 1032 |
\def\phfeaListsParSep{0.7\parskip} |
| 1033 |
% \end{macrocode} |
| 1034 |
% \end{macro} |
| 1035 |
% \end{macro} |
| 1036 |
% \end{macro} |
| 1037 |
% Prepare the commands to run to configure \pkgname{enumitem} correctly in an |
| 1038 |
% internal macro which we will call if \pkgname{enumitem} is indeed loaded. |
| 1039 |
% \begin{macrocode} |
| 1040 |
\def\phfea@setup@enumitem{% |
| 1041 |
% \end{macrocode} |
| 1042 |
% Apply the spacings. |
| 1043 |
% \begin{macrocode} |
| 1044 |
\setlist{% |
| 1045 |
itemsep={% |
| 1046 |
\phfea@scaleglue{% |
| 1047 |
\phfeaVerticalSpacingCompressionFactor}{\phfeaListsItemSep}}, |
| 1048 |
parsep={% |
| 1049 |
\phfea@scaleglue{% |
| 1050 |
\phfeaVerticalSpacingCompressionFactor}{\phfeaListsParSep}}, |
| 1051 |
topsep={% |
| 1052 |
\phfea@scaleglue{% |
| 1053 |
\phfeaVerticalSpacingCompressionFactor}{\phfeaListsVerticalSkip}}, |
| 1054 |
}% |
| 1055 |
% \end{macrocode} |
| 1056 |
% \begin{environment}{enumerate*} |
| 1057 |
% Create the |enumerate*| list enumeration environment. |
| 1058 |
% \begin{macrocode} |
| 1059 |
\newlist{enumerate*}{enumerate*}{1} |
| 1060 |
\setlist[enumerate*]{ |
| 1061 |
label={(\roman*)}, |
| 1062 |
before={}, |
| 1063 |
itemjoin={{ }}, |
| 1064 |
itemjoin*={{ and }} |
| 1065 |
}% |
| 1066 |
} |
| 1067 |
% \end{macrocode} |
| 1068 |
% \end{environment} |
| 1069 |
% And now, check if \pkgname{enumitem} is loaded and apply the definitions. |
| 1070 |
% \begin{macrocode} |
| 1071 |
\@ifpackageloaded{enumitem}{\phfea@setup@enumitem}{} |
| 1072 |
% \end{macrocode} |
| 1073 |
% |
| 1074 |
% |
| 1075 |
% \paragraph{Setup specific for theorems} |
| 1076 |
% |
| 1077 |
% Create a new theorem style called |extendedabstracthm|. Note that if |
| 1078 |
% \pkgname{amsthm} (or similar) wasn't loaded, then |\newtheoremstyle| isn't |
| 1079 |
% defined. In that case, we simply won't define the new theorem style right |
| 1080 |
% now. |
| 1081 |
% \begin{macrocode} |
| 1082 |
\def\phfeaDefineTheoremStyle{% |
| 1083 |
\newtheoremstyle{phfextendedabstractthm}% |
| 1084 |
{\phfea@scaleglue{% |
| 1085 |
\phfeaVerticalSpacingCompressionFactor}{\phfeaListsVerticalSkip}}% |
| 1086 |
{\phfea@scaleglue{% |
| 1087 |
\phfeaVerticalSpacingCompressionFactor}{\phfeaListsVerticalSkip}}% |
| 1088 |
{\itshape}% |
| 1089 |
{\z@}% |
| 1090 |
{\bfseries\itshape}% |
| 1091 |
{:}% |
| 1092 |
{0.8em}% |
| 1093 |
{\thmname{##1\thmnumber{ ##2}\thmnote{ (##3)}}}% |
| 1094 |
} |
| 1095 |
% \end{macrocode} |
| 1096 |
% Ensure we create our new theorem style (only if |\newtheoremstyle| is |
| 1097 |
% available) and load our \pkgname{phfthm} package. Make sure we don't load |
| 1098 |
% \pkgname{phfthm} if we were asked not to load theorems in the class options. |
| 1099 |
% \begin{macrocode} |
| 1100 |
\ifdefined\newtheoremstyle |
| 1101 |
\phfeaDefineTheoremStyle |
| 1102 |
\fi |
| 1103 |
\ifphfeaopt@loadtheorems |
| 1104 |
\ifdefined\newtheoremstyle\else |
| 1105 |
\ClassError{phfextendedabstract}{% |
| 1106 |
% |
| 1107 |
Impossible to load theorems (`loadtheorems=true') because there |
| 1108 |
is no \string\newtheoremstyle\space command that was defined. |
| 1109 |
Consider setting `pkgset=...' so that a theroems-related package |
| 1110 |
(e.g., amsthm) is loaded! (e.g. `pkgset=minimal', `pkgset=rich' |
| 1111 |
or `pkgset=extended'). Alternatively, set the class option |
| 1112 |
`loadtheorems=false' and you can then manually define any |
| 1113 |
theorem environments you'd like using your favorite pacakges. |
| 1114 |
% |
| 1115 |
}{} |
| 1116 |
\fi |
| 1117 |
\PassOptionsToPackage{proofref=false,theoremstyle=phfextendedabstractthm}{phfthm} |
| 1118 |
\RequirePackage{phfthm} |
| 1119 |
\fi |
| 1120 |
% \end{macrocode} |
| 1121 |
% |
| 1122 |
% \iffalse |
| 1123 |
% \paragraph{References section} |
| 1124 |
% |
| 1125 |
% Have a simple section for references. If you'd like to restore \RevTeX' |
| 1126 |
% ornament you can simply do |\let\bibsection\rtxapsbibsection|. |
| 1127 |
% \begin{XXXmacrocode} |
| 1128 |
%% \let\rtxapsbibsection\bibsection |
| 1129 |
%% \def\bibsection{% |
| 1130 |
%% \par\section{\refname}\leavevmode\par\addvspace{4pt}\relax |
| 1131 |
%% %% \par\noindent\rule{6em}{.4pt}\par\addvspace{6pt}\relax |
| 1132 |
%% } |
| 1133 |
% \end{XXXmacrocode} |
| 1134 |
% \fi |
| 1135 |
% |
| 1136 |
% |
| 1137 |
%\Finale |
| 1138 |
\endinput |