Debian Codegraph @

texmf-dist/source/latex/achemso/achemso.dtx

raw
1 % \iffalse meta-comment
2 %
3 % File: achemso.dtx Copyright (C) 2008-2022,2024,2025 Joseph Wright
4 %
5 % It may be distributed and/or modified under the conditions of the
6 % LaTeX Project Public License (LPPL), either version 1.3c of this
7 % license or (at your option) any later version. The latest version
8 % of this license is in the file
9 %
10 % https://www.latex-project.org/lppl.txt
11 %
12 % This file is part of the "achemso bundle" (The Work in LPPL)
13 % and all files in that bundle must be distributed together.
14 %
15 % The released version of this bundle is available from CTAN.
16 %
17 % -----------------------------------------------------------------------
18 %
19 % The development version of the bundle can be found at
20 %
21 % https://github.com/josephwright/achemso
22 %
23 % for those people who are interested.
24 %
25 % -----------------------------------------------------------------------
26 %
27 %<*driver>
28 \documentclass[a4paper]{ltxdoc}
29 \usepackage{achemso,array,booktabs,lmodern}
30 \usepackage[osf]{mathpazo}
31 \usepackage[scaled=0.95]{helvet}
32 \usepackage[final]{listings,microtype}
33 \usepackage[T1]{fontenc}
34 \usepackage[numbered]{hypdoc}
35 \EnableCrossrefs
36 \CodelineIndex
37 \RecordChanges
38 \begin{document}
39 \DocInput{\jobname.dtx}
40 \end{document}
41 %</driver>
42 % \fi
43 %
44 %\GetFileInfo{\jobname.sty}
45 %
46 %\makeatletter
47 %
48 %^^A \DescribeOption is in l3doc but not ltxdoc
49 %\newcommand*\DescribeOption{^^A
50 % \leavevmode
51 % \@bsphack
52 % \begingroup
53 % \MakePrivateLetters
54 % \Describe@Option
55 %}
56 %\newcommand*\Describe@Option[1]{^^A
57 % \endgroup
58 % \marginpar{^^A
59 % \raggedleft
60 % \PrintDescribeEnv{#1}^^A
61 % }%
62 % \SpecialOptionIndex{#1}^^A
63 % \@esphack
64 % \ignorespaces
65 %}
66 %\newcommand*\SpecialOptionIndex[1]{^^A
67 % \@bsphack
68 % \index{^^A
69 % #1\actualchar{\protect\ttfamily#1} (option)\encapchar usage^^A
70 % }^^A
71 % \index{^^A
72 % options:\levelchar#1\actualchar{\protect\ttfamily#1}
73 % \encapchar usage^^A
74 % }^^A
75 % \@esphack
76 %}
77 %
78 %^^A For creating examples with nice highlighting of code, and so
79 %^^A on; based on the system used in the listings source (lstsample).
80 %\lst@RequireAspects{writefile}
81 %\newsavebox{\LaTeXdemo@box}
82 %\lstnewenvironment{LaTeXdemo}[1][code and example]{^^A
83 % \global\let\lst@intname\@empty
84 % \expandafter\let\expandafter\LaTeXdemo@end
85 % \csname LaTeXdemo@#1@end\endcsname
86 % \@nameuse{LaTeXdemo@#1}^^A
87 %}{^^A
88 % \LaTeXdemo@end
89 %}
90 %\newcommand*\LaTeXdemo@new[3]{^^A
91 % \expandafter\newcommand\expandafter*\expandafter
92 % {\csname LaTeXdemo@#1\endcsname}{#2}^^A
93 % \expandafter\newcommand\expandafter*\expandafter
94 % {\csname LaTeXdemo@#1@end\endcsname}{#3}^^A
95 %}
96 %\newcommand*\LaTeXdemo@common{^^A
97 % \setkeys{lst}{
98 % basicstyle = \small\ttfamily,
99 % basewidth = 0.51em,
100 % gobble = 3,
101 % keywordstyle = \color{blue},
102 % language = [LaTeX]{TeX},
103 % moretexcs = {
104 % affiliation,
105 % alsoaffiliation,
106 % altaffiliation,
107 % email,
108 % fax,
109 % natmovechars,
110 % phone,
111 % setkeys
112 % }
113 % }^^A
114 %}
115 %\newcommand*\LaTeXdemo@input{^^A
116 % \MakePercentComment
117 % \catcode`\^^M=10\relax
118 % \small
119 % \begingroup
120 % \setkeys{lst}{
121 % SelectCharTable=\lst@ReplaceInput{\^\^I}{\lst@ProcessTabulator}
122 % }^^A
123 % \leavevmode
124 % \input{\jobname.tmp}^^A
125 % \endgroup
126 % \MakePercentIgnore
127 %}
128 %\LaTeXdemo@new{code and example}{^^A
129 % \setbox\LaTeXdemo@box=\hbox\bgroup
130 % \lst@BeginAlsoWriteFile{\jobname.tmp}^^A
131 % \LaTeXdemo@common
132 %}{^^A
133 % \lst@EndWriteFile
134 % \egroup
135 % \begin{center}
136 % \ifdim\wd\LaTeXdemo@box>0.48\linewidth\relax
137 % \hbox to\linewidth{\box\LaTeXdemo@box\hss}^^A
138 % \begin{minipage}{\linewidth}
139 % \LaTeXdemo@input
140 % \end{minipage}
141 % \else
142 % \begin{minipage}{0.48\linewidth}
143 % \LaTeXdemo@input
144 % \end{minipage}
145 % \hfill
146 % \begin{minipage}{0.48\linewidth}
147 % \hbox to\linewidth{\box\LaTeXdemo@box\hss}^^A
148 % \end{minipage}
149 % \fi
150 % \end{center}
151 %}
152 %\LaTeXdemo@new{code only}{^^A
153 % \LaTeXdemo@common
154 %}{^^A
155 %}
156 %
157 %\providecommand*\eTeX{\ensuremath{\varepsilon}-\TeX}
158 %\providecommand*\file{\texttt}
159 %\providecommand*\opt{\texttt}
160 %\providecommand*\pkg{\textsf}
161 %
162 %\newcommand*\ACS{\textsc{acs}}
163 %
164 %\makeatother
165 %
166 %\title{^^A
167 % \textsf{achemso} --- Support for American Chemical Society journal
168 % style\thanks{^^A
169 % This file describes version \fileversion, last revised
170 % \filedate.^^A
171 % }^^A
172 %}
173 %\author{^^A
174 % Joseph Wright\thanks{E-mail: [email protected]}^^A
175 %}
176 %\date{Released \filedate}
177 %
178 %\maketitle
179 %
180 %\begin{abstract}
181 % The \pkg{achemso} bundle provides a \BibTeX{} style file following the
182 % requirements of the American Chemical Society (ACS), and a package to pass
183 % settings to the \BibTeX{} style. It also includes a class which was used
184 % for submission support in the past.
185 %
186 % All of this material is largely of historical interest and is retained
187 % for stability. For new material, the \pkg{biblatex} style \pkg{chem-acs}
188 % is available for bibliographies, and a short template for the ACS
189 % website is better suited to submission.
190 %\end{abstract}
191 %
192 %\StopEventually{^^A
193 % \PrintChanges
194 % \PrintIndex
195 %}
196 %
197 %\section{Implementation}
198 %
199 % A lot of the work done by the package is also needed by the class.
200 % Loading the package and the class makes load-order awkward. Instead,
201 % the two parts are done in one place. Sandwiching the common code are
202 % two slices of dedicated material for the class and the package. Some
203 % of this is needed ``early'', before the common material, whilst the
204 % rest is ``late''.
205 %
206 %\subsection{Early class-only code}
207 %
208 % So that there is no confusion, the base class is loaded early.
209 % \begin{macrocode}
210 %<*class>
211 \ProvidesClass{achemso}
212 [2025-09-22 v3.14 Submission to ACS journals]
213 \LoadClass[12pt,letter]{article}
214 % \end{macrocode}
215 %
216 %\begin{macro}{\acs@warning}
217 % The code for a warning is created so that it works for the package too.
218 % \begin{macrocode}
219 \newcommand*\acs@warning{\ClassWarning{achemso}}
220 %</class>
221 % \end{macrocode}
222 %\end{macro}
223 %
224 %\subsection{Early package-only code}
225 %
226 % The package and the class should not both be loaded, as the two use
227 % the same internal macro names. On the other hand, if the class is
228 % not in use a reminder is printed to use it if possible.
229 % \begin{macrocode}
230 %<*package>
231 \ProvidesPackage{achemso}
232 [2025-09-22 v3.14 Support for ACS journals]
233 \@ifclassloaded{achemso}{%
234 \PackageInfo{achemso}{%
235 You have already loaded the `achemso' class:\MessageBreak
236 loading the package will abort%
237 }%
238 \endinput
239 }{%
240 \PackageInfo{achemso}{%
241 When writing a submission to an ACS journal, please\MessageBreak
242 use the achemso document class%
243 }%
244 }
245 % \end{macrocode}
246 %
247 %\begin{macro}{\acs@warning}
248 % The code for a warning is created so that it works for the class too.
249 % \begin{macrocode}
250 \newcommand*\acs@warning{\PackageWarning{achemso}}
251 %</package>
252 % \end{macrocode}
253 %\end{macro}
254 %
255 %\subsection{Common code}
256 %
257 %\begin{macro}{\acs@ifundefined}
258 % A non-expandable test for defined macros: does not add to the hash
259 % table.
260 % \begin{macrocode}
261 %<*package|class>
262 \newcommand*\acs@ifundefined[1]{%
263 \begingroup\expandafter\expandafter\expandafter\endgroup
264 \expandafter\ifx\csname #1\endcsname\relax
265 \expandafter\@firstoftwo
266 \else
267 \expandafter\@secondoftwo
268 \fi
269 }
270 % \end{macrocode}
271 %\end{macro}
272 %
273 % The first stage needed is to read the package options given. Although
274 % \pkg{xkeyval} was perhaps not the best choice, changing this now would
275 % be rather risky.
276 % \begin{macrocode}
277 \RequirePackage{xkeyval}
278 % \end{macrocode}
279 %\begin{macro}{\acs@keyval@bool}
280 % A support macro for making Boolean options: the \pkg{xkeyval} version
281 % is only available in newer releases.
282 % \begin{macrocode}
283 \newcommand*\acs@keyval@bool[2]{%
284 \acs@ifundefined{acs@#1#2}{%
285 \acs@warning{Unknown option `#2' for key #1}%
286 }{%
287 \@nameuse{acs@#1#2}%
288 }%
289 }
290 % \end{macrocode}
291 %\end{macro}
292 %\begin{macro}{\ifacs@abbreviations}
293 %\begin{macro}{\ifacs@articletitle}
294 %\begin{macro}{\ifacs@biochem}
295 %\begin{macro}{\ifacs@chaptertitle}
296 %\begin{macro}{\ifacs@doi}
297 %\begin{macro}{\ifacs@email}
298 %\begin{macro}{\ifacs@hyperref}
299 %\begin{macro}{\ifacs@keywords}
300 %\begin{macro}{\ifacs@super}
301 % These are all very trivial definitions: to avoid issues with older
302 % versions of \pkg{xkeyval} each definition is done directly.
303 % \begin{macrocode}
304 \newif\ifacs@abbreviations
305 \newif\ifacs@articletitle
306 \newif\ifacs@biochem
307 \newif\ifacs@doi
308 \newif\ifacs@chaptertitle
309 \newif\ifacs@email
310 \newif\ifacs@hyperref
311 \newif\ifacs@keywords
312 \newif\ifacs@super
313 \define@key{acs}{abbreviations}[true]{%
314 \acs@keyval@bool{abbreviations}{#1}%
315 }
316 \define@key{acs}{articletitle}[true]{%
317 \acs@keyval@bool{articletitle}{#1}%
318 }
319 \define@key{acs}{biochem}[true]{%
320 \acs@keyval@bool{biochem}{#1}%
321 }
322 \define@key{acs}{doi}[true]{%
323 \acs@keyval@bool{doi}{#1}%
324 }
325 \define@key{acs}{chaptertitle}[true]{%
326 \acs@keyval@bool{chaptertitle}{#1}%
327 }
328 \define@key{acs}{email}[true]{%
329 \acs@keyval@bool{email}{#1}%
330 }
331 \define@key{acs}{hyperref}[true]{%
332 \acs@keyval@bool{hyperref}{#1}%
333 }
334 \define@key{acs}{keywords}[true]{%
335 \acs@keyval@bool{keywords}{#1}%
336 }
337 \define@key{acs}{super}[true]{%
338 \acs@keyval@bool{super}{#1}%
339 }
340 \define@key{acs}{usetitle}[true]{%
341 \acs@keyval@bool{articletitle}{#1}%
342 }
343 % \end{macrocode}
344 %\end{macro}
345 %\end{macro}
346 %\end{macro}
347 %\end{macro}
348 %\end{macro}
349 %\end{macro}
350 %\end{macro}
351 %\end{macro}
352 %\end{macro}
353 %\begin{macro}{\acs@journal}
354 %\begin{macro}{\acs@layout}
355 %\begin{macro}{\acs@manuscript}
356 %\begin{macro}{\acs@maxauthors}
357 % Trivial again: done without using \pkg{xkeyval} for the same reasons
358 % as before.
359 % \begin{macrocode}
360 \newcommand*\acs@journal{jacsat}
361 \newcommand*\acs@layout{traditional}
362 \newcommand*\acs@manuscript{article}
363 \newcommand*\acs@maxauthors{15}
364 \define@key{acs}{journal}{%
365 \def\acs@journal{#1}%
366 }
367 \define@key{acs}{layout}{%
368 \def\acs@layout{#1}%
369 }
370 \define@key{acs}{manuscript}{%
371 \def\acs@manuscript{#1}%
372 }
373 \define@key{acs}{maxauthors}{%
374 \def\acs@maxauthors{#1}%
375 }
376 % \end{macrocode}
377 %\end{macro}
378 %\end{macro}
379 %\end{macro}
380 %\end{macro}
381 %\begin{macro}{\ifacs@etal@truncate}
382 %\begin{macro}{\acs@etal@firstonly}
383 %\begin{macro}{\acs@etal@truncate}
384 % The setup for the \opt{etalmode} option is quite simple: just look
385 % for the appropriate macros.
386 % \begin{macrocode}
387 \newif\ifacs@etal@truncate
388 \define@key{acs}{etalmode}{%
389 \acs@ifundefined{acs@etal@#1}{%
390 \acs@warning{%
391 Unknown value `#1' for\MessageBreak etalmode option%
392 }%
393 }{%
394 \@nameuse{acs@etal@#1}%
395 }%
396 }
397 \newcommand*\acs@etal@firstonly{\acs@etal@truncatefalse}
398 \newcommand*\acs@etal@truncate{\acs@etal@truncatetrue}
399 % \end{macrocode}
400 %\end{macro}
401 %\end{macro}
402 %\end{macro}
403 % \begin{macro}{\acs@activate@biblabel}
404 % The \opt{biochemistry} option is an alias for \opt{biochem}. The
405 % \opt{biblabel} option is a choice, which is implemented using a
406 % csname search. The group here prevents hash table pollution, whilst
407 % the \pkg{xkeyval} method is avoided as it is more complex than it is
408 % worth!
409 % \begin{macrocode}
410 \define@key{acs}{biochemistry}{%
411 \setkeys{acs}{biochem = #1}%
412 }
413 \define@key{acs}{biblabel}{%
414 \acs@ifundefined{acs@biblabel@#1}{%
415 \acs@warning{%
416 Unknown value `#1' for\MessageBreak biblabel option%
417 }%
418 }{%
419 \acs@activate@biblabel{\@nameuse{acs@biblabel@#1}}%
420 }%
421 }
422 \newcommand*\acs@activate@biblabel{}
423 %<*class>
424 \let\acs@activate@biblabel\AtEndOfClass
425 \AtEndOfClass{\let\acs@activate@biblabel\@firstofone}
426 %</class>
427 %<*package>
428 \let\acs@activate@biblabel\AtEndOfPackage
429 \AtEndOfPackage{\let\acs@activate@biblabel\@firstofone}
430 %</package>
431 % \end{macrocode}
432 % \end{macro}
433 %\begin{macro}{\acs@biblabel@brackets}
434 %\begin{macro}{\acs@biblabel@fullstop}
435 %\begin{macro}{\acs@biblabel@period}
436 %\begin{macro}{\acs@biblabel@plain}
437 % The macros to implement the idea above for biblabels.
438 % \begin{macrocode}
439 \newcommand*\acs@biblabel@brackets{\def\bibnumfmt##1{(##1)}}
440 \newcommand*\acs@biblabel@fullstop{\def\bibnumfmt##1{##1.}}
441 \newcommand*\acs@biblabel@period{\def\bibnumfmt##1{##1.}}
442 \newcommand*\acs@biblabel@plain{\def\bibnumfmt##1{##1}}
443 % \end{macrocode}
444 %\end{macro}
445 %\end{macro}
446 %\end{macro}
447 %\end{macro}
448 % Set up some defaults.
449 % \begin{macrocode}
450 \setkeys{acs}{
451 email = true,
452 super = true
453 }
454 % \end{macrocode}
455 % Loading some other packages depends on the options chosen, so they
456 % are processed now.
457 % \begin{macrocode}
458 \ProcessOptionsX*<acs>
459 % \end{macrocode}
460 %
461 %\begin{macro}{\acs@manuscript@communication}
462 %\begin{macro}{\acs@manuscript@letter}
463 %\begin{macro}{\acs@manuscript@note}
464 %\begin{macro}{\acs@manuscript@review}
465 %\begin{macro}{\acs@manuscript@suppinfo}
466 % For text comparisons.
467 % \begin{macrocode}
468 \newcommand*\acs@manuscript@communication{communication}
469 \newcommand*\acs@manuscript@letter{letter}
470 \newcommand*\acs@manuscript@note{note}
471 \newcommand*\acs@manuscript@review{review}
472 \newcommand*\acs@manuscript@suppinfo{suppinfo}
473 % \end{macrocode}
474 %\end{macro}
475 %\end{macro}
476 %\end{macro}
477 %\end{macro}
478 %\end{macro}
479 %
480 %\begin{macro}{\acs@niib@create}
481 %\begin{macro}{bibnote}
482 %\begin{macro}{\thebibnote}
483 %\begin{macro}{\bibnote}
484 %\begin{macro}{\bibnotemark}
485 %\begin{macro}{\bibnotetext}
486 %\begin{macro}{\printbibnotes}
487 % To avoid needing to load the \pkg{notes2bib} package, especially as
488 % the plan is to move that package to \LaTeX3 internal syntax,
489 % \pkg{achemso} provides a minimal version here. The first step is to
490 % create macros which will need a guard against \pkg{notes2bib} already
491 % having been loaded. To allow the package and class to behave
492 % differently these are actually applied later.
493 % \begin{macrocode}
494 \newcommand*\acs@niib@create{%
495 \@namedef{[email protected]}{%
496 2009/04/20 v1.6a Integrating notes into the bibliography (achemso
497 version)
498 }%
499 \@ifundefined{c@bibnote}{\newcounter{bibnote}}{}
500 \def\thebibnote{%
501 Note-\the\value{bibnote}%
502 }%
503 \DeclareRobustCommand*{\bibnote}[1][\thebibnote]{%
504 \stepcounter{bibnote}%
505 \def\acs@niib@after@text{\cite{##1}}%
506 \acs@niib@text{##1}%
507 }%
508 \DeclareRobustCommand*{\bibnotemark}[1][\thebibnote]{%
509 \stepcounter{bibnote}%
510 \cite{##1}%
511 }%
512 \DeclareRobustCommand*{\bibnotetext}[1][\thebibnote]{%
513 \let\acs@niib@after@text\relax
514 \acs@niib@text{##1}%
515 }%
516 \newcommand*\printbibnotes{%
517 \ifnum\the\value{bibnote}>\z@\relax
518 \nocite{achemso-control}%
519 \acs@bibliography{acs-\jobname}%
520 \fi
521 }%
522 }
523 % \end{macrocode}
524 %\end{macro}
525 %\end{macro}
526 %\end{macro}
527 %\end{macro}
528 %\end{macro}
529 %\end{macro}
530 %\end{macro}
531 %\begin{macro}{\acs@niib@after@text}
532 % After the text.
533 % \begin{macrocode}
534 \newcommand*\acs@niib@after@text{}
535 % \end{macrocode}
536 %\end{macro}
537 %\begin{macro}{\acs@niib@text}
538 % The \cs{acs@niib@text} macro is the outer part of the writing system.
539 % It does not absorb the text of note, as without \eTeX\ this is bad
540 % news. The same file is used for notes and the control entry for
541 % the bibliography style.
542 % \begin{macrocode}
543 \newcommand*\acs@niib@text{%
544 \@bsphack
545 \if@filesw
546 \expandafter\acs@niib@write
547 \else
548 \expandafter\acs@niib@no@write
549 \fi
550 }
551 % \end{macrocode}
552 %\end{macro}
553 %\begin{macro}{\acs@niib@write}
554 %\begin{macro}{\acs@niib@write@aux@i}
555 %\begin{macro}{\acs@niib@write@aux@ii}
556 % Writing verbatim without \eTeX.
557 % \begin{macrocode}
558 \newcommand*\acs@niib@write[1]{%
559 \begingroup
560 \let\do\@makeother
561 \dospecials
562 \catcode`\{ 1\relax
563 \catcode`\} 2\relax
564 \acs@niib@write@aux@i{#1}%
565 }
566 \newcommand*\acs@niib@write@aux@i[1]{%
567 \long\def\@tempa##1{%
568 \def\@tempa{##1}%
569 \@onelevel@sanitize\@tempa
570 \expandafter\endgroup
571 \expandafter\def\expandafter\@tempa\expandafter{\@tempa}%
572 \acs@niib@write@aux@ii{#1}%
573 }%
574 \catcode`\^^M 10\relax
575 \@tempa
576 }
577 \newcommand*\acs@niib@write@aux@ii[1]{%
578 \immediate\write\acs@bib@file{%
579 @Misc\string{#1,^^J%
580 \space\space note = \string{\@tempa\string},^^J%
581 \string}^^J%
582 }%
583 \@esphack
584 \acs@niib@after@text
585 }
586 % \end{macrocode}
587 %\end{macro}
588 %\end{macro}
589 %\end{macro}
590 %\begin{macro}{\acs@niib@no@write}
591 % If no files are to be written, a bit of tidying up.
592 % \begin{macrocode}
593 \newcommand\acs@niib@no@write[2]{%
594 \@esphack
595 \acs@niib@after@text
596 }
597 % \end{macrocode}
598 %\end{macro}
599 %
600 %\begin{macro}{\nmv@natbib@detect}
601 %\begin{macro}{\acs@nmv@activate}
602 %\begin{macro}{\acs@autonote}
603 % The functionality of \pkg{notes2bib} is combined with the standard
604 % \cs{cite} macro, to give automatic note-like data in the bibliography.
605 % \begin{macrocode}
606 \AtBeginDocument{
607 \def\nmv@natbib@detect{%
608 \ifNAT@super
609 \expandafter\acs@nmv@activate
610 \else
611 \expandafter\acs@autonote
612 \fi
613 }
614 }
615 \newcommand*\acs@nmv@activate{%
616 \let\nmv@citex@nat\@citex
617 \let\@citex\nmv@citex
618 \let\nmv@cite\cite
619 \renewcommand*{\cite}[2][]{%
620 \nmv@ifmtarg{##1}{%
621 \nmv@citetrue
622 \nmv@cite{##2}%
623 }{%
624 \nocite{##2}%
625 \bibnote{Ref.~\citenum{##2}, ##1}%
626 }%
627 }%
628 }
629 \newcommand*\acs@autonote{%
630 \let\nmv@cite\cite
631 \renewcommand*{\cite}[2][]{%
632 \nmv@ifmtarg{##1}{%
633 \nmv@cite{##2}%
634 }{%
635 \nocite{##2}%
636 \bibnote{Ref.~\citenum{##2}, ##1}%
637 }%
638 }%
639 }
640 % \end{macrocode}
641 %\end{macro}
642 %\end{macro}
643 %\end{macro}
644 %
645 %\begin{macro}{\acs@bib@file}
646 %\begin{macro}{\acs@bib@message}
647 %\begin{macro}{\acs@bib@name}
648 % Some information or creating the control file for \BibTeX\ is set up.
649 % \begin{macrocode}
650 \newwrite\acs@bib@file
651 \newcommand*\acs@bib@message{%
652 This is an auxiliary file used by the `achemso' bundle.^^J%
653 This file may safely be deleted. It will be recreated as required.^^J
654 }
655 \newcommand*\acs@bib@name{acs-\jobname.bib}
656 % \end{macrocode}
657 %\end{macro}
658 %\end{macro}
659 %\end{macro}
660 %\begin{macro}{\acs@bib@write}
661 %\begin{macro}{\acs@bib@write@aux}
662 % The control information for \BibTeX\ needs to be written to a special
663 % file. The main writing macro is quite simple. Actually writing the
664 % information is left to the code for \cs{bibliography}, so that this
665 % only happens if needed.
666 % \begin{macrocode}
667 \newcommand*\acs@bib@write{%
668 \if@filesw
669 \expandafter\acs@bib@write@aux
670 \fi
671 }
672 \AtBeginDocument{\acs@bib@write}
673 \newcommand*\acs@bib@write@aux{%
674 \immediate\openout\acs@bib@file\acs@bib@name\relax
675 \immediate\write\acs@bib@file{\acs@bib@message}%
676 \edef\@tempa##1##2{%
677 \space\space##1\space = "##2",^^J%
678 }%
679 \immediate\write\acs@bib@file{%
680 @Control\string{%
681 achemso-control,^^J%
682 \@tempa{ctrl-article-title\space}{%
683 \ifacs@articletitle yes\else no\fi
684 }%
685 \@tempa{ctrl-chapter-title\space}{%
686 \ifacs@chaptertitle yes\else no\fi
687 }%
688 \@tempa{ctrl-doi\space\space\space\space\space\space\space
689 \space\space\space\space}{%
690 \ifacs@doi yes\else no\fi
691 }%
692 \@tempa{ctrl-etal-number\space\space\space}{\acs@maxauthors}%
693 \@tempa{ctrl-etal-firstonly}{%
694 \ifacs@etal@truncate no\else yes\fi
695 }%
696 \string}^^J%
697 }%
698 \immediate\write\@auxout{%
699 \string\citation\string{achemso-control\string}%
700 }%
701 \AtEndDocument{%
702 \immediate\closeout\acs@bib@file\relax
703 }%
704 }
705 % \end{macrocode}
706 %\end{macro}
707 %\end{macro}
708 %
709 %\begin{macro}{\acs@bibliography}
710 %\begin{macro}{\bibliography}
711 % The \cs{bibliography} macro is now patched so that everything works
712 % correctly.
713 % \begin{macrocode}
714 \AtBeginDocument{%
715 \let\acs@bibliography\bibliography
716 \def\bibliography#1{%
717 \acs@bibliography{acs-\jobname,#1}%
718 }%
719 }
720 % \end{macrocode}
721 %\end{macro}
722 %\end{macro}
723 %
724 % \begin{macro}{\latin}
725 % The journal \emph{ACS Nano} formats Latin phrases differently from
726 % every other ACS journal: we provide a \cs{latin} command to cover this.
727 % \begin{macrocode}
728 \AtBeginDocument{
729 \providecommand{\latin}[1]{#1}
730 }
731 %</package|class>
732 % \end{macrocode}
733 % \end{macro}
734 %
735 %\subsection{Late class-only code}
736 %
737 % Most of the power of the class is now created. First, a few options
738 % are reset so that any given by the user are effectively ignored.
739 % \begin{macrocode}
740 %<*class>
741 \setkeys{acs}{
742 abbreviations = false,
743 articletitle = true,
744 biblabel = brackets,
745 biochem = false,
746 doi = false,
747 etalmode = firstonly,
748 keywords = false,
749 maxauthors = 15,
750 super = true
751 }
752 % \end{macrocode}
753 % When using the class, \pkg{notes2bib} is always emulated. Other
754 % standard support packages can now be loaded.
755 % \begin{macrocode}
756 \acs@niib@create
757 \RequirePackage[margin=2.54cm]{geometry}
758 \RequirePackage{
759 caption,
760 float,
761 graphicx,
762 setspace,
763 url
764 }
765 \ifacs@hyperref
766 \expandafter\RequirePackage
767 \else
768 \expandafter\@gobble
769 \fi
770 {hyperref}
771 \AtBeginDocument{\doublespacing}
772 % \end{macrocode}
773 %
774 %\begin{macro}{\title}
775 %\begin{macro}{\@title}
776 %\begin{macro}{\acs@title@short}
777 % For the meta-data, the REV\TeX\ bundle provides a good model for
778 % the commands to give the author. \cs{gdef} is used here to
779 % avoid any odd grouping issues.
780 % \begin{macrocode}
781 \renewcommand*{\title}[2][]{%
782 \gdef\acs@title@short{#1}%
783 \gdef\@title{#2}%
784 \ifx\acs@title@short\@empty
785 \global\let\acs@title@short\@title
786 \fi
787 }
788 \@onlypreamble\title
789 % \end{macrocode}
790 %\end{macro}
791 %\end{macro}
792 %\end{macro}
793 %\begin{macro}{\acs@author@cnt}
794 %\begin{macro}{\acs@affil@cnt}
795 %\begin{macro}{\acs@affil@alt@cnt}
796 % \pkg{achemso} tracks the number authors, affiliations and alternative
797 % affiliations.
798 % \begin{macrocode}
799 \newcount\acs@author@cnt
800 \newcount\acs@affil@cnt
801 \newcount\acs@affil@alt@cnt
802 % \end{macrocode}
803 %\end{macro}
804 %\end{macro}
805 %\end{macro}
806 %\begin{macro}{\acs@footnote@cnt}
807 %\begin{macro}{\acs@affil@marker@cnt}
808 % Two counts for getting affiliation footnotes correct.
809 % \begin{macrocode}
810 \newcount\acs@footnote@cnt
811 \newcount\acs@affil@marker@cnt
812 % \end{macrocode}
813 %\end{macro}
814 %\end{macro}
815 %\begin{macro}{\author}
816 % The author macro stores the current author details and sets the
817 % affiliation of the author to the current one. Everything is
818 % \cs{global} so that there is no possibility of begin trapped inside a
819 % group. The affiliation counter is always one behind, and so it is
820 % locally incremented to keep the logic of the code clear elsewhere.
821 % \begin{macrocode}
822 \def\author#1{%
823 \global\advance\acs@author@cnt\@ne\relax
824 \expandafter\gdef\csname @author@\@roman\acs@author@cnt\endcsname{#1}%
825 \begingroup
826 \advance\acs@affil@cnt\@ne
827 \expandafter\xdef\csname @author@affil@\@roman
828 \acs@author@cnt\endcsname
829 {\the\acs@affil@cnt}%
830 \endgroup
831 }
832 \@onlypreamble\author
833 % \end{macrocode}
834 %\end{macro}
835 %\begin{macro}{\and}
836 %\begin{macro}{\thanks}
837 % Neither \cs{and} nor \cs{thanks} are used by the document class.
838 % \begin{macrocode}
839 \def\and{%
840 \acs@warning{%
841 \string\and\space not used by the achemso class: please see
842 the\MessageBreak package documentation for details%
843 }%
844 }
845 \def\thanks{%
846 \acs@warning{%
847 \string\thanks\space not used by the achemso class: please see
848 the\MessageBreak the package documentation for details%
849 }%
850 }
851 % \end{macrocode}
852 %\end{macro}
853 %\end{macro}
854 %\begin{macro}{\affiliation}
855 % As with \cs{author}, everything is \cs{global} just in case. The
856 % system insists that affiliations come after authors. Before anything
857 % is committed, a check is made that the affiliation has not already
858 % been seen.
859 % \begin{macrocode}
860 \newcommand*\affiliation[2][\relax]{%
861 \ifnum\acs@author@cnt>\z@\relax
862 \acs@affil@ifdup{#2}{%
863 \acs@affil@swap{#2}%
864 }{%
865 \global\advance\acs@affil@cnt\@ne\relax
866 \expandafter\gdef\csname @address@\@roman\acs@affil@cnt\endcsname
867 {#2}%
868 \ifx\relax#1\relax
869 \expandafter\gdef\csname @affil@\@roman\acs@affil@cnt\endcsname
870 {#2}%
871 \else
872 \expandafter\gdef\csname @affil@\@roman\acs@affil@cnt\endcsname
873 {#1}%
874 \fi
875 }%
876 \else
877 \acs@warning{Affiliation with no author}%
878 \fi
879 }
880 \@onlypreamble\affiliation
881 % \end{macrocode}
882 %\end{macro}
883 %\begin{macro}{\acs@affil@ifdup}
884 %\begin{macro}{\acs@affil@ifdup@aux}
885 % A short test for two addresses being identical.
886 % \begin{macrocode}
887 \newcommand*\acs@affil@ifdup[1]{%
888 \begingroup
889 \def\@tempa{#1}%
890 \@tempswafalse
891 \@tempcnta\z@\relax
892 \acs@affil@ifdup@aux
893 \if@tempswa
894 \aftergroup\@firstoftwo
895 \else
896 \aftergroup\@secondoftwo
897 \fi
898 \endgroup
899 }
900 \newcommand*\acs@affil@ifdup@aux{%
901 \advance\@tempcnta\@ne\relax
902 \expandafter\expandafter\expandafter\def\expandafter\expandafter
903 \expandafter\@tempb\expandafter\expandafter\expandafter
904 {\csname @address@\@roman\@tempcnta\endcsname}%
905 \ifx\@tempa\@tempb
906 \expandafter\@tempswatrue
907 \else
908 \ifnum\@tempcnta<\acs@affil@cnt\relax
909 \expandafter\expandafter\expandafter\acs@affil@ifdup@aux
910 \fi
911 \fi
912 }
913 % \end{macrocode}
914 %\end{macro}
915 %\end{macro}
916 %\begin{macro}{\acs@affil@swap}
917 %\begin{macro}{\acs@affil@swap@aux}
918 % If the affiliation has already been given, then all of the authors
919 % need to be checked to make sure that the correct affiliation is used.
920 % First, the loop from above is used to find the correct number for the
921 % duplicate.
922 % \begin{macrocode}
923 \newcommand*\acs@affil@swap[1]{%
924 \begingroup
925 \def\@tempa{#1}%
926 \@tempcnta\z@\relax
927 \@tempcntb\z@\relax
928 \acs@affil@ifdup@aux
929 \advance\acs@affil@cnt\@ne\relax
930 \acs@affil@swap@aux
931 \endgroup
932 }
933 \newcommand*\acs@affil@swap@aux{%
934 \advance\@tempcntb\@ne\relax
935 \expandafter\ifnum\csname @author@affil@\@roman\@tempcntb\endcsname
936 = \acs@affil@cnt\relax
937 \expandafter\xdef\csname @author@affil@\@roman\@tempcntb\endcsname{%
938 \the\@tempcnta
939 }%
940 \fi
941 \ifnum\@tempcntb<\acs@author@cnt\relax
942 \expandafter\acs@affil@swap@aux
943 \fi
944 }
945 % \end{macrocode}
946 %\end{macro}
947 %\end{macro}
948 %\begin{macro}{\alsoaffiliation}
949 %\begin{macro}{\acs@alsoaffil@find}
950 % To allow complex affiliations , two commands are needed. The first
951 % deals with affiliations that are in some way shared by several
952 % authors. This is tracked on a per author basis.
953 % \begin{macrocode}
954 \newcommand*\alsoaffiliation[2][\relax]{%
955 \ifnum\acs@author@cnt>\z@\relax
956 \acs@affil@ifdup{#2}{%
957 \acs@alsoaffil@find{#2}%
958 }{%
959 \global\advance\acs@affil@cnt\@ne\relax
960 \@tempcnta\acs@affil@cnt\relax
961 \expandafter\gdef\csname @address@\@roman\acs@affil@cnt\endcsname
962 {#2}%
963 \ifx\relax#1\relax
964 \expandafter\gdef\csname @affil@\@roman\acs@affil@cnt\endcsname
965 {#2}%
966 \else
967 \expandafter\gdef\csname @affil@\@roman\acs@affil@cnt\endcsname
968 {#1}%
969 \fi
970 }%
971 \@ifundefined{@author@alsoaffil@\@roman\acs@author@cnt}{%
972 \expandafter\xdef\csname @author@alsoaffil@\@roman\acs@author@cnt
973 \endcsname{\the\@tempcnta}%
974 }{%
975 \expandafter\xdef\csname @author@alsoaffil@\@roman\acs@author@cnt
976 \endcsname{%
977 \csname @author@alsoaffil@\@roman\acs@author@cnt\endcsname
978 ,\the\@tempcnta
979 }%
980 }%
981 \else
982 \acs@warning{Affiliation with no author}%
983 \fi
984 }
985 \newcommand*\acs@alsoaffil@find[1]{%
986 \begingroup
987 \def\@tempa{#1}%
988 \@tempcnta\z@\relax
989 \@tempcntb\z@\relax
990 \acs@affil@ifdup@aux
991 \expandafter\endgroup
992 \expandafter\@tempcnta\the\@tempcnta\relax
993 }
994 % \end{macrocode}
995 %\end{macro}
996 %\end{macro}
997 %\begin{macro}{\altaffiliation}
998 % For the alternative affiliation, a second count is kept, and the
999 % affiliation is ``attached'' to the author. The way these are stored
1000 % means that the appropriate affiliation number can be recovered later,
1001 % and so printed correctly when things get complex.
1002 % \begin{macrocode}
1003 \newcommand*\altaffiliation[1]{%
1004 \ifnum\acs@author@cnt>\z@\relax
1005 \begingroup
1006 \acs@altaffil@ifdup{#1}{%
1007 \expandafter\xdef\csname @author@altaffil@\@roman\acs@author@cnt
1008 \endcsname{\the\@tempcnta}%
1009 }{%
1010 \global\advance\acs@affil@alt@cnt\@ne\relax
1011 \expandafter\gdef\csname @altaffil@\@roman\acs@affil@alt@cnt
1012 \endcsname{#1}%
1013 \expandafter\xdef\csname @author@altaffil@\@roman\acs@author@cnt
1014 \endcsname{\the\acs@affil@alt@cnt}%
1015 }%
1016 \endgroup
1017 \else
1018 \acs@warning{Affiliation with no author}%
1019 \fi
1020 }
1021 \@onlypreamble\altaffiliation
1022 % \end{macrocode}
1023 %\end{macro}
1024 %\begin{macro}{\acs@altaffil@ifdup}
1025 %\begin{macro}{\acs@altaffil@ifdup@aux}
1026 % This is very similar to the same routine for normal affiliations but
1027 % with the appropriate name changes.
1028 % \begin{macrocode}
1029 \newcommand*\acs@altaffil@ifdup[1]{%
1030 \def\@tempa{#1}%
1031 \@tempswafalse
1032 \@tempcnta\z@\relax
1033 \ifnum\acs@affil@alt@cnt>\z@\relax
1034 \expandafter\acs@altaffil@ifdup@aux
1035 \fi
1036 \if@tempswa
1037 \expandafter\@firstoftwo
1038 \else
1039 \expandafter\@secondoftwo
1040 \fi
1041 }
1042 \newcommand*\acs@altaffil@ifdup@aux{%
1043 \advance\@tempcnta\@ne\relax
1044 \expandafter\expandafter\expandafter\def\expandafter\expandafter
1045 \expandafter\@tempb\expandafter\expandafter\expandafter
1046 {\csname @altaffil@\@roman\@tempcnta\endcsname}%
1047 \ifx\@tempa\@tempb
1048 \expandafter\@tempswatrue
1049 \else
1050 \ifnum\@tempcnta<\acs@affil@alt@cnt\relax
1051 \expandafter\expandafter\expandafter\acs@altaffil@ifdup@aux
1052 \fi
1053 \fi
1054 }
1055 % \end{macrocode}
1056 %\end{macro}
1057 %\end{macro}
1058 %\begin{macro}{\email}
1059 % E-mail addresses are attached to authors as well.
1060 % \begin{macrocode}
1061 \newcommand*\email[1]{%
1062 \ifnum\acs@author@cnt>\z@\relax
1063 \expandafter\gdef\csname @email@\@roman\acs@author@cnt\endcsname
1064 {#1}%
1065 \else
1066 \acs@warning{E-mail with no author}%
1067 \fi
1068 }
1069 \@onlypreamble\email
1070 % \end{macrocode}
1071 %\end{macro}
1072 %\begin{macro}{\fax}
1073 %\begin{macro}{\phone}
1074 % Fax and phone numbers are similar.
1075 % \begin{macrocode}
1076 \newcommand*\fax[1]{%
1077 \ifnum\acs@author@cnt>\z@\relax
1078 \expandafter\gdef\csname @fax@\@roman\acs@author@cnt\endcsname
1079 {#1}%
1080 \else
1081 \acs@warning{Fax number with no author}%
1082 \fi
1083 }
1084 \@onlypreamble\fax
1085 \newcommand*\phone[1]{%
1086 \ifnum\acs@author@cnt>\z@\relax
1087 \expandafter\gdef\csname @phone@\@roman\acs@author@cnt\endcsname
1088 {#1}%
1089 \else
1090 \acs@warning{Phone number with no author}%
1091 \fi
1092 }
1093 \@onlypreamble\phone
1094 % \end{macrocode}
1095 %\end{macro}
1096 %\end{macro}
1097 %
1098 %\begin{macro}{\abbreviations}
1099 %\begin{macro}{\@abbreviations}
1100 %\begin{macro}{\keywords}
1101 %\begin{macro}{\@keywords}
1102 % Some journals use these.
1103 % \begin{macrocode}
1104 \newcommand*\abbreviations[1]{%
1105 \gdef\@abbreviations{#1}%
1106 }
1107 \newcommand*\@abbreviations{}
1108 \@onlypreamble\abbreviations
1109 \newcommand*\keywords[1]{%
1110 \gdef\@keywords{#1}%
1111 }
1112 \newcommand*\@keywords{}
1113 \@onlypreamble\keywords
1114 % \end{macrocode}
1115 %\end{macro}
1116 %\end{macro}
1117 %\end{macro}
1118 %\end{macro}
1119 %
1120 %\begin{macro}{\acs@abbreviations@print}
1121 %\begin{macro}{\acs@keywords@print}
1122 %\begin{macro}{\acs@title@short@print}
1123 % For printing the key simple meta-data.
1124 % \begin{macrocode}
1125 \newcommand*\acs@abbreviations@print{%
1126 \ifx\@abbreviations\@empty\else
1127 \section*{Abbreviations}
1128 \@abbreviations
1129 \par
1130 \fi
1131 }
1132 \newcommand*\acs@keywords@print{%
1133 \ifx\@keywords\@empty\else
1134 \section*{Keywords}
1135 \@keywords
1136 \par
1137 \fi
1138 }
1139 \newcommand*\acs@title@short@print{%
1140 \section*{Running header}
1141 \acs@title@short
1142 \par
1143 }
1144 % \end{macrocode}
1145 %\end{macro}
1146 %\end{macro}
1147 %\end{macro}
1148 %
1149 %\begin{macro}{\acs@space@pre@title}
1150 %\begin{macro}{\acs@space@post@title}
1151 %\begin{macro}{\acs@space@post@author}
1152 %\begin{macro}{\acs@space@post@address}
1153 %\begin{macro}{\acs@space@post@email}
1154 %\begin{macro}{\acs@maketitle@width}
1155 % Lengths for \cs{@maketitle}.
1156 % \begin{macrocode}
1157 \newlength\acs@space@pre@title
1158 \setlength\acs@space@pre@title{2em}
1159 \newlength\acs@space@post@title
1160 \setlength\acs@space@post@title{1.5em}
1161 \newlength\acs@space@post@author
1162 \setlength\acs@space@post@author{1em}
1163 \newlength\acs@space@post@address
1164 \setlength\acs@space@post@address{1em}
1165 \newlength\acs@space@post@email
1166 \setlength\acs@space@post@email{1.5em}
1167 \newlength\acs@maketitle@width
1168 \setlength\acs@maketitle@width{\textwidth}
1169 % \end{macrocode}
1170 %\end{macro}
1171 %\end{macro}
1172 %\end{macro}
1173 %\end{macro}
1174 %\end{macro}
1175 %\end{macro}
1176 %\begin{macro}{\affilsize}
1177 %\begin{macro}{\authorsize}
1178 %\begin{macro}{\emailsize}
1179 %\begin{macro}{\titlesize}
1180 % Some simple size commands.
1181 % \begin{macrocode}
1182 \newcommand*\affilsize{\normalsize}
1183 \newcommand*\authorsize{\large}
1184 \newcommand*\emailsize{\normalsize}
1185 \newcommand*\titlesize{\LARGE}
1186 % \end{macrocode}
1187 %\end{macro}
1188 %\end{macro}
1189 %\end{macro}
1190 %\end{macro}
1191 %\begin{macro}{\authorfont}
1192 %\begin{macro}{\authorfont}
1193 %\begin{macro}{\emailfont}
1194 %\begin{macro}{\titlefont}
1195 % Font settings for \cs{@maketitle}.
1196 % \begin{macrocode}
1197 \newcommand*\affilfont{\itshape}
1198 \newcommand*\authorfont{\sffamily}
1199 \newcommand*\emailfont{}
1200 \newcommand*\titlefont{\bfseries\sffamily}
1201 % \end{macrocode}
1202 %\end{macro}
1203 %\end{macro}
1204 %\end{macro}
1205 %\end{macro}
1206 %\begin{macro}{\ps@acs}
1207 % A shortcut to make page styles.
1208 % \begin{macrocode}
1209 \newcommand*{\ps@acs}{}
1210 \let\ps@acs\ps@plain
1211 % \end{macrocode}
1212 %\end{macro}
1213 %\begin{macro}{\@maketitle}
1214 %\begin{macro}{\@maketitle@title@hook}
1215 % With the changes outlined above in place, a new \cs{@maketitle}
1216 % macro is needed. This is partially a copy of the existing, but
1217 % rather heavily modified.
1218 % \begin{macrocode}
1219 \def\@maketitle{%
1220 \pagestyle{acs}%
1221 \ifnum\acs@author@cnt<\z@\relax
1222 \acs@warning{No authors defined: At least one author is required}%
1223 \fi
1224 \newpage
1225 \null
1226 \vspace*{\acs@space@pre@title}%
1227 \begin{center}
1228 \begin{minipage}{\acs@maketitle@width}
1229 \begin{center}
1230 {%
1231 \titlefont
1232 \titlesize
1233 \let\@fnsymbol\acs@author@fnsymbol
1234 \let\footnote\acs@title@footnote
1235 \acs@maketitle@suppinfo \@title
1236 \acs@title@footnote@check
1237 \global\acs@footnote@cnt\c@footnote
1238 \@maketitle@title@hook
1239 \par
1240 }%
1241 \vspace*{\acs@space@post@title}%
1242 {%
1243 \authorsize
1244 \authorfont
1245 \frenchspacing
1246 \acs@author@list
1247 \par
1248 }%
1249 \vspace*{\acs@space@post@author}%
1250 {%
1251 \affilsize
1252 \affilfont
1253 \acs@address@list
1254 \par
1255 }%
1256 \vspace*{\acs@space@post@address}%
1257 {%
1258 \emailsize
1259 \emailfont
1260 \ifacs@email
1261 \expandafter\acs@contact@details
1262 \fi
1263 }%
1264 \vspace*{\acs@space@post@email}%
1265 \end{center}
1266 \end{minipage}
1267 \end{center}%
1268 }
1269 \newcommand*\@maketitle@title@hook{}
1270 % \end{macrocode}
1271 %\end{macro}
1272 %\end{macro}
1273 %\begin{macro}{\acs@maketitle@suppinfo}
1274 % This is spun out so that it can be avoided if necessary: this is done
1275 % on the sly.
1276 % \begin{macrocode}
1277 \newcommand*\acs@maketitle@suppinfo{%
1278 \ifx\acs@manuscript\acs@manuscript@suppinfo
1279 Supporting Information:\\
1280 \fi
1281 }
1282 % \end{macrocode}
1283 %\end{macro}
1284 %\begin{macro}{\acs@title@footnote}
1285 %\begin{macro}{\acs@title@footnote@check}
1286 % Footnotes need to be created so that they appear correctly.
1287 % \begin{macrocode}
1288 \newcommand*\acs@title@footnote[1]{%
1289 \footnotemark
1290 \g@addto@macro\@thanks{\footnotetext{#1}}%
1291 }
1292 \newcommand\acs@title@footnote@check{%
1293 \ifx\@thanks\@empty
1294 \else
1295 \begingroup
1296 \toks@=\expandafter{\@thanks}%
1297 \xdef\@thanks{%
1298 \begingroup
1299 \let\noexpand\@fnsymbol\noexpand\acs@author@fnsymbol
1300 \the\toks@
1301 \endgroup
1302 }%
1303 \endgroup
1304 \fi
1305 }
1306 % \end{macrocode}
1307 %\end{macro}
1308 %\end{macro}
1309 %\begin{macro}{\acs@contact@details}
1310 % A general contact details macro.
1311 % \begin{macrocode}
1312 \newcommand*\acs@contact@details{%
1313 { \sffamily E-mail: \acs@email@list }%
1314 \acs@number@list
1315 }
1316 % \end{macrocode}
1317 %\end{macro}
1318 %\begin{macro}{\@thanks}
1319 % The \cs{@thanks} macro is used as a hook to generate the footnotes if
1320 % needed.
1321 % \begin{macrocode}
1322 \let\@thanks\@empty
1323 % \end{macrocode}
1324 %\end{macro}
1325 %\begin{macro}{\acs@author@list}
1326 % Printing the author list needs to do several things. The appropriate
1327 % separators between authors are created and the author names
1328 % themselves are printed.
1329 % \begin{macrocode}
1330 \newcommand*\acs@author@list{%
1331 \@tempcnta\z@\relax
1332 \ifnum\acs@author@cnt=\z@\relax\else
1333 \expandafter\acs@author@list@main
1334 \fi
1335 }
1336 % \end{macrocode}
1337 %\end{macro}
1338 %\begin{macro}{\acs@author@footnotes}
1339 %\begin{macro}{\acs@author@list@main}
1340 % The main control macro for producing the author list iterates over
1341 % each author on the list. The result is stored as
1342 % \cs{acs@author@listing}.
1343 % \begin{macrocode}
1344 \newcommand*\acs@author@footnotes{}
1345 \newcommand*\acs@author@list@main{%
1346 \advance\@tempcnta\@ne\relax
1347 \def\acs@author@footnotes{}%
1348 \acs@author@list@and
1349 \space
1350 \@nameuse{@author@\@roman\@tempcnta}%
1351 \acs@author@list@comma
1352 \acs@author@star
1353 \acs@author@affil
1354 \acs@author@affil@also
1355 \acs@author@affil@alt
1356 \ifx\@empty\acs@author@footnotes\else
1357 \textsuperscript{\acs@author@footnotes}%
1358 \fi
1359 \ifnum\@tempcnta<\acs@author@cnt\relax
1360 \expandafter\acs@author@list@main
1361 \fi
1362 }
1363 % \end{macrocode}
1364 %\end{macro}
1365 %\end{macro}
1366 %\begin{macro}{\acs@author@list@and}
1367 %\begin{macro}{\acs@author@list@comma}
1368 % Simple checks to add an ``and'' and a comma.
1369 % \begin{macrocode}
1370 \newcommand*\acs@author@list@and{%
1371 \ifnum\acs@author@cnt=\@ne\relax\else
1372 \ifnum\@tempcnta=\acs@author@cnt\relax
1373 \space and%
1374 \fi
1375 \fi
1376 }
1377 \newcommand*\acs@author@list@comma{%
1378 \ifnum\acs@author@cnt>\tw@\relax
1379 \ifnum\@tempcnta<\acs@author@cnt\relax
1380 ,%
1381 \fi
1382 \fi
1383 }
1384 % \end{macrocode}
1385 %\end{macro}
1386 %\end{macro}
1387 %\begin{macro}{\acs@author@star}
1388 %\begin{macro}{\acs@author@star@aux}
1389 % A check for an e-mail for an author: if so, add a star.
1390 % \begin{macrocode}
1391 \newcommand*\acs@author@star{%
1392 \acs@ifundefined{@email@\@roman\@tempcnta}{}{%
1393 \acs@author@star@aux
1394 }%
1395 }
1396 \newcommand*\acs@author@star@aux{%
1397 \protected@edef\acs@author@footnotes{%
1398 \acs@author@fnsymbol{\z@}%
1399 \ifnum\acs@affil@cnt>\@ne\relax
1400 ,%
1401 \else
1402 \ifnum\acs@affil@alt@cnt>\z@\relax
1403 ,%
1404 \fi
1405 \fi
1406 }%
1407 }
1408 % \end{macrocode}
1409 %\end{macro}
1410 %\end{macro}
1411 %\begin{macro}{\acs@author@affil}
1412 %\begin{macro}{\acs@author@affil@aux}
1413 % The main affiliation of the author is checked for, and assuming one
1414 % is found the appropriate symbol is added to the list.
1415 % \begin{macrocode}
1416 \newcommand*\acs@author@affil{%
1417 \acs@ifundefined{%
1418 @affil@\@roman\csname @author@affil@\@roman\@tempcnta\endcsname
1419 }{%
1420 \acs@warning{%
1421 No affiliation given for author\MessageBreak
1422 \@nameuse{@author@\@roman\@tempcnta}%
1423 }%
1424 }{%
1425 \acs@author@affil@aux
1426 }%
1427 }
1428 \newcommand*\acs@author@affil@aux{%
1429 \ifnum\acs@affil@cnt>\@ne\relax
1430 \expandafter\acs@affil@marker@cnt\csname @author@affil@\@roman
1431 \@tempcnta\endcsname\relax
1432 \advance\acs@affil@marker@cnt\acs@footnote@cnt\relax
1433 \protected@edef\acs@author@footnotes{%
1434 \acs@author@footnotes
1435 \acs@author@fnsymbol{\acs@affil@marker@cnt}%
1436 }%
1437 \else
1438 \ifnum\acs@affil@alt@cnt>\z@\relax
1439 \acs@affil@marker@cnt\@ne\relax
1440 \advance\acs@affil@marker@cnt\acs@footnote@cnt\relax
1441 \protected@edef\acs@author@footnotes{%
1442 \acs@author@footnotes
1443 \acs@author@fnsymbol{\acs@affil@marker@cnt}%
1444 }%
1445 \fi
1446 \fi
1447 }
1448 % \end{macrocode}
1449 %\end{macro}
1450 %\end{macro}
1451 %\begin{macro}{\acs@author@affil@also}
1452 %\begin{macro}{\acs@author@affil@also@aux}
1453 % The ``also'' affiliations are generated by a loop as there may be more
1454 % than one.
1455 % \begin{macrocode}
1456 \newcommand*\acs@author@affil@also{%
1457 \acs@ifundefined{@author@alsoaffil@\@roman\@tempcnta}{}{%
1458 \acs@author@affil@also@aux
1459 }%
1460 }
1461 \newcommand*\acs@author@affil@also@aux{%
1462 \expandafter\@for\expandafter\@tempa\expandafter:\expandafter
1463 =\csname @author@alsoaffil@\@roman\@tempcnta\endcsname\do{%
1464 \acs@affil@marker@cnt\@tempa\relax
1465 \advance\acs@affil@marker@cnt\acs@footnote@cnt\relax
1466 \protected@edef\acs@author@footnotes{%
1467 \acs@author@footnotes
1468 ,%
1469 \acs@author@fnsymbol{\acs@affil@marker@cnt}%
1470 }%
1471 }%
1472 }
1473 % \end{macrocode}
1474 %\end{macro}
1475 %\end{macro}
1476 %\begin{macro}{\acs@author@affil@alt}
1477 %\begin{macro}{\acs@author@affil@alt@aux}
1478 % Alternative affiliations get the correct affiliation number back out
1479 % from the stored data. There are then two corrections: one for the
1480 % total number of main affiliations and a second in case there is a
1481 % footnote to the title.
1482 % \begin{macrocode}
1483 \newcommand*\acs@author@affil@alt{%
1484 \acs@ifundefined{@author@altaffil@\@roman\@tempcnta}{}{%
1485 \acs@author@affil@alt@aux
1486 }%
1487 }
1488 \newcommand*\acs@author@affil@alt@aux{%
1489 \expandafter\acs@affil@marker@cnt
1490 \csname @author@altaffil@\@roman\@tempcnta\endcsname\relax
1491 \advance\acs@affil@marker@cnt\acs@affil@cnt\relax
1492 \advance\acs@affil@marker@cnt\acs@footnote@cnt\relax
1493 \protected@edef\acs@author@footnotes{%
1494 \acs@author@footnotes
1495 ,%
1496 \acs@author@fnsymbol{\acs@affil@marker@cnt}%
1497 }%
1498 }
1499 % \end{macrocode}
1500 %\end{macro}
1501 %\end{macro}
1502 % \begin{macro}{\acs@author@fnsymbol}
1503 % \begin{macro}{\acs@author@fnsymbol@aux}
1504 % \begin{macro}{\acs@author@fnsymbol@loop}
1505 % \begin{macro}{\acs@author@fnsymbol@loop@aux@i}
1506 % \begin{macro}{\acs@author@fnsymbol@loop@aux@ii}
1507 % \begin{macro}{\acs@author@fnsymbol@loop@aux@m}
1508 % \begin{macro}{\acs@author@fnsymbol@loop@aux@Q}
1509 % \begin{macro}{\acs@author@fnsymbol@symbol}
1510 % The ACS have an extended list of symbols. The star appears at the
1511 % special position zero.
1512 % \begin{macrocode}
1513 \newcommand*{\acs@author@fnsymbol}[1]{%
1514 \ensuremath{%
1515 \expandafter\acs@author@fnsymbol@aux\expandafter{\number#1 }%
1516 }%
1517 }
1518 \newcommand*{\acs@author@fnsymbol@aux}[1]{%
1519 \ifnum#1>10 %
1520 \expandafter\acs@author@fnsymbol@loop
1521 \else
1522 \expandafter\acs@author@fnsymbol@symbol
1523 \fi
1524 {#1}%
1525 }
1526 \newcommand*{\acs@author@fnsymbol@loop}[1]{%
1527 \acs@author@fnsymbol@loop@aux@i#1%
1528 }
1529 \newcommand*{\acs@author@fnsymbol@loop@aux@i}[2]{%
1530 \acs@author@fnsymbol@symbol{\ifnum#2=0 10\else #2\fi}%
1531 \expandafter\acs@author@fnsymbol@loop@aux@ii\romannumeral #1000Q{}%
1532 {\acs@author@fnsymbol@symbol{\ifnum#2=0 10\else #2\fi}}%
1533 }
1534 \newcommand*{\acs@author@fnsymbol@loop@aux@ii}[1]{%
1535 \@nameuse{acs@author@fnsymbol@loop@aux@#1}%
1536 }
1537 \def\acs@author@fnsymbol@loop@aux@m#1Q#2#3{%
1538 \acs@author@fnsymbol@loop@aux@ii#1Q{#2#3}{#3}%
1539 }
1540 \newcommand*{\acs@author@fnsymbol@loop@aux@Q}[2]{#1}
1541 \newcommand*{\acs@author@fnsymbol@symbol}[1]{%
1542 \ifcase #1 *\or
1543 \dagger\or
1544 \ddagger\or
1545 \P\or
1546 \S\or
1547 \|\or
1548 \bot\or
1549 \#\or
1550 @\or
1551 \triangle\or
1552 \nabla
1553 \fi
1554 }
1555 % \end{macrocode}
1556 % \end{macro}
1557 % \end{macro}
1558 % \end{macro}
1559 % \end{macro}
1560 % \end{macro}
1561 % \end{macro}
1562 % \end{macro}
1563 % \end{macro}
1564 % \begin{macro}{\acs@address@list}
1565 % \begin{macro}{\acs@address@list@auxi}
1566 % \begin{macro}{\acs@address@list@auxii}
1567 % Loop over the addresses and any extra affiliations and print them
1568 % all: if there is only one, omit the marker entirely. There is also a
1569 % need to watch out for any footnotes from the title.
1570 % \begin{macrocode}
1571 \newcommand*\acs@address@list{%
1572 \ifnum\acs@affil@cnt>\z@
1573 \expandafter\acs@address@list@auxi
1574 \else
1575 \acs@warning{No affiliations: at least one affiliation is needed}%
1576 \fi
1577 }
1578 \newcommand*\acs@address@list@auxi{%
1579 \ifnum0%
1580 \ifnum\acs@affil@cnt>\@ne 1\fi
1581 \ifnum\acs@affil@alt@cnt>\z@ 1\fi
1582 >\z@
1583 \expandafter\acs@address@list@auxii
1584 \else
1585 \@address@i\par
1586 \fi
1587 }
1588 \newcommand*\acs@address@list@auxii{%
1589 \@tempcnta\z@
1590 \acs@affil@marker@cnt\acs@footnote@cnt
1591 \loop\ifnum\@tempcnta<\acs@affil@cnt
1592 \advance\@tempcnta\@ne
1593 \advance\acs@affil@marker@cnt\@ne
1594 \acs@author@fnsymbol{\acs@affil@marker@cnt}%
1595 \@nameuse{@address@\@roman\@tempcnta}\par
1596 \repeat
1597 \@tempcnta\z@
1598 \loop\ifnum\@tempcnta<\acs@affil@cnt
1599 \advance\@tempcnta\@ne
1600 \advance\acs@affil@marker@cnt\@ne
1601 \acs@ifundefined{@altaffil@\@roman\@tempcnta}
1602 {}
1603 {%
1604 \acs@author@fnsymbol{\acs@affil@marker@cnt}%
1605 \@nameuse{@altaffil@\@roman\@tempcnta}\par
1606 }%
1607 \repeat
1608 }
1609 % \end{macrocode}
1610 % \end{macro}
1611 % \end{macro}
1612 % \end{macro}
1613 %\begin{macro}{\acs@fnsymbol@org}
1614 %\begin{macro}{\acs@affil@list}
1615 %\begin{macro}{\acs@affil@list@aux}
1616 % Footnotes are done in two stages. First the main affiliation is
1617 % handled, then the possible alternative. There is a need to check for
1618 % the possibility that there is only one main affiliation but one or
1619 % more alternative ones.
1620 % \begin{macrocode}
1621 \newcommand*\acs@fnsymbol@org{}
1622 \newcommand*\acs@affil@list{%
1623 \let\acs@fnsymbol@org\@fnsymbol
1624 \let\@fnsymbol\acs@author@fnsymbol
1625 \@tempcnta\z@\relax
1626 \@tempcntb\z@\relax
1627 \ifnum\acs@affil@cnt>\@ne\relax
1628 \expandafter\acs@affil@list@aux
1629 \else
1630 \ifnum\acs@affil@alt@cnt>\z@\relax
1631 \acs@affil@marker@cnt\@ne\relax
1632 \advance\acs@affil@marker@cnt\acs@footnote@cnt\relax
1633 \footnotetext[\acs@affil@marker@cnt]{\@affil@i}%
1634 \@tempcnta\@ne\relax
1635 \fi
1636 \fi
1637 \ifnum\acs@affil@alt@cnt>\z@\relax
1638 \expandafter\acs@affil@alt@list
1639 \fi
1640 \let\@fnsymbol\acs@fnsymbol@org
1641 }
1642 \newcommand*\acs@affil@list@aux{%
1643 \advance\@tempcnta\@ne\relax
1644 \acs@affil@marker@cnt\@tempcnta\relax
1645 \advance\acs@affil@marker@cnt\acs@footnote@cnt\relax
1646 \footnotetext[\acs@affil@marker@cnt]{%
1647 \@nameuse{@affil@\@roman\@tempcnta}%
1648 }%
1649 \ifnum\@tempcnta<\acs@affil@cnt\relax
1650 \expandafter\acs@affil@list@aux
1651 \fi
1652 }
1653 % \end{macrocode}
1654 %\end{macro}
1655 %\end{macro}
1656 %\end{macro}
1657 %\begin{macro}{\acs@affil@alt@list}
1658 %\begin{macro}{\acs@affil@alt@lista@aux}
1659 % The secondary loop for alternative affiliations is similar.
1660 % \begin{macrocode}
1661 \newcommand*\acs@affil@alt@list{%
1662 \advance\@tempcntb\@ne\relax
1663 \acs@ifundefined{@altaffil@\@roman\@tempcntb}{}{%
1664 \acs@altaffil@foot@aux
1665 }
1666 \ifnum\@tempcntb<\acs@author@cnt\relax
1667 \expandafter\acs@affil@alt@list
1668 \fi
1669 }
1670 \newcommand*\acs@altaffil@foot@aux{%
1671 \advance\@tempcnta\@ne\relax
1672 \acs@affil@marker@cnt\@tempcnta\relax
1673 \advance\acs@affil@marker@cnt\acs@footnote@cnt\relax
1674 \footnotetext[\acs@affil@marker@cnt]{%
1675 \@nameuse{@altaffil@\@roman\@tempcntb}%
1676 }%
1677 }
1678 % \end{macrocode}
1679 %\end{macro}
1680 %\end{macro}
1681 %\begin{macro}{\acs@email@list@font}
1682 %\begin{macro}{\acs@email@list}
1683 %\begin{macro}{\acs@email@list@aux}
1684 % The final piece of meta-data to print is the e-mail address list.
1685 % The total number of e-mail addresses given it counted in
1686 % \cs{@tempcntb}, which means a warning can be given if there are
1687 % none. The group is used so that \cs{UrlFont} can be set correctly.
1688 % \begin{macrocode}
1689 \newcommand*\acs@email@list@font{\sf}
1690 \newcommand*\acs@email@list{%
1691 \begingroup
1692 \def\UrlFont{\acs@email@list@font}%
1693 \@tempcnta\z@\relax
1694 \@tempcntb\z@\relax
1695 \acs@email@list@aux
1696 \ifnum\@tempcntb=\z@\relax
1697 \acs@warning{%
1698 No e-mail given:\MessageBreak
1699 at lest one author must have a contact e-mail%
1700 }%
1701 \fi
1702 \endgroup
1703 }
1704 \newcommand*\acs@email@list@aux{%
1705 \advance\@tempcnta\@ne\relax
1706 \ifnum\@tempcnta>\acs@author@cnt\relax\else
1707 \acs@ifundefined{@email@\@roman\@tempcnta}{}{%
1708 \advance\@tempcntb\@ne\relax
1709 \ifnum\@tempcntb>\@ne\relax
1710 ;
1711 \fi
1712 \expandafter\expandafter\expandafter\url\expandafter
1713 \expandafter\expandafter{%
1714 \csname @email@\@roman\@tempcnta\endcsname
1715 }%
1716 }%
1717 \expandafter\acs@email@list@aux
1718 \fi
1719 }
1720 % \end{macrocode}
1721 %\end{macro}
1722 %\end{macro}
1723 %\end{macro}
1724 %\begin{macro}{\acs@number@list}
1725 %\begin{macro}{\acs@number@list@aux@i}
1726 %\begin{macro}{\acs@number@list@aux@ii}
1727 % Listing phone and fax numbers is easier as they don't have to be
1728 % given. Everything is done in one block so that it is possible to know
1729 % whether to add a new line and also to keep everything together.
1730 % \begin{macrocode}
1731 \newcommand*\acs@number@list{%
1732 \begingroup
1733 \acs@number@list@aux@i{phone}%
1734 \let\@tempb\@tempa
1735 \acs@number@list@aux@i{fax}%
1736 \ifx\@tempa\@empty
1737 \let\@tempa\@tempb
1738 \else
1739 \ifx\@tempb\@empty\else
1740 \protected@edef\@tempa{%
1741 \@tempb.\space\@tempa
1742 }%
1743 \fi
1744 \fi
1745 \ifx\@tempa\@empty\else
1746 \par
1747 \@tempa
1748 \fi
1749 \endgroup
1750 }
1751 \newcommand*\acs@number@list@aux@i[1]{%
1752 \def\@tempa{}%
1753 \@tempcnta\z@\relax
1754 \def\acs@number@list@aux@ii{%
1755 \advance\@tempcnta\@ne\relax
1756 \ifnum\@tempcnta>\acs@author@cnt\relax\else
1757 \acs@ifundefined{@#1@\@roman\@tempcnta}{}{%
1758 \acs@ifundefined{@email@\@roman\@tempcnta}{}{%
1759 \ifx\@tempa\@empty
1760 \edef\@tempa{%
1761 \@nameuse{@#1@\@roman\@tempcnta}%
1762 }%
1763 \else
1764 \edef\@tempa{%
1765 \@tempa
1766 ;
1767 \@nameuse{@#1@\@roman\@tempcnta}%
1768 }%
1769 \fi
1770 }%
1771 }%
1772 \expandafter\acs@number@list@aux@ii
1773 \fi
1774 }%
1775 \acs@number@list@aux@ii
1776 \ifx\@tempa\@empty\else
1777 \protected@edef\@tempa{%
1778 \MakeUppercase#1: \@tempa
1779 }%
1780 \fi
1781 }
1782 \newcommand*\acs@number@list@aux@ii{}
1783 % \end{macrocode}
1784 %\end{macro}
1785 %\end{macro}
1786 %\end{macro}
1787 % \begin{macro}{\endabstract}
1788 % \begin{macro}{\acs@abstract@extras}
1789 % \begin{macrocode}
1790 \g@addto@macro\endabstract{%
1791 \aftergroup\acs@abstract@extras
1792 }
1793 \newcommand*{\acs@abstract@extras}{%
1794 \ifacs@abbreviations
1795 \acs@abbreviations@print
1796 \par
1797 \fi
1798 \ifacs@keywords
1799 \acs@keywords@print
1800 \par
1801 \fi
1802 }
1803 % \end{macrocode}
1804 % \end{macro}
1805 % \end{macro}
1806 %
1807 %\begin{macro}{\acs@maketitle@extras}
1808 %\begin{macro}{\acs@maketitle@extras@hook}
1809 % A couple of things might need to be added to \cs{maketitle}.
1810 % \begin{macrocode}
1811 \newcommand*\acs@maketitle@extras{%
1812 \acs@maketitle@extras@hook
1813 }
1814 \newcommand*\acs@maketitle@extras@hook{}
1815 \g@addto@macro{\maketitle}{\acs@maketitle@extras}
1816 % \end{macrocode}
1817 %\end{macro}
1818 %\end{macro}
1819 % \cs{maketitle} is required by the document class, and must start
1820 % the document. No variation is allowed, and so it is done
1821 % automatically.
1822 % \begin{macrocode}
1823 \g@addto@macro{\document}{\maketitle}
1824 % \end{macrocode}
1825 %
1826 %\begin{environment}{scheme}
1827 %\begin{environment}{chart}
1828 %\begin{environment}{graph}
1829 % Three new float types are provided, \texttt{scheme}, \texttt{chart}
1830 % and \texttt{graph}. These are the most obvious types; for graphs,
1831 % a slight problem arises with the file extension.
1832 % \begin{macrocode}
1833 \newfloat{scheme}{htbp}{los}
1834 \floatname{scheme}{Scheme}
1835 \newfloat{chart}{htbp}{loc}
1836 \floatname{chart}{Chart}
1837 \newfloat{graph}{htbp}{loh}
1838 \floatname{graph}{Graph}
1839 % \end{macrocode}
1840 %\end{environment}
1841 %\end{environment}
1842 %\end{environment}
1843 %\begin{macro}{\schemename}
1844 %\begin{macro}{\chartname}
1845 %\begin{macro}{\graphname}
1846 % Naming is set up in the same way as the kernel floats.
1847 % \begin{macrocode}
1848 \newcommand*\schemename{Scheme}
1849 \newcommand*\chartname{Chart}
1850 \newcommand*\graphname{Graph}
1851 % \end{macrocode}
1852 %\end{macro}
1853 %\end{macro}
1854 %\end{macro}
1855 % The standard floats should appear ``here'' by default.
1856 % \begin{macrocode}
1857 \floatplacement{table}{htbp}
1858 \floatplacement{figure}{htbp}
1859 \floatstyle{plaintop}
1860 \restylefloat{table}
1861 % \end{macrocode}
1862 %\begin{macro}{\acs@floatboxreset}
1863 % Floats are all centred.
1864 % \begin{macrocode}
1865 \let\acs@floatboxreset\@floatboxreset
1866 \def\@floatboxreset{%
1867 \centering
1868 \acs@floatboxreset
1869 }
1870 % \end{macrocode}
1871 %\end{macro}
1872 %\begin{macro}{\plainref}
1873 %\begin{macro}{\ref}
1874 % For legacy support.
1875 % \begin{macrocode}
1876 \newcommand*\plainref{}
1877 \AtBeginDocument{\let\plainref\ref}
1878 % \end{macrocode}
1879 %\end{macro}
1880 %\end{macro}
1881 %
1882 %\begin{macro}{\acs@section}
1883 %\begin{macro}{\acs@subsection}
1884 %\begin{macro}{\acs@subsubsection}
1885 %\begin{macro}{\acs@startsection@orig}
1886 % Both the numbering and existence of section headers may need to be
1887 % altered. Some generic functions are therefore provided to deal with
1888 % this cleanly. First, some original definitions are saved.
1889 % \begin{macrocode}
1890 \newcommand*\acs@section{}
1891 \let\acs@section\section
1892 \newcommand*\acs@subsection{}
1893 \let\acs@subsection\subsection
1894 \newcommand*\acs@subsubsection{}
1895 \let\acs@subsubsection\subsubsection
1896 \newcommand*\acs@startsection@orig{}
1897 \let\acs@startsection@orig\@startsection
1898 % \end{macrocode}
1899 %\end{macro}
1900 %\end{macro}
1901 %\end{macro}
1902 %\end{macro}
1903 %\begin{macro}{\acs@startsection}
1904 % A version of \cs{@startsection} which adds unnumbered sections to
1905 % the TOC: modelled on \pkg{amsart}. This is active as standard.
1906 % \begin{macrocode}
1907 \newcommand\acs@startsection[6]{%
1908 \if@noskipsec \leavevmode \fi
1909 \par \@tempskipa #4\relax
1910 \@afterindenttrue
1911 \ifdim \@tempskipa <\z@ \@tempskipa -\@tempskipa \@afterindentfalse\fi
1912 \if@nobreak \everypar{}\else
1913 \addpenalty\@secpenalty\addvspace\@tempskipa\fi
1914 \@ifstar{\@dblarg{\@sect{#1}{\@m}{#3}{#4}{#5}{#6}}}%
1915 {\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}%
1916 }
1917 \let\@startsection\acs@startsection
1918 % \end{macrocode}
1919 %\end{macro}
1920 %\begin{macro}{\acs@startsection@alt}
1921 % An alternative version of \cs{@startsection} which never adds numbers.
1922 % \begin{macrocode}
1923 \newcommand*\acs@startsection@alt[6]{%
1924 \if@noskipsec \leavevmode \fi
1925 \par \@tempskipa #4\relax
1926 \@afterindenttrue
1927 \ifdim \@tempskipa <\z@ \@tempskipa -\@tempskipa \@afterindentfalse\fi
1928 \if@nobreak \everypar{}\else
1929 \addpenalty\@secpenalty\addvspace\@tempskipa\fi
1930 \@ifstar{\@ssect{#3}{#4}{#5}{#6}}
1931 {\@ssect{#3}{#4}{#5}{#6}}%
1932 }
1933 % \end{macrocode}
1934 %\end{macro}
1935 %\begin{macro}{\acs@sections@none}
1936 %\begin{macro}{\acs@sections@none@aux}
1937 % When removing sections entirely, a gobble macro is needed.
1938 % \begin{macrocode}
1939 \newcommand*\acs@sections@none{%
1940 \@ifstar{%
1941 \acs@sections@none@aux
1942 }{%
1943 \acs@sections@none@aux
1944 }%
1945 }
1946 \newcommand*\acs@sections@none@aux[2][]{%
1947 \acs@warning{%
1948 (Sub)section `#2' ignored%
1949 }%
1950 }
1951 % \end{macrocode}
1952 %\end{macro}
1953 %\end{macro}
1954 %\begin{macro}{\SectionNumbersOff}
1955 %\begin{macro}{\SectionNumbersOn}
1956 % To macros to add or remove the section numbers. The standard setting
1957 % for the class has them on, but some configurations will turn them
1958 % off. The names of these functions are both in design space so that
1959 % users can change the decision easily.
1960 % \begin{macrocode}
1961 \newcommand*\SectionNumbersOff{%
1962 \let\@startsection\acs@startsection@alt
1963 }
1964 \@onlypreamble\SectionNumbersOff
1965 \newcommand*\SectionNumbersOn{%
1966 \let\@startsection\acs@startsection
1967 }
1968 \@onlypreamble\SectionNumbersOn
1969 % \end{macrocode}
1970 %\end{macro}
1971 %\end{macro}
1972 %\begin{macro}{\SectionsOff}
1973 %\begin{macro}{\SectionsOn}
1974 % Quite similar for entire sections.
1975 % \begin{macrocode}
1976 \newcommand*\SectionsOff{%
1977 \let\section\acs@sections@none
1978 \let\subsection\acs@sections@none
1979 \let\subsubsection\acs@sections@none
1980 }
1981 \@onlypreamble\SectionsOff
1982 \newcommand*\SectionsOn{%
1983 \let\section\acs@section
1984 \let\subsection\acs@subsection
1985 \let\subsubsection\acs@subsubsection
1986 }
1987 \@onlypreamble\SectionsOn
1988 % \end{macrocode}
1989 %\end{macro}
1990 %\end{macro}
1991 % \begin{macro}{\tableofcontents}
1992 % Never print TOC in itself.
1993 % \begin{macrocode}
1994 \begingroup
1995 \toks@=\expandafter{\tableofcontents}
1996 \xdef\tableofcontents{%
1997 \begingroup
1998 \let\noexpand\@startsection\noexpand\acs@startsection@orig
1999 \the\toks@
2000 \endgroup
2001 }
2002 \endgroup
2003 % \end{macrocode}
2004 % \end{macro}
2005 %\begin{environment}{acknowledgement}
2006 %\begin{environment}{suppinfo}
2007 % Simple named sections.
2008 % \begin{macrocode}
2009 \newenvironment{acknowledgement}{%
2010 \acs@section*{\acknowledgementname}%
2011 }{}
2012 \newenvironment{suppinfo}{%
2013 \acs@section*{\suppinfoname}%
2014 }{}
2015 % \end{macrocode}
2016 %\end{environment}
2017 %\end{environment}
2018 %\begin{macro}{\acknowledgementname}
2019 %\begin{macro}{\bibsection}
2020 %\begin{macro}{\suppinfoname}
2021 % A few macros need to get around the changes.
2022 % \begin{macrocode}
2023 \newcommand*\acknowledgementname{Acknowledgement}
2024 \AtEndOfClass{%
2025 \def\bibsection{%
2026 \acs@section*{\refname}%
2027 }%
2028 }
2029 \newcommand*\suppinfoname{Supporting Information Available}
2030 % \end{macrocode}
2031 %\end{macro}
2032 %\end{macro}
2033 %\end{macro}
2034 %
2035 %\begin{macro}{\acs@abstract}
2036 %\begin{macro}{\acs@endabstract}
2037 %\begin{macro}{\acs@abstract@start}
2038 %\begin{macro}{\acs@abstract@end}
2039 %\begin{macro}{\acs@abstract@iffalse}
2040 % Removing the abstract, if necessary, is done using a trick from the
2041 % \pkg{comment} package. However, it code is copied here to keep
2042 % requirements down.
2043 % \begin{macrocode}
2044 \newcommand*\acs@abstract{}
2045 \let\acs@abstract\abstract
2046 \newcommand*\acs@endabstract{}
2047 \let\acs@endabstract\endabstract
2048 \begingroup
2049 \catcode`{ \active
2050 \catcode`} 12\relax
2051 \catcode`( 1\relax
2052 \catcode`) 2\relax
2053 \gdef\acs@abstract@start(%
2054 \acs@warning(%
2055 Abstract not allowed for this\MessageBreak
2056 manuscript type
2057 )%
2058 \@bsphack
2059 \catcode`{ \active
2060 \catcode`} 12\relax
2061 \let\end\fi
2062 \let{\acs@abstract@end% }
2063 \iffalse
2064 )%{
2065 \gdef\acs@abstract@end#1}(%
2066 \def\@tempa(#1)%
2067 \ifx\@tempa\@currenvir
2068 \@Esphack\endgroup
2069 \if@ignore
2070 \global\@ignorefalse
2071 \ignorespaces
2072 \fi
2073 \else
2074 \expandafter\acs@abstract@iffalse
2075 \fi
2076 )
2077 \endgroup
2078 \newcommand*\acs@iffalse{\iffalse}
2079 % \end{macrocode}
2080 %\end{macro}
2081 %\end{macro}
2082 %\end{macro}
2083 %\end{macro}
2084 %\end{macro}
2085 %\begin{macro}{\AbstractOff}
2086 %\begin{macro}{\AbstractOn}
2087 % A very similar pattern to before.
2088 % \begin{macrocode}
2089 \newcommand*\AbstractOff{%
2090 \let\abstract\acs@abstract@start
2091 \let\endabstract\acs@abstract@end
2092 }
2093 \@onlypreamble\AbstractOff
2094 \newcommand*\AbstractOn{%
2095 \let\abstract\acs@abstract
2096 \let\endabstract\acs@endabstract
2097 }
2098 \@onlypreamble\AbstractOn
2099 % \end{macrocode}
2100 %\end{macro}
2101 %\end{macro}
2102 %
2103 %\begin{macro}{\acs@collect@toks}
2104 %\begin{macro}{\acs@collect@content}
2105 %\begin{macro}{\acs@collect@content}
2106 % The content of the graphic TOC entry is processed using a method from
2107 % \pkg{amsmath} \emph{via} \pkg{environ}. The entire environment is
2108 % gathered for typesetting in a box. First, some storage is needed.
2109 % \begin{macrocode}
2110 \newtoks\acs@collect@toks
2111 \newtoks\acs@collect@empty@toks
2112 \newcommand*\acs@collect@begins{}
2113 \newcommand*\acs@collect@content{}
2114 % \end{macrocode}
2115 %\end{macro}
2116 %\end{macro}
2117 %\end{macro}
2118 %\begin{macro}{\acs@collect}
2119 %\begin{macro}{\acs@collect@aux}
2120 %\begin{macro}{\acs@collect@begins@}
2121 %\begin{macro}{\acs@collect@body}
2122 % This is a \cs{long} version of \cs{collect@body}.
2123 % \begin{macrocode}
2124 \newcommand\acs@collect[1]{%
2125 \acs@collect@toks{%
2126 \expandafter#1\expandafter{\the\acs@collect@toks}%
2127 }%
2128 \edef\acs@collect@content{%
2129 \the\acs@collect@toks
2130 \noexpand\end{\@currenvir}%
2131 }%
2132 \acs@collect@toks\acs@collect@empty@toks
2133 \def\acs@collect@begins{b}%
2134 \begingroup
2135 \expandafter\let\csname\@currenvir\endcsname\acs@collect@aux
2136 \edef\acs@collect@content{%
2137 \expandafter\noexpand\csname\@currenvir\endcsname
2138 }%
2139 \acs@collect@content
2140 }
2141 \newcommand*\acs@collect@aux{}
2142 \long\def\acs@collect@aux#1\end#2{%
2143 \edef\acs@collect@begins{%
2144 \acs@collect@begins@#1\begin\end
2145 \expandafter\@gobble\acs@collect@begins
2146 }%
2147 \ifx\@empty\acs@collect@begins
2148 \endgroup
2149 \@checkend{#2}%
2150 \acs@collect@body{#1}%
2151 \else
2152 \acs@collect@body{#1\end{#2}}%
2153 \fi
2154 \acs@collect@content
2155 }
2156 \newcommand*\acs@collect@begins@{}
2157 \long\def\acs@collect@begins@#1\begin#2{%
2158 \ifx\end#2\else
2159 b\expandafter\acs@collect@begins@
2160 \fi
2161 }
2162 \newcommand\acs@collect@body[1]{%
2163 \global\acs@collect@toks\expandafter{\the\acs@collect@toks#1}%
2164 }
2165 % \end{macrocode}
2166 %\end{macro}
2167 %\end{macro}
2168 %\end{macro}
2169 %\end{macro}
2170 %\begin{macro}{\acs@abstract@print}
2171 % Delayed abstract printing works in a similar way, but with some
2172 % formatting `built-in'.
2173 % \begin{macrocode}
2174 \newcommand\acs@abstract@print[1]{%
2175 \global\long\def\acs@abstract@text{%
2176 \if@twocolumn
2177 \@restonecoltrue\onecolumn
2178 \else
2179 \@restonecolfalse\newpage
2180 \fi
2181 \acs@section*{Abstract}%
2182 #1%
2183 \if@restonecol
2184 \twocolumn
2185 \else
2186 \newpage
2187 \fi
2188 }%
2189 \AtEndDocument{\acs@abstract@text}%
2190 }
2191 % \end{macrocode}
2192 %\end{macro}
2193 % \begin{macro}{\acs@tocentry@print}
2194 % \begin{macro}{\acs@tocentry@print@aux}
2195 % \begin{macro}{\acs@tocentry@text}
2196 % The same approach is taken for the graphical table of content
2197 % printing. This is done in a box so that everything has a frame around
2198 % it.
2199 % \begin{macrocode}
2200 \newcommand{\acs@tocentry@print}[1]{%
2201 \gdef\acs@tocentry@text{\normalsize#1}%
2202 \AtEndDocument{%
2203 \if@twocolumn
2204 \@restonecoltrue\onecolumn
2205 \else
2206 \@restonecolfalse\newpage
2207 \fi
2208 \acs@tocentry@print@aux
2209 \if@restonecol
2210 \twocolumn
2211 \else
2212 \newpage
2213 \fi
2214 }%
2215 }
2216 \newcommand*{\acs@tocentry@print@aux}{%
2217 \begingroup
2218 \let\@startsection\acs@startsection@orig
2219 \acs@section*{\tocentryname}%
2220 \tocsize
2221 \sffamily
2222 \singlespacing
2223 \begin{center}
2224 \fbox
2225 {%
2226 \begin{minipage}{\acs@tocentry@width}
2227 \vbox to \acs@tocentry@height{\acs@tocentry@text}%
2228 \end{minipage}%
2229 }%
2230 \end{center}%
2231 \endgroup
2232 }
2233 \newcommand*\acs@tocentry@text{TOC ENTRY REQUIRED}
2234 \newlength{\acs@tocentry@height}
2235 \newlength{\acs@tocentry@width}
2236 \setlength{\acs@tocentry@height}{1.75in}
2237 \setlength{\acs@tocentry@width}{3.25in}
2238 % \end{macrocode}
2239 % \end{macro}
2240 % \end{macro}
2241 % \end{macro}
2242 %\begin{environment}{tocentry}
2243 % Actually creating the entry is pretty easy.
2244 % \begin{macrocode}
2245 \newenvironment{tocentry}{\acs@collect\acs@tocentry@print}{}
2246 % \end{macrocode}
2247 %\end{environment}
2248 %\begin{macro}{\tocentryname}
2249 % A simple name macro.
2250 % \begin{macrocode}
2251 \newcommand*\tocentryname{TOC Graphic}
2252 % \end{macrocode}
2253 %\end{macro}
2254 %\begin{macro}{\tocsize}
2255 % The font size for printing the TOC entry.
2256 % \begin{macrocode}
2257 \newcommand*\tocsize{%
2258 \@setfontsize\tocsize\@viiipt\@ixpt
2259 }
2260 % \end{macrocode}
2261 %\end{macro}
2262 %
2263 %\begin{macro}{\acs@type@list}
2264 %\begin{macro}{\acs@type@default}
2265 %\begin{macro}{\acs@type@check}
2266 % Different journals allow different types of article. A list is set
2267 % up here: different journals can then alter it. A check function
2268 % is also provided along with a default.
2269 % \begin{macrocode}
2270 \newcommand*\acs@type@list{article,communication,suppinfo}
2271 \newcommand*\acs@type@default{article}
2272 \newcommand*\acs@type@check{%
2273 \@tempswafalse
2274 \@for\@tempa:=\acs@type@list\do{%
2275 \ifx\@tempa\acs@manuscript
2276 \expandafter\@tempswatrue
2277 \fi
2278 }%
2279 \if@tempswa\else
2280 \acs@warning{%
2281 Invalid manuscript type \acs@manuscript:\MessageBreak
2282 changed to default type \acs@type@default
2283 }%
2284 \let\acs@manuscript\acs@type@default
2285 \fi
2286 }
2287 % \end{macrocode}
2288 %\end{macro}
2289 %\end{macro}
2290 %\end{macro}
2291 %
2292 % A few bits for older versions.
2293 % \begin{macrocode}
2294 \newcommand*\acs@setkeys{\setkeys{acs}}
2295 \let\acs@killabstract\AbstractOff
2296 \let\acs@killsecs\SectionsOff
2297 \newcommand*\acs@validtype[2][article]{%
2298 \def\acs@type@default{#1}%
2299 \def\acs@type@list{#2}%
2300 }
2301 % \end{macrocode}
2302 %
2303 %\begin{macro}{\acs@par}
2304 % A saved paragraph.
2305 % \begin{macrocode}
2306 \newcommand*\acs@par{}
2307 \let\acs@par\par
2308 % \end{macrocode}
2309 %\end{macro}
2310 %\begin{macro}{\acs@layout@shared}
2311 %\begin{environment}{acknowledgement}
2312 %\begin{environment}{suppinfo}
2313 % Some code is used generally when setting up ``press ready'' layouts.
2314 % There is quite a bit here, mainly layout related.
2315 % \begin{macrocode}
2316 \newcommand*\acs@layout@shared{%
2317 \AtBeginDocument{\singlespacing}%
2318 \twocolumn
2319 \tolerance=2000\relax
2320 \emergencystretch=10pt\relax
2321 \geometry{
2322 letterpaper,
2323 top = 12.7mm,
2324 bottom = 16.8mm,
2325 left = 19.3mm,
2326 right = 19.3mm
2327 }%
2328 \setlength{\columnsep}{8.1mm}%
2329 \setlength{\parindent}{3.3mm}%
2330 \renewenvironment{acknowledgement}{%
2331 \def\@tempa{acknowledgement}%
2332 \ifx\@currenvir\@tempa
2333 \let\par\relax
2334 \acksize
2335 \vspace{6pt}%
2336 \textbf{\acknowledgementname}%
2337 \else
2338 \acs@section*{\acknowledgementname}%
2339 \fi
2340 }{%
2341 \acs@par
2342 }%
2343 }
2344 % \end{macrocode}
2345 %\end{environment}
2346 %\end{environment}
2347 %\end{macro}
2348 %\begin{macro}{\acksize}
2349 %\begin{macro}{\suppsize}
2350 % More sizes.
2351 % \begin{macrocode}
2352 \newcommand*\acksize{\normalsize}
2353 \newcommand*\suppsize{\normalsize}
2354 % \end{macrocode}
2355 %\end{macro}
2356 %\end{macro}
2357 %\begin{macro}{\acs@layout@nine}
2358 %\begin{macro}{\@xipt}
2359 %\begin{macro}{\acs@layout@ten}
2360 % The class loads twelve point text. To reset it for print layouts, it
2361 % is easiest to do things directly.
2362 % \begin{macrocode}
2363 \newcommand*\acs@layout@nine{%
2364 \def\@xipt{11}%
2365 \long\def\normalsize{%
2366 \@setfontsize\normalsize\@ixpt\@xipt
2367 }%
2368 \normalsize
2369 \let\@listi\@listI
2370 \abovedisplayskip 5\p@ \@plus2\p@ \@minus 5\p@\relax
2371 \abovedisplayshortskip \z@ \@plus3\p@\relax
2372 \belowdisplayshortskip 3\p@ \@plus3\p@ \@minus 3\p@\relax
2373 \belowdisplayskip\abovedisplayskip\relax
2374 \abovecaptionskip 5\p@\relax
2375 \intextsep 7\p@ \@plus 2\p@ \@minus 2\p@\relax
2376 }
2377 \newcommand*\acs@layout@ten{%
2378 \long\def\normalsize{%
2379 \@setfontsize\normalsize\@xpt\@xiipt
2380 }%
2381 \normalsize
2382 \@setfontsize\normalsize\@xpt\@xiipt
2383 \let\@listi\@listI
2384 \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@\relax
2385 \abovedisplayshortskip \z@ \@plus3\p@\relax
2386 \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@\relax
2387 \belowdisplayskip \abovedisplayskip\relax
2388 }
2389 % \end{macrocode}
2390 %\end{macro}
2391 %\end{macro}
2392 %\end{macro}
2393 %
2394 % With all of the standard settings done, the journal configuration can
2395 % be loaded.
2396 % \begin{macrocode}
2397 \InputIfFileExists{achemso-\[email protected]}{}{%
2398 \acs@warning{%
2399 Unknown journal `\acs@journal':\MessageBreak
2400 using default configuration JACSAT%
2401 }%
2402 \input{achemso-jacsat.cfg}%
2403 }
2404 % \end{macrocode}
2405 %
2406 % Suppress spurious warnings.
2407 % \begin{macrocode}
2408 \let\@unusedoptionlist\@empty
2409 % \end{macrocode}
2410 %
2411 %\begin{macro}{\thepage}
2412 % Some changes that can always be applied if the manuscript type is
2413 % appropriate: this saves some repetition in the configuration files.
2414 % \begin{macrocode}
2415 \acs@type@check
2416 \ifx\acs@manuscript\acs@manuscript@note
2417 \SectionsOff
2418 \fi
2419 \ifx\acs@manuscript\acs@manuscript@review
2420 \SectionsOn
2421 \SectionNumbersOn
2422 \fi
2423 \ifx\acs@manuscript\acs@manuscript@suppinfo
2424 \setkeys{acs}{maxauthors = 0}
2425 \def\thepage{S-\arabic{page}}
2426 \renewcommand*\thefigure{S\@arabic\c@figure}
2427 \renewcommand*\thescheme{S\@arabic\c@scheme}
2428 \renewcommand*\thetable{S\@arabic\c@table}
2429 \AtBeginDocument
2430 {%
2431 \renewcommand*\citenumfont[1]{S#1}%
2432 \renewcommand*\bibnumfmt[1]{(S#1)}%
2433 }
2434 \fi
2435 % \end{macrocode}
2436 %\end{macro}
2437 %
2438 % Set up two column layout.
2439 % \begin{macrocode}
2440 \begingroup
2441 \def\@tempa{twocolumn}
2442 \ifx\acs@layout\@tempa
2443 \aftergroup\acs@layout@shared
2444 \fi
2445 \def\@tempa{two-column}
2446 \ifx\acs@layout\@tempa
2447 \aftergroup\acs@layout@shared
2448 \fi
2449 \endgroup
2450 %</class>
2451 % \end{macrocode}
2452 %
2453 %\subsection{Late shared code}
2454 %
2455 %\begin{macro}{\citenumfont}
2456 % Changes to citations can now be made. The citation styles supplied
2457 % here require \pkg{natbib}, which is loaded with the appropriate
2458 % options. This part applies to the package as well as the class: it is
2459 % here so that the load order is correct.
2460 % \begin{macrocode}
2461 %<*class|package>
2462 \ifacs@super
2463 \RequirePackage[sort&compress,numbers,super]{natbib}
2464 \else
2465 \RequirePackage[sort&compress,numbers,round]{natbib}
2466 \def\citenumfont{\textit}
2467 \fi
2468 \define@key{acs}{super}[true]{%
2469 \def\@tempa{#1}%
2470 \def\@tempb{true}%
2471 \ifx\@tempa\@tempb
2472 \setcitestyle{super,open={},close={}}%
2473 \renewcommand*\citenumfont{}%
2474 \else
2475 \setcitestyle{round}%
2476 \renewcommand*\citenumfont{\textit}
2477 \fi
2478 }
2479 \RequirePackage{natmove}
2480 % \end{macrocode}
2481 %\end{macro}
2482 % The \pkg{mciteplus} package allows the construction of lists of
2483 % references with sub-letters. However, it might not be available, and
2484 % so it is only loaded if available: the \file{.bst} files should work
2485 % either way. There is also a patch to get cross-references correct
2486 % with the modified \cs{ref} macro used here. The reason for ensuring
2487 % that \cs{@mciteNatbibCiteCmdList} is defined is that it allows for
2488 % the case where people prevent \pkg{mciteplus} being loaded using
2489 % \cs{[email protected]}.
2490 % \begin{macrocode}
2491 \IfFileExists{mciteplus.sty}{%
2492 \RequirePackage{mciteplus}
2493 \providecommand*{\@mciteNatbibCiteCmdList}{}%
2494 \edef\@tempa{\noexpand\in@{citenum}{\@mciteNatbibCiteCmdList}}%
2495 \@tempa
2496 \ifin@
2497 \else
2498 \edef\@mciteNatbibCiteCmdList{\@mciteNatbibCiteCmdList,citenum}%
2499 \fi
2500 %<*!package>
2501 \def\@mciteSubRef[##1]##2{\plainref{\@mcitereflabelprefix:##1:##2}}
2502 %</!package>
2503 }{}
2504 % \end{macrocode}
2505 %
2506 %\begin{macro}{\acs@bibstyle}
2507 % The next step is to sort out bibliography formatting. With both the
2508 % package and the class, the bibliography style is determined without
2509 % user intervention. The style is stored as it may need to be
2510 % altered later.
2511 % \begin{macrocode}
2512 \newcommand*\acs@bibstyle{achemso}
2513 \ifacs@biochem
2514 \def\acs@bibstyle{biochem}
2515 \bibliographystyle{biochem}
2516 \else
2517 \bibliographystyle{achemso}
2518 \fi
2519 % \end{macrocode}
2520 %\end{macro}
2521 %\begin{macro}{\acs@bibliographystyle}
2522 %\begin{macro}{\bibliographystyle}
2523 % The original \cs{bibliographystyle} macro is now disabled: the
2524 % underlying command is repeated otherwise problems cop up with
2525 % \pkg{chapterbib}.
2526 % \begin{macrocode}
2527 \newcommand*\acs@bibliographystyle{}
2528 \let\acs@bibliographystyle\bibliographystyle
2529 \def\bibliographystyle#1{%
2530 \acs@warning{\string\bibliographystyle\space ignored}%
2531 \expandafter\acs@bibliographystyle\expandafter{\acs@bibstyle}%
2532 }
2533 %</class|package>
2534 % \end{macrocode}
2535 %\end{macro}
2536 %\end{macro}
2537 %
2538 %\subsection{Late package-only code}
2539 %
2540 % The \pkg{notes2bib} code may or may not be activated.
2541 % \begin{macrocode}
2542 %<*package>
2543 \AtBeginDocument{%
2544 \@ifpackageloaded{notes2bib}{}{%
2545 \acs@niib@create
2546 }%
2547 }
2548 %</package>
2549 % \end{macrocode}
2550 %
2551 %\subsection{Moving citations with \pkg{natbib}}
2552 %
2553 % The code for moving citations is created as a separate package, as
2554 % the code needed is the same in both cases.
2555 % \begin{macrocode}
2556 %<*natmove>
2557 \ProvidesPackage{natmove}
2558 [2010/01/15 v1.1a Automatic citation moving with natbib]
2559 \RequirePackage{natbib}
2560 % \end{macrocode}
2561 %
2562 %\begin{macro}{\nmv@ifmtarg}
2563 %\begin{macro}{\nmv@xifmtarg}
2564 % To keep down dependence on other packages, the very short code block
2565 % from \pkg{ifmtarg} is copied here with an internal name.
2566 % \begin{macrocode}
2567 \newcommand*\nmv@ifmtarg{}
2568 \newcommand*\nmv@xifmtarg{}
2569 \begingroup
2570 \catcode`\Q 3\relax
2571 \long\gdef\nmv@ifmtarg#1{%
2572 \nmv@xifmtarg#1QQ\@secondoftwo\@firstoftwo\@nil
2573 }
2574 \long\gdef\nmv@xifmtarg#1#2Q#3#4#5\@nil{#4}
2575 \endgroup
2576 % \end{macrocode}
2577 %\end{macro}
2578 %\end{macro}
2579 %\begin{macro}{\ifnmv@cite}
2580 % A flag is need to watch whether \cs{cite} or another macro is in use.
2581 % \begin{macrocode}
2582 \newif\ifnmv@cite
2583 % \end{macrocode}
2584 %\end{macro}
2585 %\begin{macro}{\nmv@citex}
2586 % Using the flag, either the new internal macro, or the \pkg{natbib}
2587 % original, can be called.
2588 % \begin{macrocode}
2589 \newcommand*\nmv@citex{%
2590 \ifnmv@cite
2591 \expandafter\nmv@citex@moving
2592 \else
2593 \expandafter\nmv@citex@nat
2594 \fi
2595 }
2596 % \end{macrocode}
2597 %\end{macro}
2598 %\begin{macro}{\nmv@after}
2599 % Later, the argument for \cs{cite} will need to be saved.
2600 % \begin{macrocode}
2601 \newcommand*\nmv@after{}
2602 % \end{macrocode}
2603 %\end{macro}
2604 %\begin{macro}{\nmv@citex@moving}
2605 % The new version of \cs{@citex} is needed that looks ahead of the
2606 % citation using \cs{futurelet}. There are three arguments to
2607 % \cs{@citex} when using \pkg{natbib}. Other than that, the trick
2608 % used here is similar to that in \pkg{cite}.
2609 % \begin{macrocode}
2610 \newcommand*\nmv@citex@moving{}
2611 \def\nmv@citex@moving[#1][#2]#3{%
2612 \leavevmode
2613 \skip@\lastskip\relax
2614 \unskip
2615 \begingroup
2616 \def\nmv@after{\nmv@citex@nat[#1][#2]{#3}}%
2617 \global\nmv@citefalse
2618 \nmv@citex@get@next\relax
2619 }
2620 % \end{macrocode}
2621 %\end{macro}
2622 %\begin{macro}{\nmv@citex@end}
2623 % To get things right at the end.
2624 % \begin{macrocode}
2625 \newcommand*\nmv@citex@end{%
2626 \nmv@after
2627 \endgroup
2628 }
2629 % \end{macrocode}
2630 %\end{macro}
2631 %\begin{macro}{\nmv@citex@get@next}
2632 %\begin{macro}{\nmv@citex@next}
2633 % The next token on the input stack is saved into
2634 % \cs{nmv@citex@next}, after gobbling up one token.
2635 % \begin{macrocode}
2636 \newcommand*\nmv@citex@get@next[1]{%
2637 \futurelet\nmv@citex@next\nmv@citex@punct
2638 }
2639 % \end{macrocode}
2640 %\end{macro}
2641 %\end{macro}
2642 %\begin{macro}{\nmv@citex@punct}
2643 %\begin{macro}{\nmv@citex@punct@undouble}
2644 %\begin{macro}{\nmv@citex@loop}
2645 % The working macro for moving the punctuation. This is very much
2646 % like \cs{@citey} in the \pkg{cite} package. The initial assumption
2647 % is that the loop will terminate, and so the recursion call will
2648 % simply do the finalisation.
2649 % \begin{macrocode}
2650 \newcommand*\nmv@citex@punct{%
2651 \let\nmv@citex@loop\nmv@citex@end
2652 \ifx\nmv@citex@next.\relax
2653 \ifnum\spacefactor<\nmv@citex@sfac\else
2654 \expandafter\expandafter\expandafter\nmv@citex@punct@undouble
2655 \fi
2656 \fi
2657 \expandafter\nmv@citex@punct@aux\natmovechars\@nil
2658 \nmv@citex@loop
2659 }
2660 \newcommand*\nmv@citex@punct@undouble{%
2661 \let\nmv@citex@next\relax
2662 \let\nmv@citex@loop\nmv@citex@get@next
2663 }
2664 \newcommand*\nmv@citex@loop{}
2665 % \end{macrocode}
2666 %\end{macro}
2667 %\end{macro}
2668 %\end{macro}
2669 %\begin{macro}{\nmv@citex@punct@aux}
2670 % The final part of the punctuation moving system.
2671 % \begin{macrocode}
2672 \newcommand*\nmv@citex@punct@aux[1]{%
2673 \ifx\nmv@citex@next#1\@empty
2674 #1%
2675 \let\nmv@citex@loop\nmv@citex@get@next
2676 \fi
2677 \ifx#1\@nil\else
2678 \expandafter\nmv@citex@punct@aux
2679 \fi
2680 }
2681 % \end{macrocode}
2682 %\end{macro}
2683 %\begin{macro}{\nmv@citex@sfac}
2684 % The value of the spacing factor after a full stop is used to signal
2685 % doubled punctuation. For French spacing, a bit of patching is
2686 % needed.
2687 % \begin{macrocode}
2688 \mathchardef\nmv@citex@sfac3000\relax
2689 \expandafter\def\expandafter\frenchspacing\expandafter{%
2690 \frenchspacing
2691 \mathchardef\nmv@citex@sfac1001\relax
2692 \sfcode`\.\nmv@citex@sfac
2693 \sfcode`\?\nmv@citex@sfac
2694 \sfcode`\!\nmv@citex@sfac
2695 }
2696 \ifnum\sfcode`\.=\@m
2697 \frenchspacing
2698 \fi
2699 % \end{macrocode}
2700 %\end{macro}
2701 %\begin{macro}{\nmv@citex@nat}
2702 %\begin{macro}{\nmv@activate}
2703 %\begin{macro}{\cite}
2704 % The swap has to be done at the beginning of the document. The
2705 % internal flag from \pkg{natbib} is used, but under the
2706 % circumstances we should be safe. \cs{cite} is also patched to make
2707 % the system active.
2708 % \begin{macrocode}
2709 \newcommand*\nmv@citex@nat{}
2710 \newcommand*\nmv@activate{%
2711 \let\nmv@citex@nat\@citex
2712 \let\@citex\nmv@citex
2713 \let\nmv@cite\cite
2714 \renewcommand*{\cite}[2][]{%
2715 \nmv@ifmtarg{##1}{%
2716 \nmv@citetrue
2717 \nmv@cite{##2}%
2718 }{%
2719 \nmv@citefalse
2720 \nmv@cite[##1]{##2}}%
2721 }%
2722 }
2723 % \end{macrocode}
2724 %\end{macro}
2725 %\end{macro}
2726 %\end{macro}
2727 %\begin{macro}{\nmv@natbib@detect}
2728 % So that \pkg{natbib} options can be set without worrying about load
2729 % order, \pkg{natmove} doesn't require \pkg{natbib}. So a test is needed
2730 % to see if it is actually loaded. This is done as a macro so that the
2731 % effect can be changed by \pkg{achemso}.
2732 % \begin{macrocode}
2733 \newcommand*\nmv@natbib@detect{%
2734 \@ifpackageloaded{natbib}{%
2735 \ifNAT@super
2736 \expandafter\nmv@activate
2737 \fi
2738 }{%
2739 \PackageInfo{natmove}{%
2740 The natbib package is not loaded.\MessageBreak
2741 Loading natmove will do nothing
2742 }%
2743 }%
2744 }
2745 \AtBeginDocument{\nmv@natbib@detect}
2746 % \end{macrocode}
2747 %\end{macro}
2748 %\begin{macro}{\natmovechars}
2749 % A user macro is needed for moving characters.
2750 % \begin{macrocode}
2751 \newcommand*\natmovechars{.,;:}
2752 %</natmove>
2753 % \end{macrocode}
2754 %\end{macro}
2755 %
2756 %\subsection{The configuration files}
2757 %
2758 % The configuration files for different journals are not very complex.
2759 % Keeping everything separate simply helps with maintenance.
2760 %
2761 % \begin{macrocode}
2762 %<*abmcb8>
2763 \ProvidesFile{achemso-abmcb8.cfg}
2764 [2025-09-22 v3.14 achemso configuration: ACS Bio. Med. Chem. Au]
2765 \def\acs@type@list{article,review,letter,perspective,suppinfo}
2766 \setkeys{acs}{keywords = true}
2767 %</abmcb8>
2768 %<*aeacb3>
2769 \ProvidesFile{achemso-aeacb3.cfg}
2770 [2025-09-22 v3.14 achemso configuration: ACS Eng. Au]
2771 \def\acs@type@list{article,review,letter,perspective,suppinfo}
2772 \setkeys{acs}{keywords = true}
2773 %</aeacb3>
2774 %<*aeacc4>
2775 \ProvidesFile{achemso-aeacc4.cfg}
2776 [2025-09-22 v3.14 achemso configuration: ACS Env. Au]
2777 \def\acs@type@list{article,review,letter,perspective,suppinfo}
2778 \setkeys{acs}{keywords = true}
2779 %</aeacc4>
2780 %<*amacgu>
2781 \ProvidesFile{achemso-amacgu.cfg}
2782 [2025-09-22 v3.14 achemso configuration: ACS Mater. Au]
2783 \def\acs@type@list{article,review,letter,perspective,suppinfo}
2784 \setkeys{acs}{keywords = true}
2785 %</amacgu>
2786 %<*amachv>
2787 \ProvidesFile{achemso-amachv.cfg}
2788 [2025-09-22 v3.14 achemso configuration: ACS Meas. Au]
2789 \def\acs@type@list{article,review,letter,perspective,suppinfo}
2790 \setkeys{acs}{keywords = true}
2791 %</amachv>
2792 %<*anaccx>
2793 \ProvidesFile{achemso-anaccx.cfg}
2794 [2025-09-22 v3.14 achemso configuration: ACS Nanosci. Au]
2795 \def\acs@type@list{article,review,letter,perspective,suppinfo}
2796 \setkeys{acs}{keywords = true}
2797 %</anaccx>
2798 %<*abmcb8>
2799 \ProvidesFile{achemso-abmcb8.cfg}
2800 [2025-09-22 v3.14 achemso configuration: ACS Bio. Med. Chem. Au]
2801 \def\acs@type@list{article,review,letter,perspective,suppinfo}
2802 \setkeys{acs}{keywords = true}
2803 %</abmcb8>
2804 %<*aoiab5>
2805 \ProvidesFile{achemso-aoiab5.cfg}
2806 [2025-09-22 v3.14 achemso configuration: ACS Org. Inorg. Au]
2807 \def\acs@type@list{article,review,letter,perspective,suppinfo}
2808 \setkeys{acs}{keywords = true}
2809 %</aoiab5>
2810 %<*apcach>
2811 \ProvidesFile{achemso-apcach.cfg}
2812 [2025-09-22 v3.14 achemso configuration: ACS Phys. Bio. Med. Chem. Au]
2813 \def\acs@type@list{article,review,letter,perspective,suppinfo}
2814 \setkeys{acs}{keywords = true}
2815 %</apcach>
2816 %<*appccd>
2817 \ProvidesFile{achemso-appccd.cfg}
2818 [2025-09-22 v3.14 achemso configuration: ACS Polym. Au]
2819 \def\acs@type@list{article,review,letter,perspective,suppinfo}
2820 \setkeys{acs}{keywords = true}
2821 %</appccd>
2822 %<*achre4>
2823 \ProvidesFile{achemso-achre4.cfg}
2824 [2025-09-22 v3.14 achemso configuration: Acc. Chem. Res.]
2825 \setkeys{acs}{biblabel = plain}
2826 \def\acs@type@list{article,suppinfo}
2827 \def\abstractname{Conspectus}
2828 %</achre4>
2829 %<*aaembp>
2830 \ProvidesFile{achemso-aaembp.cfg}
2831 [2025-09-22 v3.14 achemso configuration: ACS Appl. Electron. Mater.]
2832 \def\acs@type@list{article,letter,suppinfo}
2833 \setkeys{acs}{keywords = true}
2834 %</aaembp>
2835 %<*aaemcq>
2836 \ProvidesFile{achemso-aaemcq.cfg}
2837 [2025-09-22 v3.14 achemso configuration: ACS Appl. Energy Mater.]
2838 \def\acs@type@list{article,letter,suppinfo}
2839 \setkeys{acs}{keywords = true}
2840 %</aaemcq>
2841 %<*aamick>
2842 \ProvidesFile{achemso-aamick.cfg}
2843 [2025-09-22 v3.14 achemso configuration: ACS Appl. Mater. Interfaces]
2844 \def\acs@type@list{article,letter,suppinfo}
2845 \setkeys{acs}{keywords = true}
2846 %</aamick>
2847 %<*aanmf6>
2848 \ProvidesFile{achemso-aanmf6.cfg}
2849 [2025-09-22 v3.14 achemso configuration: ACS Appl. Nano Mater.]
2850 \def\acs@type@list{article,letter,suppinfo}
2851 \setkeys{acs}{keywords = true}
2852 %</aanmf6>
2853 %<*aapmcd>
2854 \ProvidesFile{achemso-aapmcd.cfg}
2855 [2025-09-22 v3.14 achemso configuration: ACS Appl. Polym. Mater.]
2856 \def\acs@type@list{article,letter,suppinfo}
2857 \setkeys{acs}{keywords = true}
2858 %</aapmcd>
2859 %<*aastgj>
2860 \ProvidesFile{achemso-aastgj.cfg}
2861 [2025-09-22 v3.14 achemso configuration: ACS Agri. Sci. Tech.]
2862 \def\acs@type@list{account,article,letter,retraction,review,viewpoint,suppinfo}
2863 \setkeys{acs}{keywords = true}
2864 %</aastgj>
2865 %<*abseba>
2866 \ProvidesFile{achemso-abseba.cfg}
2867 [2025-09-22 v3.14 achemso configuration: ACS Biomater. Sci. Eng.]
2868 \setkeys{acs}{keywords = true}
2869 \def\acs@type@list{article,review,suppinfo}
2870 %</abseba>
2871 %<*accacs>
2872 \ProvidesFile{achemso-accacs.cfg}
2873 [2025-09-22 v3.14 achemso configuration: ACS Catal.]
2874 \setkeys{acs}{keywords = true}
2875 \def\acs@type@list{article,letter,perspective,review,viewpoints,suppinfo}
2876 \SectionNumbersOff
2877 %</accacs>
2878 %<*acscii>
2879 \ProvidesFile{achemso-acscii.cfg}
2880 [2025-09-22 v3.14 achemso configuration: ACS Central Sci.]
2881 \def\acs@type@list{article,review,suppinfo}
2882 \setkeys{acs}{doi = true}
2883 \SectionNumbersOff
2884 %</acscii>
2885 %<*acbcct>
2886 \ProvidesFile{achemso-acbcct.cfg}
2887 [2025-09-22 v3.14 achemso configuration: ACS Chem. Biol.]
2888 \setkeys{acs}{
2889 biblabel = fullstop,
2890 biochem = true,
2891 super = false
2892 }
2893 \def\acs@type@list{article,letter,review,suppinfo}
2894 \SectionNumbersOff
2895 %</acbcct>
2896 %<*acncdm>
2897 \ProvidesFile{achemso-acncdm.cfg}
2898 [2025-09-22 v3.14 achemso configuration: ACS Chem. Neurosci.]
2899 \def\acs@type@list{article,review,letter,suppinfo,viewpoint}
2900 \setkeys{acs}{
2901 biblabel = fullstop,
2902 biochem = true,
2903 keywords = true,
2904 super = false
2905 }
2906 %</acncdm>
2907 %<*acsccc>
2908 \ProvidesFile{achemso-acsccc.cfg}
2909 [2025-09-22 v3.14 achemso configuration: ACS Combinatorial Sci.]
2910 \def\acs@type@list{article,letter,review,perspective,account,note,suppinfo}
2911 \setkeys{acs}{keywords = true}
2912 \SectionNumbersOff
2913 %</acsccc>
2914 %<*aesccq>
2915 \ProvidesFile{achemso-aesccq.cfg}
2916 [2025-09-22 v3.14 achemso configuration: ACS Earth Space Chem.]
2917 \def\acs@type@list{article,suppinfo}
2918 \setkeys{acs}{keywords = true}
2919 %</aesccq>
2920 %<*aelccp>
2921 \ProvidesFile{achemso-aelccp.cfg}
2922 [2025-09-22 v3.14 achemso configuration: ACS Energy Lett.]
2923 \def\acs@type@list{letter,perspective,review,viewpoint,focus}
2924 \SectionsOff
2925 %</aelccp>
2926 %<*aeecco>
2927 \ProvidesFile{achemso-aeecco.cfg}
2928 [2025-09-22 v3.14 achemso configuration: ACS ES&T Eng.]
2929 \def\acs@type@list{article,feature,perspective,review,viewpoint}
2930 \setkeys{acs}{keywords = true}
2931 %</aeecco>
2932 %<*aewcaa>
2933 \ProvidesFile{achemso-aewcaa.cfg}
2934 [2025-09-22 v3.14 achemso configuration: ACS ES&T Water]
2935 \def\acs@type@list{article,feature,perspective,review,viewpoint}
2936 \setkeys{acs}{keywords = true}
2937 %</aewcaa>
2938 %<*afsthl>
2939 \ProvidesFile{achemso-afsthl.cfg}
2940 [2025-09-22 v3.14 achemso configuration: ACS Food Sci. Tech.]
2941 \def\acs@type@list{account,article,perspective,retraction,review,viewpoint}
2942 \setkeys{acs}{keywords = true}
2943 %</afsthl>
2944 %<*ascefj>
2945 \ProvidesFile{achemso-ascefj.cfg}
2946 [2025-09-22 v3.14 achemso configuration: ACS Infect. Dis.]
2947 \def\acs@type@list{article,letter,perspective,review,viewpoint,suppinfo}
2948 \setkeys{acs}{keywords = true}
2949 \SectionsOff
2950 %</ascefj>
2951 %<*amlccd>
2952 \ProvidesFile{achemso-amlccd.cfg}
2953 [2025-09-22 v3.14 achemso configuration: ACS Macro Lett.]
2954 \def\acs@type@list{letter,suppinfo}
2955 \SectionsOff
2956 \setlength{\acs@tocentry@height}{4cm}
2957 \setlength{\acs@tocentry@width}{8cm}
2958 %</amlccd>
2959 %<*amlcef>
2960 \ProvidesFile{achemso-amlcef.cfg}
2961 [2025-09-22 v3.14 achemso configuration: ACS Mater. Lett.]
2962 \def\acs@type@list{letter,perspective,review,viewpoint,focus}
2963 \SectionsOff
2964 %</amlcef>
2965 %<*amclct>
2966 \ProvidesFile{achemso-amclct.cfg}
2967 [2025-09-22 v3.14 achemso configuration: ACS Med. Chem. Lett.]
2968 \def\acs@type@list{article,letter,perspective,suppinfo}
2969 \SectionNumbersOff
2970 %</amclct>
2971 %<*amrcda>
2972 \ProvidesFile{achemso-amrcda.cfg}
2973 [2025-09-22 v3.14 achemso configuration: Acc. Mater. Res.]
2974 \def\acs@type@list{account,article,editorial,retraction,suppinfo}
2975 %</amrcda>
2976 %<*ancac3>
2977 \ProvidesFile{achemso-ancac3.cfg}
2978 [2025-09-22 v3.14 achemso configuration: ACS Nano]
2979 \setkeys{acs}{
2980 abbreviations = true,
2981 biblabel = fullstop,
2982 etalmode = truncate,
2983 maxauthors = 20,
2984 keywords = true
2985 }
2986 \def\acs@type@list{article,perspective,suppinfo}
2987 \newcommand*{\latin}[1]{\emph{#1}}
2988 \SectionNumbersOff
2989 %</ancac3>
2990 %<*anmafm>
2991 \ProvidesFile{achemso-anmafm.cfg}
2992 [2025-09-22 v3.14 achemso configuration: ACS Nano Med.]
2993 \setkeys{acs}{
2994 abbreviations = true,
2995 articletitle = true,
2996 biblabel = fullstop,
2997 etalmode = truncate,
2998 maxauthors = 20,
2999 keywords = true
3000 }
3001 \def\acs@type@list{editorial,viewpoint,perspective,review,article,suppinfo}
3002 %</anmafm>
3003 %<*acsodf>
3004 \ProvidesFile{achemso-acsodf.cfg}
3005 [2025-09-22 v3.14 achemso configuration: ACS Omega.]
3006 \def\acs@type@list{article}
3007 %</acsodf>
3008 %<*apchd5>
3009 \ProvidesFile{achemso-apchd5.cfg}
3010 [2025-09-22 v3.14 achemso configuration: ACS Photon.]
3011 \def\acs@type@list{article,letter,perspective,review,suppinfo}
3012 \setkeys{acs}{keywords = true}
3013 \ifx\acs@manuscript\acs@manuscript@letter
3014 \SectionNumbersOff
3015 \fi
3016 %</apchd5>
3017 %<*aidcbc>
3018 \ProvidesFile{achemso-aidcbc.cfg}
3019 [2025-09-22 v3.14 achemso configuration: ACS Sensors]
3020 \def\acs@type@list{article,letter,perspective,review,suppinfo}
3021 \setkeys{acs}{keywords = true}
3022 \SectionNumbersOff
3023 %</aidcbc>
3024 %<*ascecg>
3025 \ProvidesFile{achemso-ascecg.cfg}
3026 [2025-09-22 v3.14 achemso configuration: ACS Sustainable Chem Eng.]
3027 \setkeys{acs}{
3028 biblabel = fullstop,
3029 keywords = true
3030 }
3031 \SectionNumbersOff
3032 \def\acs@type@list{article,feature,letter,perspective,review,suppinfo}
3033 %</ascecg>
3034 %<*asbcd6>
3035 \ProvidesFile{achemso-asbcd6.cfg}
3036 [2025-09-22 v3.14 achemso configuration: ACS Synth. Biol.]
3037 \setkeys{acs}{
3038 abbreviations = true,
3039 biblabel = fullstop,
3040 biochem = true,
3041 keywords = true,
3042 super = false
3043 }
3044 \def\acs@type@list{article,letter,note,tutorial,review,suppinfo}
3045 %</asbcd6>
3046 %<*ancham>
3047 \ProvidesFile{achemso-ancham.cfg}
3048 [2025-09-22 v3.14 achemso configuration: Anal. Chem.]
3049 \def\acs@type@list{article,note,suppinfo}
3050 \SectionNumbersOff
3051 %</ancham>
3052 %<*bichaw>
3053 \ProvidesFile{achemso-bichaw.cfg}
3054 [2025-09-22 v3.14 achemso configuration: Biochemistry]
3055 \setkeys{acs}{
3056 abbreviations = true,
3057 biblabel = brackets,
3058 biochem = true,
3059 }
3060 \SectionNumbersOff
3061 \def\acs@maketitle@extras@hook{%
3062 \par
3063 \acs@title@short@print
3064 }
3065 \g@addto@macro{\maketitle}{\newpage}
3066 % \end{macrocode}
3067 %\begin{macro}{\acs@author@fnsymbol}
3068 % Some changes to do with footnotes: symbols are different and symbol
3069 % number one can only be used for the title.
3070 % \begin{macrocode}
3071 \def\acs@author@fnsymbol#1{%
3072 \ensuremath{%
3073 \ifcase #1 *\or
3074 \dagger\or
3075 \ddagger\or
3076 \S\or
3077 \parallel\or
3078 \perp\or
3079 \P\or
3080 \|\or
3081 \bot\or
3082 \#\or
3083 @\or
3084 \triangle\or
3085 \nabla\else
3086 #1%
3087 \fi
3088 }%
3089 }
3090 \def\@maketitle@title@hook{%
3091 \ifnum\acs@footnote@cnt>\@ne
3092 \else
3093 \global\acs@footnote@cnt\@ne
3094 \fi
3095 }
3096 % \end{macrocode}
3097 %\end{macro}
3098 % \begin{macrocode}
3099 %</bichaw>
3100 %<*bcches>
3101 \ProvidesFile{achemso-bcches.cfg}
3102 [2025-09-22 v3.14 achemso configuration: Bioconjugate Chem.]
3103 \setkeys{acs}{
3104 biochem = true,
3105 super = false
3106 }
3107 \SectionNumbersOff
3108 %</bcches>
3109 %<*bomaf6>
3110 \ProvidesFile{achemso-bomaf6.cfg}
3111 [2025-09-22 v3.14 achemso configuration: Biomacromolecules]
3112 \def\acs@type@list{article,comment,communication,note,review,suppinfo}
3113 \SectionNumbersOff
3114 \AtEndOfClass{\SectionsOn}
3115 %</bomaf6>
3116 %<*crtoec>
3117 \ProvidesFile{achemso-crtoec.cfg}
3118 [2025-09-22 v3.14 achemso configuration: Chem. Res. Toxicol.]
3119 \setkeys{acs}{
3120 abbreviations = true,
3121 biochem = true,
3122 keywords = true
3123 }
3124 \def\acs@maketitle@extras@hook{%
3125 \par
3126 \acs@title@short@print
3127 }
3128 \def\acs@type@list{%
3129 article,perspective,profile,review,suppinfo%
3130 }
3131 \SectionNumbersOff
3132 %</crtoec>
3133 %<*chreay>
3134 \ProvidesFile{achemso-chreay.cfg}
3135 [2025-09-22 v3.14 achemso configuration: Chem. Rev.]
3136 \setkeys{acs}{
3137 etalmode = truncate,
3138 maxauthors = 10
3139 }
3140 \def\acs@type@default{review}
3141 \def\acs@type@list{review}
3142 % \end{macrocode}
3143 % The references section is numbered in \emph{Chem.\ Rev.}
3144 % \begin{macrocode}
3145 \floatstyle{plaintop}
3146 \restylefloat{scheme}
3147 \floatstyle{plain}
3148 \def\bibsection{\acs@section{\refname}}
3149 %</chreay>
3150 %<*cmatex>
3151 % \begin{macrocode}
3152 \ProvidesFile{achemso-cmatex.cfg}
3153 [2025-09-22 v3.14 achemso configuration: Chem. Mater.]
3154 \setkeys{acs}{keywords = true}
3155 \SectionNumbersOff
3156 \ifx\acs@manuscript\acs@manuscript@communication
3157 \AbstractOff
3158 \SectionsOff
3159 \fi
3160 %</cmatex>
3161 %<*cgdefu>
3162 \ProvidesFile{achemso-cgdefu.cfg}
3163 [2025-09-22 v3.14 achemso configuration: Cryst. Growth Des.]
3164 \def\acs@type@list{%
3165 article,communication,perspective,suppinfo%
3166 }
3167 \SectionNumbersOff
3168 \ifx\acs@manuscript\acs@manuscript@communication
3169 \SectionsOff
3170 \fi
3171 \setlength{\acs@tocentry@height}{8.9 cm}
3172 \setlength{\acs@tocentry@width}{4.6 cm}
3173 %</cgdefu>
3174 %<*enfuem>
3175 \ProvidesFile{achemso-enfuem.cfg}
3176 [2025-09-22 v3.14 achemso configuration: Energy Fuels]
3177 \def\acs@type@list{article,review,suppinfo}
3178 \SectionNumbersOff
3179 %</enfuem>
3180 %<*esthag>
3181 \ProvidesFile{achemso-esthag.cfg}
3182 [2025-09-22 v3.14 achemso configuration: Environ. Sci. Technol.]
3183 \def\acs@type@list{article,feature,perspective,review,suppinfo}
3184 \SectionNumbersOff
3185 \setkeys{acs}{maxauthors = 0, keywords = true}
3186 %</esthag>
3187 %<*estlcu>
3188 \ProvidesFile{achemso-estlcu.cfg}
3189 [2025-09-22 v3.14 achemso configuration: Environ. Sci. Technol. Lett.]
3190 \def\acs@type@list{letter,review,suppinfo}
3191 \SectionNumbersOff
3192 %</estlcu>
3193 %<*iecred>
3194 \ProvidesFile{achemso-iecred.cfg}
3195 [2025-09-22 v3.14 achemso configuration: Ind. Eng. Chem. Res.]
3196 \setkeys{acs}{biblabel = brackets}
3197 \SectionNumbersOff
3198 %</iecred>
3199 %<*inoraj>
3200 \ProvidesFile{achemso-inoraj.cfg}
3201 [2025-09-22 v3.14 achemso configuration: Inorg. Chem.]
3202 \SectionNumbersOff
3203 \ifx\acs@manuscript\acs@manuscript@communication
3204 \AbstractOff
3205 \SectionsOff
3206 \fi
3207 \setkeys{acs}{doi = true}
3208 %</inoraj>
3209 %<*jaaucr>
3210 \ProvidesFile{achemso-jaaucr.cfg}
3211 [2025-09-22 v3.14 achemso configuration: JACS Au]
3212 \def\acs@type@list{spotlight,account,article,communication,letter,perspective,suppinfo}
3213 %</jaaucr>
3214 %<*jafcau>
3215 \ProvidesFile{achemso-jafcau.cfg}
3216 [2025-09-22 v3.14 achemso configuration: J. Agric. Food Chem.]
3217 \setkeys{acs}{keywords = true}
3218 \def\acs@type@list{article,suppinfo}
3219 \SectionNumbersOff
3220 %</jafcau>
3221 %<*jceda8>
3222 \ProvidesFile{achemso-jceda8.cfg}
3223 [2025-09-22 v3.14 achemso configuration: J. Chem. Ed.]
3224 \setkeys{acs}{keywords = true}
3225 \SectionNumbersOff
3226 \def\acs@type@list{article,suppinfo}
3227 \SectionNumbersOff
3228 %</jceda8>
3229 %<*jceaax>
3230 \ProvidesFile{achemso-jceaax.cfg}
3231 [2025-09-22 v3.14 achemso configuration: J. Chem. Eng. Data]
3232 \def\acs@type@list{article,suppinfo}
3233 \def\refname{Literature Cited}
3234 \SectionNumbersOff
3235 %</jceaax>
3236 %<*jcisd8>
3237 \ProvidesFile{achemso-jcisd8.cfg}
3238 [2025-09-22 v3.14 achemso configuration: J. Chem. Inf. Model.]
3239 \def\acs@type@list{article,suppinfo}
3240 \SectionNumbersOff
3241 %</jcisd8>
3242 %<*jctcce>
3243 \ProvidesFile{achemso-jctcce.cfg}
3244 [2025-09-22 v3.14 achemso configuration: J. Chem. Theory Comput.]
3245 \def\acs@type@list{article,suppinfo}
3246 \setkeys{acs}{maxauthors = 0}
3247 %</jctcce>
3248 %<*jmcmar>
3249 \ProvidesFile{achemso-jmcmar.cfg}
3250 [2025-09-22 v3.14 achemso configuration: J. Med. Chem.]
3251 \def\acs@type@list{article,letter,perspective,suppinfo}
3252 \SectionNumbersOff
3253 \setlength{\acs@tocentry@height}{4.45cm}
3254 \setlength{\acs@tocentry@width}{8.25cm}
3255 %</jmcmar>
3256 %<*jnprdf>
3257 \ProvidesFile{achemso-jnprdf.cfg}
3258 [2025-09-22 v3.14 achemso configuration: J. Nat. Prod.]
3259 \renewcommand*{\abstractname}{ABSTRACT}
3260 \renewcommand*{\acknowledgementname}{ACKNOWLEDGEMENT}
3261 \renewcommand*{\suppinfoname}{ASSOCIATED CONTENT}
3262 \SectionNumbersOff
3263 \renewcommand*{\acs@abstract}{%
3264 \quotation
3265 \textbf{\abstractname :}%
3266 }
3267 \AbstractOn
3268 \ifx\acs@manuscript\acs@manuscript@communication
3269 \AbstractOff
3270 \SectionsOff
3271 \fi
3272 \def\refname{REFERENCES}
3273 \captionsetup{
3274 labelfont = bf,
3275 labelsep = period
3276 }
3277 %</jnprdf>
3278 %<*joceah>
3279 \ProvidesFile{achemso-joceah.cfg}
3280 [2025-09-22 v3.14 achemso configuration: J. Org. Chem.]
3281 \ifx\acs@manuscript\acs@manuscript@communication
3282 \AbstractOff
3283 \SectionsOff
3284 \fi
3285 \floatstyle{plaintop}
3286 \restylefloat{scheme}
3287 \floatstyle{plain}
3288 \renewcommand*\acs@type@list{article,communication,note,perspective,review,suppinfo}
3289 %</joceah>
3290 % \end{macrocode}
3291 % \begin{macrocode}
3292 %<*jpcafh>
3293 \ProvidesFile{achemso-jpcafh.cfg}
3294 [2025-09-22 v3.14 achemso configuration: J. Phys. Chem. A]
3295 \def\acs@type@list{article,suppinfo}
3296 \setkeys{acs}{
3297 etalmode = truncate,
3298 maxauthors = 10
3299 }
3300 \SectionNumbersOff
3301 \captionsetup[table]{labelfont=bf,textfont=bf}
3302 % \end{macrocode}
3303 % Title
3304 % \begin{macrocode}
3305 \g@addto@macro{\maketitle}{\newpage}
3306 %</jpcafh>
3307 %<*jpcbfk>
3308 \ProvidesFile{achemso-jpcbfk.cfg}
3309 [2025-09-22 v3.14 achemso configuration: J. Phys. Chem. B]
3310 \def\acs@type@list{article,suppinfo}
3311 \setkeys{acs}{
3312 etalmode = truncate,
3313 maxauthors = 10
3314 }
3315 \SectionNumbersOff
3316 \captionsetup[table]{labelfont=bf,textfont=bf}
3317 \g@addto@macro{\maketitle}{\newpage}
3318 %</jpcbfk>
3319 %<*jpccck>
3320 \ProvidesFile{achemso-jpccck.cfg}
3321 [2025-09-22 v3.14 achemso configuration: J. Phys. Chem. C]
3322 \def\acs@type@list{article,suppinfo}
3323 \setkeys{acs}{
3324 etalmode = truncate,
3325 maxauthors = 10
3326 }
3327 \SectionNumbersOff
3328 \captionsetup[table]{labelfont=bf,textfont=bf}
3329 \g@addto@macro{\maketitle}{\newpage}
3330 %</jpccck>
3331 % \end{macrocode}
3332 % \begin{macrocode}
3333 %<*jpclcd>
3334 \ProvidesFile{achemso-jpclcd.cfg}
3335 [2025-09-22 v3.14 achemso configuration: J. Phys. Chem. Lett.]
3336 \setkeys{acs}{
3337 etalmode = truncate,
3338 maxauthors = 10
3339 }
3340 \def\acs@type@default{letter}
3341 \def\acs@type@list{letter}
3342 \SectionNumbersOff
3343 \captionsetup[table]{labelfont=bf,textfont=bf}
3344 \g@addto@macro{\maketitle}{\newpage}
3345 \renewcommand{\acs@tocentry@print}[1]{%
3346 \gdef\acs@tocentry@text{#1}%
3347 }
3348 \renewcommand*{\acs@abstract@extras}{%
3349 \begingroup
3350 \acs@tocentry@print@aux
3351 \endgroup
3352 \acs@keywords@print
3353 \newpage
3354 }
3355 \setlength\acs@tocentry@height{2in}
3356 \setlength\acs@tocentry@width{2in}
3357 %</jpclcd>
3358 %<*jprobs>
3359 \ProvidesFile{achemso-jprobs.cfg}
3360 [2025-09-22 v3.14 achemso configuration: J. Proteome Res.]
3361 \setkeys{acs}{keywords = true}
3362 \def\acs@type@list{article,review,suppinfo}
3363 \SectionNumbersOff
3364 %</jprobs>
3365 % \end{macrocode}
3366 % The \emph{J.~Am.\ Chem.\ Soc.}~configuration is rather more
3367 % complicated as there is the need to construct a ``galley-like''
3368 % layout for communications.
3369 % \begin{macrocode}
3370 %<*jacsat>
3371 \ProvidesFile{achemso-jacsat.cfg}
3372 [2025-09-22 v3.14 achemso configuration: J. Am. Chem. Soc.]
3373 \SectionNumbersOff
3374 \ifx\acs@manuscript\acs@manuscript@communication\else
3375 \expandafter\endinput
3376 \fi
3377 % \end{macrocode}
3378 % Everything from here onward applies only to communications. Some
3379 % adjustments are now made using the existing tools.
3380 % \begin{macrocode}
3381 \setkeys{acs}{
3382 email = true,
3383 layout = twocolumn
3384 }
3385 \SectionsOff
3386 \acs@layout@nine
3387 % \end{macrocode}
3388 %
3389 %\begin{environment}{abstract}
3390 % The abstract appears at the start of the document, with lines around
3391 % it.s
3392 % \begin{macrocode}
3393 \renewenvironment{abstract}{%
3394 \hrule
3395 \vspace{2 mm}%
3396 \sffamily
3397 \noindent
3398 \emph{\textbf{Abstract:}}%
3399 }{%
3400 \vspace{2 mm}%
3401 \hrule
3402 \vspace{6 mm}%
3403 }
3404 % \end{macrocode}
3405 %\end{environment}
3406 %
3407 %\begin{macro}{\acksize}
3408 %\begin{macro}{\affilsize}
3409 %\begin{macro}{\authorsize}
3410 %\begin{macro}{\emailsize}
3411 %\begin{macro}{\capsize}
3412 %\begin{macro}{\refsize}
3413 %\begin{macro}{\suppsize}
3414 %\begin{macro}{\titlesize}
3415 % To keep things logical, the size macros are given names related to
3416 % their function. Some of these are new, some are defined in the class.
3417 % \begin{macrocode}
3418 \def\affilsize{%
3419 \@setfontsize\affilsize\@ixpt\@xpt
3420 }
3421 \def\acksize{%
3422 \@setfontsize\acksize\@ixpt\@xipt
3423 }
3424 \def\authorsize{%
3425 \@setfontsize\authorsize{10.5}{12.5}%
3426 }
3427 \newcommand*\capsize{%
3428 \@setfontsize\capsize\@viiipt\@ixpt
3429 }
3430 \def\emailsize{%
3431 \@setfontsize\emailsize\@viiipt{15}%
3432 }
3433 \newcommand*\refsize{%
3434 \@setfontsize\refsize{7.5}{7.5}%
3435 }
3436 \def\suppsize{%
3437 \@setfontsize\suppsize{8.5}{10.5}%
3438 }
3439 \def\titlesize{%
3440 \@setfontsize\titlesize\@xiipt{13}%
3441 }
3442 \let\footnotesize\refsize
3443 \let\captionfont\capsize
3444 % \end{macrocode}
3445 %\end{macro}
3446 %\end{macro}
3447 %\end{macro}
3448 %\end{macro}
3449 %\end{macro}
3450 %\end{macro}
3451 %\end{macro}
3452 %\end{macro}
3453 %\begin{macro}{\emailfont}
3454 % A slight font change.
3455 % \begin{macrocode}
3456 \def\emailfont{\sffamily}
3457 % \end{macrocode}
3458 %\end{macro}
3459 %\begin{macro}{\ps@plain}
3460 %\begin{macro}{\ps@jacs}
3461 % The header styles are done the hard way, to keep down the number of
3462 % packages loaded.
3463 % \begin{macrocode}
3464 \def\ps@plain{%
3465 \let\@mkboth\@gobbletwo
3466 \let\@oddhead\@empty
3467 \def\@oddfoot{%
3468 \reset@font
3469 \sffamily
3470 \textbf{\thepage}%
3471 \hfil
3472 }%
3473 \let\@evenhead\@empty
3474 \let\@evenfoot\@oddfoot
3475 }
3476 \def\ps@acs{%
3477 \def\@oddfoot{%
3478 \reset@font
3479 \sffamily
3480 \textbf{\thepage}%
3481 \hfil
3482 }%
3483 \def\@evenfoot{%
3484 \reset@font
3485 \hfil
3486 \sffamily
3487 \textbf{\thepage}%
3488 }%
3489 \def\@oddhead{}%
3490 \let\@evenhead\@oddhead
3491 }
3492 \pagestyle{acs}
3493 % \end{macrocode}
3494 %\end{macro}
3495 %\end{macro}
3496 %\begin{macro}{\acs@space@pre@title}
3497 %\begin{macro}{\acs@space@post@title}
3498 %\begin{macro}{\acs@space@post@author}
3499 %\begin{macro}{\acs@space@post@address}
3500 %\begin{macro}{\acs@space@post@email}
3501 % Length adjustments for the title.
3502 % \begin{macrocode}
3503 \setlength\acs@space@pre@title{16mm}
3504 \setlength\acs@space@post@title{0mm}
3505 \setlength\acs@space@post@author{0mm}
3506 \setlength\acs@space@post@address{0mm}
3507 \setlength\acs@space@post@email{-1mm}
3508 \setlength\acs@maketitle@width{152.4mm}
3509 % \end{macrocode}
3510 %\end{macro}
3511 %\end{macro}
3512 %\end{macro}
3513 %\end{macro}
3514 %\end{macro}
3515 %\begin{macro}{\acs@contact@details}
3516 % Contact details are different here.
3517 % \begin{macrocode}
3518 \def\acs@contact@details{%
3519 Received \today; E-mail: \acs@email@list
3520 }
3521 % \end{macrocode}
3522 %\end{macro}
3523 %\begin{macro}{\acs@maketitle@extras}
3524 % No keywords or abbreviations for \emph{J.~Am.\ Chem.\ Soc.}.
3525 % \begin{macrocode}
3526 \let\acs@maketitle@extras\relax
3527 % \end{macrocode}
3528 %\end{macro}
3529 % Getting the floats correct is a difficult task ``by hand''; using
3530 % the \pkg{caption} package makes this a lot easier.
3531 % \begin{macrocode}
3532 \floatstyle{plaintop}
3533 \restylefloat{scheme}
3534 \floatstyle{plain}
3535 \DeclareCaptionLabelSeparator{perquad}{.\quad}
3536 \captionsetup{
3537 singlelinecheck = off,
3538 labelfont = {bf,it,sf},
3539 textfont = sf,
3540 labelsep = perquad
3541 }
3542 \captionsetup[figure]{textfont=rm}
3543 % \end{macrocode}
3544 %\begin{macro}{\acs@table}
3545 %\begin{macro}{\table}
3546 % A patch or \cs{table}.
3547 % \begin{macrocode}
3548 \newcommand*\acs@table{}
3549 \let\acs@table\table
3550 \def\table{%
3551 \capsize
3552 \acs@table
3553 }
3554 % \end{macrocode}
3555 %\end{macro}
3556 %\end{macro}
3557 % The bibliography has to be adjusted.
3558 % \begin{macrocode}
3559 \AtBeginDocument{%
3560 \def\bibsection{%
3561 \@startsection
3562 {section}
3563 {1}
3564 {\z@}{\z@}{2.5mm}%
3565 {\normalfont\acksize\bfseries}
3566 {\hrule\nobreak\vspace{1.2mm}\noindent\refname}%
3567 }%
3568 \let\bibfont\refsize
3569 \setlength{\bibhang}{0.61cm}%
3570 \setlength{\bibsep}{0mm}%
3571 }
3572 %</jacsat>
3573 %<*langd5>
3574 \ProvidesFile{achemso-langd5.cfg}
3575 [2025-09-22 v3.14 achemso configuration: Langmuir]
3576 \def\acs@type@list{article,letter,suppinfo}
3577 \SectionNumbersOff
3578 %</langd5>
3579 %<*mamobx>
3580 \ProvidesFile{achemso-mamobx.cfg}
3581 [2025-09-22 v3.14 achemso configuration: Macromolecules]
3582 \SectionNumbersOff
3583 \setkeys{acs}{doi = true}
3584 %</mamobx>
3585 %<*mpohbp>
3586 \ProvidesFile{achemso-mpohbp.cfg}
3587 [2025-09-22 v3.14 achemso configuration: Mol. Pharm.]
3588 \setkeys{acs}{keywords = true}
3589 \def\acs@type@list{article,suppinfo}
3590 \SectionNumbersOff
3591 %</mpohbp>
3592 %<*nalefd>
3593 \ProvidesFile{achemso-nalefd.cfg}
3594 [2025-09-22 v3.14 achemso configuration: Nano Lett.]
3595 \setkeys{acs}{keywords = true}
3596 \def\acs@type@default{letter}
3597 \def\acs@type@list{letter}
3598 \SectionNumbersOff
3599 %</nalefd>
3600 %<*orlef7>
3601 \ProvidesFile{achemso-orlef7.cfg}
3602 [2025-09-22 v3.14 achemso configuration: Org. Lett.]
3603 \def\acs@type@default{communication}
3604 \def\acs@type@list{communication}
3605 \SectionNumbersOff
3606 \setkeys{acs}{layout = twocolumn}
3607 \RequirePackage{xcolor}
3608 \definecolor{orglett}{RGB}{128,0,0}
3609 %</orlef7>
3610 %<*oprdfk>
3611 \ProvidesFile{achemso-oprdfk.cfg}
3612 [2025-09-22 v3.14 achemso configuration: Org. Proc. Res. Dev.]
3613 \def\acs@type@list{article,highlight,review,suppinfo}
3614 \SectionNumbersOff
3615 %</oprdfk>
3616 %<*orgnd7>
3617 \ProvidesFile{achemso-orgnd7.cfg}
3618 [2025-09-22 v3.14 achemso configuration: Organometallics]
3619 \SectionNumbersOff
3620 %</orgnd7>
3621 % \end{macrocode}
3622 %
3623 %\Finale
3624 %
3625 %\iffalse
3626 %<*bst>
3627 % Database entries
3628
3629 ENTRY
3630 {
3631 address
3632 author
3633 booktitle
3634 chapter
3635 ctrl-article-title
3636 ctrl-chapter-title
3637 ctrl-doi
3638 ctrl-etal-firstonly
3639 ctrl-etal-number
3640 ctrl-use-title
3641 doi
3642 edition
3643 editor
3644 howpublished
3645 institution
3646 journal
3647 key
3648 maintitle
3649 note
3650 number
3651 organization
3652 pages
3653 publisher
3654 school
3655 series
3656 title
3657 type
3658 url
3659 version
3660 volume
3661 year
3662 }
3663 { }
3664 {
3665 label
3666 short.names
3667 }
3668
3669 % Generic logic functions, from the core BibTeX styles
3670
3671 FUNCTION { and } {
3672 { }
3673 {
3674 pop$
3675 #0
3676 }
3677 if$
3678 }
3679
3680 FUNCTION { not } {
3681 { #0 }
3682 { #1 }
3683 if$
3684 }
3685
3686 FUNCTION { or } {
3687 {
3688 pop$
3689 #1
3690 }
3691 { }
3692 if$
3693 }
3694
3695 FUNCTION { xor } {
3696 { not }
3697 { }
3698 if$
3699 }
3700
3701 % Generic functions for basic manipulations: many of these
3702 % come from the core BibTeX styles or 'Tame the BeaST'
3703
3704 FUNCTION { chr.to.value.error } {
3705 #48 +
3706 int.to.chr$
3707 "'" swap$ *
3708 "'" *
3709 " is not a number: treated as zero." *
3710 warning$
3711 #0
3712 }
3713
3714 FUNCTION { chr.to.value } {
3715 chr.to.int$ #48 -
3716 duplicate$
3717 #0 <
3718 { chr.to.value.error }
3719 {
3720 duplicate$
3721 #9 >
3722 { chr.to.value.error }
3723 { }
3724 if$
3725 }
3726 if$
3727 }
3728
3729 STRINGS {
3730 extract.input.str
3731 extract.output.str
3732 }
3733
3734 FUNCTION { is.a.digit } {
3735 duplicate$
3736 "" =
3737 {
3738 pop$
3739 #0
3740 }
3741 {
3742 chr.to.int$
3743 #48 -
3744 duplicate$
3745 #0 < swap$ #9 > or not
3746 }
3747 if$
3748 }
3749
3750 FUNCTION{ is.a.number } {
3751 {
3752 duplicate$
3753 #1 #1 substring$
3754 is.a.digit
3755 }
3756 { #2 global.max$ substring$ }
3757 while$
3758 "" =
3759 }
3760
3761 FUNCTION { extract.number } {
3762 duplicate$
3763 'extract.input.str :=
3764 "" 'extract.output.str :=
3765 { extract.input.str empty$ not }
3766 {
3767 extract.input.str #1 #1 substring$
3768 extract.input.str #2 global.max$ substring$ 'extract.input.str :=
3769 duplicate$
3770 is.a.number
3771 { extract.output.str swap$ * 'extract.output.str := }
3772 {
3773 pop$
3774 "" 'extract.input.str :=
3775 }
3776 if$
3777 }
3778 while$
3779 extract.output.str empty$
3780 { }
3781 {
3782 pop$
3783 extract.output.str
3784 }
3785 if$
3786 }
3787
3788 FUNCTION { field.or.null } {
3789 duplicate$
3790 empty$
3791 {
3792 pop$
3793 ""
3794 }
3795 { }
3796 if$
3797 }
3798
3799 INTEGERS {
3800 multiply.a.int
3801 multiply.b.int
3802 }
3803
3804 FUNCTION { multiply } {
3805 'multiply.a.int :=
3806 'multiply.b.int :=
3807 multiply.b.int #0 <
3808 {
3809 #-1
3810 #0 multiply.b.int - 'multiply.b.int :=
3811 }
3812 { #1 }
3813 if$
3814 #0
3815 { multiply.b.int #0 > }
3816 {
3817 multiply.a.int +
3818 multiply.b.int #1 - 'multiply.b.int :=
3819 }
3820 while$
3821 swap$
3822 { }
3823 { #0 swap$ - }
3824 if$
3825 }
3826
3827 INTEGERS { str.conversion.int }
3828
3829 FUNCTION { str.to.int.aux.ii } {
3830 {
3831 duplicate$
3832 empty$ not
3833 }
3834 {
3835 swap$
3836 #10 multiply 'str.conversion.int :=
3837 duplicate$
3838 #1 #1 substring$
3839 chr.to.value
3840 str.conversion.int +
3841 swap$
3842 #2 global.max$ substring$
3843 }
3844 while$
3845 pop$
3846 }
3847
3848 FUNCTION { str.to.int.aux.i } {
3849 duplicate$
3850 #1 #1 substring$
3851 "-" =
3852 {
3853 #1 swap$
3854 #2 global.max$ substring$
3855 }
3856 {
3857 #0 swap$
3858 }
3859 if$
3860 #0
3861 swap$
3862 str.to.int.aux.ii
3863 swap$
3864 { #0 swap$ - }
3865 { }
3866 if$
3867 }
3868
3869 FUNCTION { str.to.int } {
3870 duplicate$
3871 empty$
3872 {
3873 pop$
3874 #0
3875 }
3876 { str.to.int.aux.i }
3877 if$
3878 }
3879
3880 FUNCTION { tie.or.space.connect } {
3881 duplicate$
3882 text.length$ #3 <
3883 { "~" }
3884 { " " }
3885 if$
3886 swap$ * *
3887 }
3888
3889 FUNCTION { yes.no.to.bool } {
3890 duplicate$
3891 empty$
3892 {
3893 pop$
3894 #0
3895 }
3896 {
3897 "l" change.case$
3898 "yes" =
3899 { #1 }
3900 { #0 }
3901 if$
3902 }
3903 if$
3904 }
3905
3906 % Functions of formatting
3907
3908 FUNCTION { bold } {
3909 duplicate$
3910 empty$
3911 {
3912 pop$
3913 ""
3914 }
3915 { "\textbf{" swap$ * "}" * }
3916 if$
3917 }
3918
3919 FUNCTION { emph } {
3920 duplicate$
3921 empty$
3922 {
3923 pop$
3924 ""
3925 }
3926 { "\emph{" swap$ * "}" * }
3927 if$
3928 }
3929
3930
3931 FUNCTION { paren } {
3932 duplicate$
3933 empty$
3934 {
3935 pop$
3936 ""
3937 }
3938 { "(" swap$ * ")" * }
3939 if$
3940 }
3941
3942 % Functions for punctuation
3943
3944 FUNCTION { add.comma } { ", " * }
3945
3946 FUNCTION { add.colon } { ": " * }
3947
3948 FUNCTION { add.period } { add.period$ " " * }
3949
3950 FUNCTION { add.semicolon } { "; " * }
3951
3952 FUNCTION { add.space } { " " * }
3953
3954 % Bibliography strings: fixed values collected into functions
3955
3956 FUNCTION { bbl.and } { "and" }
3957
3958 FUNCTION { bbl.chapter } { "Chapter" }
3959
3960 FUNCTION { bbl.doi } { "DOI:" }
3961
3962 FUNCTION { bbl.editor } { "Ed." }
3963
3964 FUNCTION { bbl.editors } { "Eds." }
3965
3966 FUNCTION { bbl.edition } { "ed." }
3967
3968 FUNCTION { bbl.etal } { "\latin{et~al.}" }
3969
3970 FUNCTION { bbl.in } { "In" }
3971
3972 FUNCTION { bbl.inpress } { "in press" }
3973
3974 FUNCTION { bbl.msc } { "M.Sc.\ thesis" }
3975
3976 FUNCTION { bbl.page } { "p" }
3977
3978 FUNCTION { bbl.pages } { "pp" }
3979
3980 FUNCTION { bbl.phd } { "Ph.D.\ thesis" }
3981
3982 FUNCTION { bbl.version } { "version" }
3983
3984 FUNCTION { bbl.volume } { "Vol." }
3985
3986 % Functions for number formatting
3987
3988 STRINGS { pages.str }
3989
3990 FUNCTION { hyphen.to.dash } {
3991 'pages.str :=
3992 ""
3993 { pages.str empty$ not }
3994 {
3995 pages.str #1 #1 substring$
3996 "-" =
3997 {
3998 "--" *
3999 {
4000 pages.str #1 #1 substring$
4001 "-" =
4002 }
4003 { pages.str #2 global.max$ substring$ 'pages.str := }
4004 while$
4005 }
4006 {
4007 pages.str #1 #1 substring$
4008 *
4009 pages.str #2 global.max$ substring$ 'pages.str :=
4010 }
4011 if$
4012 }
4013 while$
4014 }
4015
4016 INTEGERS { multiresult.bool }
4017
4018 FUNCTION { multi.page.check } {
4019 'pages.str :=
4020 #0 'multiresult.bool :=
4021 {
4022 multiresult.bool not
4023 pages.str empty$ not
4024 and
4025 }
4026 {
4027 pages.str #1 #1 substring$
4028 duplicate$
4029 "-" = swap$ duplicate$
4030 "," = swap$
4031 "+" =
4032 or or
4033 { #1 'multiresult.bool := }
4034 { pages.str #2 global.max$ substring$ 'pages.str := }
4035 if$
4036 }
4037 while$
4038 multiresult.bool
4039 }
4040
4041 % Functions for calculating the label data needed by natbib
4042
4043
4044 INTEGERS {
4045 current.name.int
4046 names.separate.comma
4047 names.separate.semicolon
4048 names.separate.comma.bool
4049 remaining.names.int
4050 total.names.int
4051 }
4052
4053 STRINGS {
4054 current.name.str
4055 names.str
4056 }
4057
4058 FUNCTION { full.format.names } {
4059 'names.str :=
4060 #1 'current.name.int :=
4061 names.str num.names$ 'remaining.names.int :=
4062 { remaining.names.int #0 > }
4063 {
4064 names.str current.name.int "{vv~}{ll}" format.name$
4065 current.name.int #1 >
4066 {
4067 swap$ add.comma swap$
4068 remaining.names.int #1 >
4069 { }
4070 {
4071 duplicate$
4072 "others" =
4073 { bbl.etal }
4074 { bbl.and }
4075 if$
4076 add.space swap$ *
4077 }
4078 if$
4079 *
4080 }
4081 { }
4082 if$
4083 remaining.names.int #1 - 'remaining.names.int :=
4084 current.name.int #1 + 'current.name.int :=
4085 }
4086 while$
4087 }
4088
4089 FUNCTION { full.author } {
4090 author empty$
4091 { "" }
4092 { author full.format.names }
4093 if$
4094 }
4095
4096 FUNCTION { full.author.editor } {
4097 author empty$
4098 {
4099 editor empty$
4100 { "" }
4101 { editor full.format.names }
4102 if$
4103 }
4104 { author full.format.names }
4105 if$
4106 }
4107
4108 FUNCTION { full.editor } {
4109 editor empty$
4110 { "" }
4111 { editor full.format.names }
4112 if$
4113 }
4114
4115 FUNCTION { short.format.names } {
4116 'names.str :=
4117 names.str #1 "{vv~}{ll}" format.name$
4118 names.str num.names$
4119 duplicate$
4120 #2 >
4121 {
4122 pop$
4123 add.space bbl.etal *
4124 }
4125 {
4126 #2 <
4127 { }
4128 {
4129 names.str #2 "{ff }{vv }{ll}{ jj}" format.name$
4130 "others" =
4131 { add.space bbl.etal * }
4132 {
4133 add.space
4134 bbl.and add.space
4135 *
4136 names.str #2 "{vv~}{ll}" format.name$
4137 *
4138 }
4139 if$
4140 }
4141 if$
4142 }
4143 if$
4144 }
4145
4146 FUNCTION { short.author.key } {
4147 author empty$
4148 {
4149 key empty$
4150 { cite$ #1 #3 substring$ }
4151 { key }
4152 if$
4153 }
4154 { author short.format.names }
4155 if$
4156 }
4157
4158 FUNCTION { short.author.editor.key } {
4159 author empty$
4160 {
4161 editor empty$
4162 {
4163 key empty$
4164 { cite$ #1 #3 substring$ }
4165 { key }
4166 if$
4167 }
4168 { editor short.format.names }
4169 if$
4170 }
4171 { author short.format.names }
4172 if$
4173 }
4174
4175 FUNCTION { short.author.key.organization } {
4176 author empty$
4177 {
4178 key empty$
4179 {
4180 organization empty$
4181 { cite$ #1 #3 substring$ }
4182 {
4183 organization #1 #4 substring$
4184 "The " =
4185 { organization }
4186 { organization #5 global.max$ substring$ }
4187 if$
4188 #3 text.prefix$
4189 }
4190 if$
4191 }
4192 { key }
4193 if$
4194 }
4195 { author short.format.names }
4196 if$
4197 }
4198
4199 FUNCTION { short.editor.key.organization } {
4200 editor empty$
4201 {
4202 key empty$
4203 {
4204 organization empty$
4205 { cite$ #1 #3 substring$ }
4206 {
4207 organization #1 #4 substring$
4208 "The " =
4209 { organization }
4210 { organization #5 global.max$ substring$ }
4211 if$
4212 #3 text.prefix$
4213 }
4214 if$
4215 }
4216 { key }
4217 if$
4218 }
4219 { editor short.format.names }
4220 if$
4221 }
4222
4223 FUNCTION { calculate.full.names } {
4224 type$ "book" =
4225 type$ "inbook" =
4226 or
4227 { full.author.editor }
4228 {
4229 type$ "proceedings" =
4230 { full.editor }
4231 { full.author }
4232 if$
4233 }
4234 if$
4235 }
4236
4237 FUNCTION { calculate.short.names } {
4238 type$ "book" =
4239 type$ "inbook" =
4240 or
4241 { short.author.editor.key }
4242 {
4243 type$ "proceedings" =
4244 { short.editor.key.organization }
4245 {
4246 type$ "manual" =
4247 { short.author.key.organization }
4248 { short.author.key }
4249 if$
4250 }
4251 if$
4252 }
4253 if$
4254 'short.names :=
4255 }
4256
4257 FUNCTION { calculate.names } {
4258 calculate.short.names
4259 short.names
4260 year empty$
4261 { "()" }
4262 { "(" year * ")" * }
4263 if$
4264 *
4265 'label :=
4266 }
4267
4268 % Counting up the number of entries
4269
4270 INTEGERS { entries.int }
4271
4272 FUNCTION { initialize.count.entries } {
4273 #0 'entries.int :=
4274 }
4275
4276 FUNCTION { count.entries } {
4277 entries.int #1 + 'entries.int :=
4278 }
4279
4280 % Start and end of bibliography functions
4281
4282 FUNCTION { begin.bib } {
4283 "achemso 2025-09-22 v3.14" top$
4284 preamble$ empty$
4285 { }
4286 {
4287 preamble$ write$
4288 newline$
4289 }
4290 if$
4291 "\providecommand{\latin}[1]{#1}" write$
4292 newline$
4293 "\makeatletter" write$
4294 newline$
4295 "\providecommand{\doi}" write$
4296 newline$
4297 " {\begingroup\let\do\@makeother\dospecials" write$
4298 newline$
4299 " \catcode`\{=1 \catcode`\}=2 \doi@aux}" write$
4300 newline$
4301 "\providecommand{\doi@aux}[1]{\endgroup\texttt{#1}}" write$
4302 newline$
4303 "\makeatother" write$
4304 newline$
4305 "\providecommand*\mcitethebibliography{\thebibliography}" write$
4306 newline$
4307 "\csname @ifundefined\endcsname{endmcitethebibliography}" write$
4308 " {\let\endmcitethebibliography\endthebibliography}{}" write$
4309 newline$
4310 "\begin{mcitethebibliography}{"
4311 entries.int int.to.str$ * "}" * write$
4312 newline$
4313 "\providecommand*\natexlab[1]{#1}" write$
4314 newline$
4315 "\providecommand*\mciteSetBstSublistMode[1]{}" write$
4316 newline$
4317 "\providecommand*\mciteSetBstMaxWidthForm[2]{}" write$
4318 newline$
4319 "\providecommand*\mciteBstWouldAddEndPuncttrue" write$
4320 newline$
4321 " {\def\EndOfBibitem{\unskip.}}" write$
4322 newline$
4323 "\providecommand*\mciteBstWouldAddEndPunctfalse" write$
4324 newline$
4325 " {\let\EndOfBibitem\relax}" write$
4326 newline$
4327 "\providecommand*\mciteSetBstMidEndSepPunct[3]{}" write$
4328 newline$
4329 "\providecommand*\mciteSetBstSublistLabelBeginEnd[3]{}" write$
4330 newline$
4331 "\providecommand*\EndOfBibitem{}" write$
4332 newline$
4333 "\mciteSetBstSublistMode{f}" write$
4334 newline$
4335 "\mciteSetBstMaxWidthForm{subitem}{(\alph{mcitesubitemcount})}" write$
4336 newline$
4337 "\mciteSetBstSublistLabelBeginEnd" write$
4338 newline$
4339 " {\mcitemaxwidthsubitemform\space}" write$
4340 newline$
4341 " {\relax}" write$
4342 newline$
4343 " {\relax}" write$
4344 newline$
4345 }
4346
4347 FUNCTION { end.bib } {
4348 newline$
4349 "\end{mcitethebibliography}" write$
4350 newline$
4351 }
4352
4353 % Functions used for the special "control" entry type, to pass data
4354 % from LaTeX to BibTeX
4355
4356 INTEGERS {
4357 ctrl.article.title.bool
4358 ctrl.chapter.title.bool
4359 ctrl.doi.bool
4360 ctrl.etal.firstonly.bool
4361 ctrl.etal.number.int
4362 }
4363
4364 FUNCTION { initialize.control.values } {
4365 #1 'ctrl.article.title.bool :=
4366 #0 'ctrl.chapter.title.bool :=
4367 #0 'ctrl.doi.bool :=
4368 #1 'ctrl.etal.firstonly.bool :=
4369 #15 'ctrl.etal.number.int :=
4370 }
4371
4372 FUNCTION { control } {
4373 ctrl-article-title yes.no.to.bool 'ctrl.article.title.bool :=
4374 ctrl-chapter-title yes.no.to.bool 'ctrl.chapter.title.bool :=
4375 ctrl-doi yes.no.to.bool 'ctrl.doi.bool :=
4376 ctrl-etal-firstonly yes.no.to.bool 'ctrl.etal.firstonly.bool :=
4377 ctrl-etal-number str.to.int 'ctrl.etal.number.int :=
4378 ctrl-use-title empty$
4379 'skip$
4380 { ctrl-use-title yes.no.to.bool 'ctrl.article.title.bool := }
4381 if$
4382 }
4383
4384 % Functions of each bibitem: tracking punctuation and transferring
4385 % items to the .bbl file
4386
4387 INTEGERS {
4388 next.punct.comma
4389 next.punct.period
4390 next.punct.semicolon
4391 next.punct.space
4392 }
4393
4394 FUNCTION { initialize.tracker } {
4395 #0 'next.punct.comma :=
4396 #1 'next.punct.period :=
4397 #2 'next.punct.semicolon :=
4398 #3 'next.punct.space :=
4399 }
4400
4401 INTEGERS { next.punct.int }
4402
4403 FUNCTION { output } {
4404 swap$
4405 duplicate$ empty$
4406 { pop$ }
4407 {
4408 next.punct.int next.punct.space =
4409 { add.space }
4410 {
4411 next.punct.int next.punct.comma =
4412 { add.comma }
4413 {
4414 next.punct.int next.punct.semicolon =
4415 { add.semicolon }
4416 { add.period }
4417 if$
4418 }
4419 if$
4420 }
4421 if$
4422 write$
4423 }
4424 if$
4425 next.punct.comma 'next.punct.int :=
4426 }
4427
4428 % Functions for each bibliography entry: start and finish
4429
4430 FUNCTION { begin.bibitem } {
4431 newline$
4432 "\bibitem" write$
4433 label
4434 calculate.full.names
4435 duplicate$
4436 short.names =
4437 { pop$ }
4438 { * }
4439 if$
4440 "[" swap$ * "]" * write$
4441 "{" cite$ * "}" * write$
4442 newline$
4443 ""
4444 next.punct.comma 'next.punct.int :=
4445 }
4446
4447 INTEGERS { add.period.length.int }
4448
4449 FUNCTION { would.add.period } {
4450 duplicate$
4451 add.period$
4452 text.length$ 'add.period.length.int :=
4453 duplicate$
4454 text.length$
4455 add.period.length.int =
4456 { #0 }
4457 { #1 }
4458 if$
4459 }
4460
4461 FUNCTION { end.bibitem } {
4462 would.add.period
4463 {
4464 "\relax" * write$
4465 newline$
4466 "\mciteBstWouldAddEndPuncttrue" write$
4467 newline$
4468 "\mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct}" write$
4469 newline$
4470 "{\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax"
4471 }
4472 {
4473 "\relax" * write$
4474 newline$
4475 "\mciteBstWouldAddEndPunctfalse" write$
4476 newline$
4477 "\mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct}" write$
4478 newline$
4479 "{}{\mcitedefaultseppunct}\relax"
4480 }
4481 if$
4482 write$
4483 newline$
4484 "\EndOfBibitem" write$
4485 }
4486
4487 % Formatting names: authors and editors are not quite the same,
4488 % and there is the question of how to handle 'et al.'
4489
4490 FUNCTION { initialize.name.separator } {
4491 #1 'names.separate.comma :=
4492 #0 'names.separate.semicolon :=
4493 }
4494
4495 FUNCTION { format.names.loop } {
4496 { remaining.names.int #0 > }
4497 {
4498 names.str current.name.int "{vv~}{ll}{,~f.}{,~jj}" format.name$
4499 duplicate$
4500 'current.name.str :=
4501 current.name.int #1 >
4502 {
4503 duplicate$
4504 "others," =
4505 {
4506 pop$
4507 *
4508 bbl.etal
4509 add.space
4510 remaining.names.int #1 - 'remaining.names.int :=
4511 }
4512 {
4513 swap$
4514 names.separate.comma.bool
4515 { add.comma }
4516 { add.semicolon }
4517 if$
4518 %<*bio>
4519 remaining.names.int #1 >
4520 { }
4521 { bbl.and add.space * }
4522 if$
4523 %</bio>s
4524 swap$
4525 *
4526 }
4527 if$
4528 }
4529 { }
4530 if$
4531 remaining.names.int #1 - 'remaining.names.int :=
4532 current.name.int #1 + 'current.name.int :=
4533 }
4534 while$
4535 }
4536
4537 FUNCTION { format.names.all } {
4538 total.names.int 'remaining.names.int :=
4539 format.names.loop
4540 }
4541
4542 FUNCTION { format.names.etal } {
4543 ctrl.etal.firstonly.bool
4544 { #1 'remaining.names.int := }
4545 { ctrl.etal.number.int 'remaining.names.int := }
4546 if$
4547 format.names.loop
4548 current.name.str "others," =
4549 { }
4550 {
4551 add.space
4552 bbl.etal
4553 add.space
4554 *
4555 }
4556 if$
4557 }
4558
4559 FUNCTION { format.names } {
4560 'names.separate.comma.bool :=
4561 'names.str :=
4562 #1 'current.name.int :=
4563 names.str num.names$ 'total.names.int :=
4564 total.names.int ctrl.etal.number.int >
4565 {
4566 ctrl.etal.number.int #0 =
4567 { format.names.all }
4568 { format.names.etal }
4569 if$
4570 }
4571 { format.names.all }
4572 if$
4573 }
4574
4575 % Converting editions into their fixed representations
4576
4577 FUNCTION { bbl.first } { "1st" }
4578
4579 FUNCTION { bbl.second } { "2nd" }
4580
4581 FUNCTION { bbl.third } { "3rd" }
4582
4583 FUNCTION { bbl.fourth } { "4th" }
4584
4585 FUNCTION { bbl.fifth } { "5th" }
4586
4587 FUNCTION { bbl.st } { "st" }
4588
4589 FUNCTION { bbl.nd } { "nd" }
4590
4591 FUNCTION { bbl.rd } { "rd" }
4592
4593 FUNCTION { bbl.th } { "th" }
4594
4595 STRINGS {
4596 ord.input.str
4597 ord.output.str
4598 }
4599
4600 FUNCTION { make.ordinal } {
4601 duplicate$
4602 "1" swap$
4603 *
4604 #-2 #1 substring$
4605 "1" =
4606 {
4607 bbl.th *
4608 }
4609 {
4610 duplicate$
4611 #-1 #1 substring$
4612 duplicate$
4613 "1" =
4614 {
4615 pop$
4616 bbl.st *
4617 }
4618 {
4619 duplicate$
4620 "2" =
4621 {
4622 pop$
4623 bbl.nd *
4624 }
4625 {
4626 "3" =
4627 { bbl.rd * }
4628 { bbl.th * }
4629 if$
4630 }
4631 if$
4632 }
4633 if$
4634 }
4635 if$
4636 }
4637
4638 FUNCTION { convert.to.ordinal } {
4639 extract.number
4640 "l" change.case$ 'ord.input.str :=
4641 ord.input.str "first" = ord.input.str "1" = or
4642 { bbl.first 'ord.output.str := }
4643 {
4644 ord.input.str "second" = ord.input.str "2" = or
4645 { bbl.second 'ord.output.str := }
4646 {
4647 ord.input.str "third" = ord.input.str "3" = or
4648 { bbl.third 'ord.output.str := }
4649 {
4650 ord.input.str "fourth" = ord.input.str "4" = or
4651 { bbl.fourth 'ord.output.str := }
4652 {
4653 ord.input.str "fifth" = ord.input.str "5" = or
4654 { bbl.fifth 'ord.output.str := }
4655 {
4656 ord.input.str #1 #1 substring$
4657 is.a.number
4658 { ord.input.str make.ordinal }
4659 { ord.input.str }
4660 if$
4661 'ord.output.str :=
4662 }
4663 if$
4664 }
4665 if$
4666 }
4667 if$
4668 }
4669 if$
4670 }
4671 if$
4672 ord.output.str
4673 }
4674
4675 % Functions for each type of entry
4676
4677 FUNCTION { format.address } {
4678 address empty$
4679 { }
4680 {
4681 address
4682 output
4683 }
4684 if$
4685 }
4686
4687 FUNCTION { format.authors } {
4688 author empty$
4689 { }
4690 {
4691 %<*bio>
4692 author names.separate.comma format.names
4693 %</bio>
4694 %<*!bio>
4695 author names.separate.semicolon format.names
4696 %</!bio>
4697 output
4698 next.punct.space 'next.punct.int :=
4699 }
4700 if$
4701 }
4702
4703 FUNCTION { format.editors } {
4704 editor empty$
4705 { }
4706 {
4707 editor names.separate.comma format.names
4708 add.comma
4709 editor num.names$ #1 >
4710 { bbl.editors }
4711 { bbl.editor }
4712 if$
4713 *
4714 output
4715 next.punct.semicolon 'next.punct.int :=
4716 }
4717 if$
4718 }
4719
4720 FUNCTION { format.authors.or.editors } {
4721 author empty$
4722 { format.editors }
4723 { format.authors }
4724 if$
4725 next.punct.space 'next.punct.int :=
4726 }
4727
4728 FUNCTION { format.chapter } {
4729 chapter empty$
4730 { }
4731 {
4732 bbl.chapter add.space
4733 chapter
4734 *
4735 output
4736 }
4737 if$
4738 }
4739
4740 FUNCTION { format.doi } {
4741 doi empty$
4742 'skip$
4743 {
4744 bbl.doi add.space
4745 "\doi{" * doi * "}" *
4746 output
4747 }
4748 if$
4749 }
4750
4751 FUNCTION { format.edition } {
4752 edition empty$
4753 { }
4754 {
4755 edition convert.to.ordinal
4756 add.space bbl.edition *
4757 output
4758 }
4759 if$
4760 next.punct.semicolon 'next.punct.int :=
4761 }
4762
4763 FUNCTION { format.group.address } {
4764 duplicate$
4765 empty$
4766 { pop$ }
4767 {
4768 address empty$
4769 { }
4770 {
4771 add.colon
4772 address
4773 *
4774 }
4775 if$
4776 output
4777 }
4778 if$
4779 }
4780
4781 FUNCTION { format.howpublished } {
4782 howpublished empty$
4783 { }
4784 {
4785 howpublished
4786 output
4787 }
4788 if$
4789 }
4790
4791 FUNCTION { format.journal } {
4792 journal emph
4793 output
4794 next.punct.space 'next.punct.int :=
4795 }
4796
4797 FUNCTION { format.journal.unpub } {
4798 journal emph
4799 output
4800 }
4801
4802 FUNCTION { format.note } {
4803 note empty$
4804 { }
4805 {
4806 note
4807 output
4808 }
4809 if$
4810 }
4811
4812 FUNCTION { format.number.series } {
4813 series empty$
4814 { }
4815 {
4816 series
4817 number empty$
4818 { }
4819 {
4820 add.space
4821 number *
4822 }
4823 if$
4824 output
4825 next.punct.semicolon 'next.punct.int :=
4826 }
4827 if$
4828 }
4829
4830
4831 FUNCTION { format.organization } {
4832 organization empty$
4833 { }
4834 {
4835 organization paren
4836 output
4837 next.punct.period 'next.punct.int :=
4838 }
4839 if$
4840 }
4841
4842 FUNCTION { format.organization.address } {
4843 organization format.group.address
4844 }
4845
4846 FUNCTION { format.pages } {
4847 pages empty$
4848 { }
4849 {
4850 pages multi.page.check
4851 {
4852 bbl.pages
4853 pages hyphen.to.dash
4854 }
4855 { bbl.page pages }
4856 if$
4857 tie.or.space.connect
4858 output
4859 }
4860 if$
4861 ctrl.doi.bool
4862 { format.doi }
4863 'skip$
4864 if$
4865 }
4866
4867 FUNCTION { format.pages.article } {
4868 pages empty$
4869 { }
4870 {
4871 pages hyphen.to.dash
4872 output
4873 }
4874 if$
4875 ctrl.doi.bool
4876 { format.doi }
4877 'skip$
4878 if$
4879 }
4880
4881 FUNCTION { format.publisher.address } {
4882 publisher format.group.address
4883 }
4884
4885 FUNCTION { format.school.address } {
4886 school
4887 duplicate$
4888 empty$
4889 { pop$ }
4890 {
4891 address empty$
4892 { }
4893 {
4894 add.comma
4895 address
4896 *
4897 }
4898 if$
4899 output
4900 }
4901 if$
4902 }
4903
4904 FUNCTION { format.title } {
4905 title empty$
4906 { }
4907 {
4908 title
4909 output
4910 next.punct.period 'next.punct.int :=
4911 }
4912 if$
4913 }
4914
4915 FUNCTION { format.title.article } {
4916 ctrl.article.title.bool
4917 {
4918 title empty$
4919 { }
4920 {
4921 title
4922 output
4923 next.punct.period 'next.punct.int :=
4924 }
4925 if$
4926 }
4927 { }
4928 if$
4929 }
4930
4931 FUNCTION { format.title.techreport } {
4932 title empty$
4933 { }
4934 {
4935 title emph
4936 output
4937 next.punct.semicolon 'next.punct.int :=
4938 }
4939 if$
4940 }
4941
4942 FUNCTION { format.title.booktitle } {
4943 title empty$
4944 { }
4945 {
4946 title
4947 output
4948 next.punct.period 'next.punct.int :=
4949 }
4950 if$
4951 booktitle empty$
4952 { }
4953 {
4954 booktitle
4955 output
4956 next.punct.period 'next.punct.int :=
4957 }
4958 if$
4959 }
4960
4961 STRINGS {
4962 book.title
4963 chapter.title
4964 }
4965
4966 FUNCTION { format.title.booktitle.book } {
4967 "" 'chapter.title :=
4968 booktitle empty$
4969 {
4970 "" 'chapter.title :=
4971 title 'book.title :=
4972 }
4973 {
4974 ctrl.chapter.title.bool
4975 {
4976 title empty$
4977 'skip$
4978 { title 'chapter.title := }
4979 if$
4980 }
4981 'skip$
4982 if$
4983 maintitle empty$
4984 { booktitle 'book.title := }
4985 { maintitle add.period booktitle * 'book.title := }
4986 if$
4987 }
4988 if$
4989 chapter.title empty$
4990 { }
4991 {
4992 chapter.title
4993 output
4994 next.punct.period 'next.punct.int :=
4995 }
4996 if$
4997 book.title emph
4998 chapter.title empty$
4999 {
5000 author empty$
5001 { }
5002 {
5003 editor empty$
5004 { }
5005 { bbl.in add.space swap$ * }
5006 if$
5007 }
5008 if$
5009 }
5010 { bbl.in add.space swap$ * }
5011 if$
5012 output
5013 }
5014
5015 FUNCTION { format.type } {
5016 type empty$
5017 { }
5018 {
5019 pop$
5020 type
5021 }
5022 if$
5023 output
5024 }
5025
5026 FUNCTION { format.type.number } {
5027 type empty$
5028 { }
5029 {
5030 type
5031 number empty$
5032 { }
5033 { number tie.or.space.connect }
5034 if$
5035 output
5036 }
5037 if$
5038 }
5039
5040 FUNCTION { format.url } {
5041 url empty$
5042 { }
5043 {
5044 "\url{" url * "}" *
5045 output
5046 }
5047 if$
5048 }
5049
5050 FUNCTION { format.year } {
5051 year empty$
5052 { }
5053 {
5054 year
5055 output
5056 next.punct.semicolon 'next.punct.int :=
5057 }
5058 if$
5059 }
5060
5061 FUNCTION { format.year.article } {
5062 year empty$
5063 { }
5064 {
5065 %<*bio>
5066 year paren
5067 output
5068 next.punct.space 'next.punct.int :=
5069 %</bio>
5070 %<*!bio>
5071 year bold
5072 output
5073 %</!bio>
5074 }
5075 if$
5076 }
5077
5078 FUNCTION { format.version } {
5079 version empty$
5080 { }
5081 {
5082 bbl.version add.space
5083 version
5084 *
5085 output
5086 }
5087 if$
5088 }
5089
5090 FUNCTION { format.volume.article } {
5091 volume emph
5092 output
5093 }
5094
5095 FUNCTION { format.volume } {
5096 volume empty$
5097 { }
5098 {
5099 bbl.volume
5100 volume
5101 tie.or.space.connect
5102 output
5103 next.punct.semicolon 'next.punct.int :=
5104 }
5105 if$
5106 }
5107
5108 % The functions to deal with each entry type
5109
5110 FUNCTION { article } {
5111 begin.bibitem
5112 format.authors
5113 %<*bio>
5114 format.year.article
5115 %</bio>
5116 format.title.article
5117 format.journal
5118 %<*!bio>
5119 format.year.article
5120 %</!bio>
5121 format.volume.article
5122 format.pages.article
5123 format.note
5124 end.bibitem
5125 }
5126
5127 FUNCTION { book } {
5128 begin.bibitem
5129 format.authors.or.editors
5130 format.title.booktitle.book
5131 format.edition
5132 author empty$
5133 { }
5134 { format.editors }
5135 if$
5136 format.number.series
5137 format.publisher.address
5138 format.year
5139 format.volume
5140 format.chapter
5141 format.pages
5142 format.note
5143 end.bibitem
5144 }
5145
5146 FUNCTION { inbook } { book }
5147
5148 FUNCTION { booklet } {
5149 begin.bibitem
5150 format.authors
5151 format.title
5152 format.howpublished
5153 format.address
5154 format.year
5155 format.note
5156 end.bibitem
5157 }
5158
5159 FUNCTION { collection } { book }
5160
5161 FUNCTION { incollection } { book }
5162
5163 FUNCTION { inpress } {
5164 begin.bibitem
5165 format.authors
5166 %<*bio>
5167 format.year.article
5168 %</bio>
5169 format.journal.unpub
5170 doi empty$
5171 {
5172 bbl.inpress
5173 output
5174 }
5175 {
5176 %<*!bio>
5177 format.year.article
5178 %</!bio>
5179 next.punct.comma 'next.punct.int :=
5180 format.doi
5181 }
5182 if$
5183 format.note
5184 end.bibitem
5185 }
5186
5187 FUNCTION { inproceedings } {
5188 begin.bibitem
5189 format.authors
5190 format.title.booktitle
5191 format.address
5192 format.year
5193 format.pages
5194 format.note
5195 end.bibitem
5196 }
5197
5198 FUNCTION { manual } {
5199 begin.bibitem
5200 format.authors
5201 format.title
5202 format.version
5203 format.organization.address
5204 format.year
5205 format.note
5206 end.bibitem
5207 }
5208
5209 FUNCTION { mastersthesis } {
5210 begin.bibitem
5211 format.authors
5212 format.title
5213 bbl.msc format.type
5214 format.school.address
5215 format.year
5216 format.note
5217 end.bibitem
5218 }
5219
5220 FUNCTION { misc } {
5221 begin.bibitem
5222 format.authors
5223 format.title
5224 format.howpublished
5225 format.year
5226 format.url
5227 format.note
5228 end.bibitem
5229 }
5230
5231 FUNCTION { patent } {
5232 begin.bibitem
5233 format.authors
5234 format.organization
5235 format.title
5236 format.type.number
5237 format.year
5238 format.note
5239 end.bibitem
5240 }
5241
5242 FUNCTION { phdthesis } {
5243 begin.bibitem
5244 format.authors
5245 format.title
5246 bbl.phd format.type
5247 format.school.address
5248 format.year
5249 format.note
5250 end.bibitem
5251 }
5252
5253 FUNCTION { proceeding } {
5254 begin.bibitem
5255 format.title
5256 format.address
5257 format.year
5258 format.pages
5259 format.note
5260 end.bibitem
5261 }
5262
5263 FUNCTION { techreport } {
5264 begin.bibitem
5265 format.authors.or.editors
5266 format.title.techreport
5267 format.type.number
5268 format.organization.address
5269 format.year
5270 format.volume
5271 format.pages
5272 format.note
5273 end.bibitem
5274 }
5275
5276 FUNCTION { unpublished } {
5277 begin.bibitem
5278 format.authors
5279 format.journal.unpub
5280 doi empty$
5281 { format.howpublished }
5282 {
5283 format.year
5284 next.punct.comma 'next.punct.int :=
5285 format.doi
5286 }
5287 if$
5288 format.note
5289 end.bibitem
5290 }
5291
5292 FUNCTION { default.type } { misc }
5293
5294 % Macros containing pre-defined short cuts
5295
5296 MACRO { jan } { "Jan." }
5297 MACRO { feb } { "Feb." }
5298 MACRO { mar } { "Mar." }
5299 MACRO { apr } { "Apr." }
5300 MACRO { may } { "May" }
5301 MACRO { jun } { "June" }
5302 MACRO { jul } { "July" }
5303 MACRO { aug } { "Aug." }
5304 MACRO { sep } { "Sept." }
5305 MACRO { oct } { "Oct." }
5306 MACRO { nov } { "Nov." }
5307 MACRO { dec } { "Dec." }
5308
5309 MACRO { acbcct } { "ACS Chem.\ Biol." }
5310 MACRO { achre4 } { "Acc.\ Chem.\ Res." }
5311 MACRO { acncdm } { "ACS Chem.\ Neurosci." }
5312 MACRO { ancac3 } { "ACS Nano" }
5313 MACRO { ancham } { "Anal.\ Chem." }
5314 MACRO { bichaw } { "Biochemistry" }
5315 MACRO { bcches } { "Bioconjugate Chem." }
5316 MACRO { bomaf6 } { "Biomacromolecules" }
5317 MACRO { bipret } { "Biotechnol.\ Prog." }
5318 MACRO { crtoec } { "Chem.\ Res.\ Toxicol." }
5319 MACRO { chreay } { "Chem.\ Rev." }
5320 MACRO { cmatex } { "Chem.\ Mater." }
5321 MACRO { cgdefu } { "Cryst.\ Growth Des." }
5322 MACRO { enfuem } { "Energy Fuels" }
5323 MACRO { esthag } { "Environ.\ Sci.\ Technol." }
5324 MACRO { iechad } { "Ind.\ Eng.\ Chem.\ Res." }
5325 MACRO { inoraj } { "Inorg.\ Chem." }
5326 MACRO { jafcau } { "J.~Agric.\ Food Chem." }
5327 MACRO { jceaax } { "J.~Chem.\ Eng.\ Data" }
5328 MACRO { jceda8 } { "J.~Chem.\ Ed." }
5329 MACRO { jcisd8 } { "J.~Chem.\ Inf.\ Model." }
5330 MACRO { jctcce } { "J.~Chem.\ Theory Comput." }
5331 MACRO { jcchff } { "J. Comb. Chem." }
5332 MACRO { jmcmar } { "J. Med. Chem." }
5333 MACRO { jnprdf } { "J. Nat. Prod." }
5334 MACRO { joceah } { "J.~Org.\ Chem." }
5335 MACRO { jpcafh } { "J.~Phys.\ Chem.~A" }
5336 MACRO { jpcbfk } { "J.~Phys.\ Chem.~B" }
5337 MACRO { jpccck } { "J.~Phys.\ Chem.~C" }
5338 MACRO { jpclcd } { "J.~Phys.\ Chem.\ Lett." }
5339 MACRO { jprobs } { "J.~Proteome Res." }
5340 MACRO { jacsat } { "J.~Am.\ Chem.\ Soc." }
5341 MACRO { langd5 } { "Langmuir" }
5342 MACRO { mamobx } { "Macromolecules" }
5343 MACRO { mpohbp } { "Mol.\ Pharm." }
5344 MACRO { nalefd } { "Nano Lett." }
5345 MACRO { orlef7 } { "Org.\ Lett." }
5346 MACRO { oprdfk } { "Org.\ Proc.\ Res.\ Dev." }
5347 MACRO { orgnd7 } { "Organometallics" }
5348
5349 % Construction of bibliography: reading of data, construction of
5350 % labels, output of formatted bibliography
5351
5352 READ
5353
5354 EXECUTE { initialize.control.values }
5355
5356 EXECUTE { initialize.count.entries }
5357
5358 EXECUTE { initialize.name.separator }
5359
5360 EXECUTE { initialize.tracker }
5361
5362 ITERATE { calculate.names }
5363
5364 ITERATE { count.entries }
5365
5366 EXECUTE { begin.bib }
5367
5368 ITERATE { call.type$ }
5369
5370 EXECUTE { end.bib }
5371 %</bst>
5372 %\fi