summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/achemso/achemso.sty
blob: 88c9535c15cccf578712126d25d148dfadfdeb92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
%%
%% This is file `achemso.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% achemso.dtx  (with options: `package')
%% ----------------------------------------------------------------
%% achemso --- Support for submissions to American Chemical Society
%%   journals
%% E-mail: joseph.wright@morningstar2.co.uk
%% Released under the LaTeX Project Public License v1.3c or later
%% See http://www.latex-project.org/lppl.txt
%% ----------------------------------------------------------------
%% 
\NeedsTeXFormat{LaTeX2e}

\ProvidesPackage{achemso}
  [2014/03/06 v3.8g Support for ACS journals]
\@ifclassloaded{achemso}{%
  \PackageInfo{achemso}{%
    You have already loaded the `achemso' class:\MessageBreak
    loading the package will abort%
  }%
  \endinput
}{%
  \PackageInfo{achemso}{%
    When writing a submission to an ACS journal, please\MessageBreak
    use the achemso document class%
  }%
}
\newcommand*\acs@warning{\PackageWarning{achemso}}
\newcommand*\acs@ifundefined[1]{%
  \begingroup\expandafter\expandafter\expandafter\endgroup
  \expandafter\ifx\csname #1\endcsname\relax
    \expandafter\@firstoftwo
  \else
    \expandafter\@secondoftwo
  \fi
}
\RequirePackage{xkeyval}
\newcommand*\acs@keyval@bool[2]{%
  \acs@ifundefined{acs@#1#2}{%
    \acs@warning{Unknown option `#2' for key #1}%
  }{%
    \@nameuse{acs@#1#2}%
  }%
}
\newif\ifacs@abbreviations
\newif\ifacs@articletitle
\newif\ifacs@biochem
\newif\ifacs@chaptertitle
\newif\ifacs@email
\newif\ifacs@hyperref
\newif\ifacs@keywords
\newif\ifacs@super
\define@key{acs}{abbreviations}[true]{%
  \acs@keyval@bool{abbreviations}{#1}%
}
\define@key{acs}{articletitle}[true]{%
  \acs@keyval@bool{articletitle}{#1}%
}
\define@key{acs}{biochem}[true]{%
  \acs@keyval@bool{biochem}{#1}%
}
\define@key{acs}{chaptertitle}[true]{%
  \acs@keyval@bool{chaptertitle}{#1}%
}
\define@key{acs}{email}[true]{%
  \acs@keyval@bool{email}{#1}%
}
\define@key{acs}{hyperref}[true]{%
  \acs@keyval@bool{hyperref}{#1}%
}
\define@key{acs}{keywords}[true]{%
  \acs@keyval@bool{keywords}{#1}%
}
\define@key{acs}{super}[true]{%
  \acs@keyval@bool{super}{#1}%
}
\define@key{acs}{usetitle}[true]{%
  \acs@keyval@bool{articletitle}{#1}%
}
\newcommand*\acs@journal{jacsat}
\newcommand*\acs@layout{traditional}
\newcommand*\acs@manuscript{article}
\newcommand*\acs@maxauthors{15}
\define@key{acs}{journal}{%
  \def\acs@journal{#1}%
}
\define@key{acs}{layout}{%
  \def\acs@layout{#1}%
}
\define@key{acs}{manuscript}{%
  \def\acs@manuscript{#1}%
}
\define@key{acs}{maxauthors}{%
  \def\acs@maxauthors{#1}%
}
\newif\ifacs@etal@truncate
\define@key{acs}{etalmode}{%
  \acs@ifundefined{acs@etal@#1}{%
    \acs@warning{%
      Unknown value `#1' for\MessageBreak  etalmode option%
    }%
  }{%
    \@nameuse{acs@etal@#1}%
  }%
}
\newcommand*\acs@etal@firstonly{\acs@etal@truncatefalse}
\newcommand*\acs@etal@truncate{\acs@etal@truncatetrue}
\define@key{acs}{biochemistry}{%
  \setkeys{acs}{biochem = #1}%
}
\define@key{acs}{biblabel}{%
  \acs@ifundefined{acs@biblabel@#1}{%
    \acs@warning{%
      Unknown value `#1' for\MessageBreak biblabel option%
    }%
  }{%
    \acs@activate@biblabel{\@nameuse{acs@biblabel@#1}}%
  }%
}
\newcommand*\acs@activate@biblabel{}
\let\acs@activate@biblabel\AtEndOfPackage
\AtEndOfPackage{\let\acs@activate@biblabel\@firstofone}
\newcommand*\acs@biblabel@brackets{\def\bibnumfmt##1{(##1)}}
\newcommand*\acs@biblabel@fullstop{\def\bibnumfmt##1{##1.}}
\newcommand*\acs@biblabel@period{\def\bibnumfmt##1{##1.}}
\newcommand*\acs@biblabel@plain{\def\bibnumfmt##1{##1}}
\setkeys{acs}{
  email = true,
  super = true
}
\ProcessOptionsX*<acs>
\newcommand*\acs@manuscript@communication{communication}
\newcommand*\acs@manuscript@letter{letter}
\newcommand*\acs@manuscript@note{note}
\newcommand*\acs@manuscript@review{review}
\newcommand*\acs@manuscript@suppinfo{suppinfo}
\newcommand*\acs@niib@create{%
  \@namedef{ver@notes2bib.sty}{%
    2009/04/20 v1.6a Integrating notes into the bibliography (achemso
    version)
  }%
  \@ifundefined{c@bibnote}{\newcounter{bibnote}}{}
  \def\thebibnote{%
    Note-\the\value{bibnote}%
  }%
  \DeclareRobustCommand*{\bibnote}[1][\thebibnote]{%
    \stepcounter{bibnote}%
    \def\acs@niib@after@text{\cite{##1}}%
    \acs@niib@text{##1}%
  }%
  \DeclareRobustCommand*{\bibnotemark}[1][\thebibnote]{%
    \stepcounter{bibnote}%
    \cite{##1}%
  }%
  \DeclareRobustCommand*{\bibnotetext}[1][\thebibnote]{%
    \let\acs@niib@after@text\relax
    \acs@niib@text{##1}%
  }%
  \newcommand*\printbibnotes{%
    \ifnum\the\value{bibnote}>\z@\relax
      \nocite{achemso-control}%
      \acs@bibliography{acs-\jobname}%
    \fi
  }%
}
\newcommand*\acs@niib@after@text{}
\newcommand*\acs@niib@text{%
  \@bsphack
  \if@filesw
    \expandafter\acs@niib@write
  \else
    \expandafter\acs@niib@no@write
  \fi
}
\newcommand*\acs@niib@write[1]{%
  \begingroup
    \let\do\@makeother
    \dospecials
    \catcode`\{ 1\relax
    \catcode`\} 2\relax
    \acs@niib@write@aux@i{#1}%
}
\newcommand*\acs@niib@write@aux@i[1]{%
  \long\def\@tempa##1{%
      \def\@tempa{##1}%
      \@onelevel@sanitize\@tempa
    \expandafter\endgroup
    \expandafter\def\expandafter\@tempa\expandafter{\@tempa}%
    \acs@niib@write@aux@ii{#1}%
  }%
  \catcode`\^^M 10\relax
  \@tempa
}
\newcommand*\acs@niib@write@aux@ii[1]{%
  \immediate\write\acs@bib@file{%
    @Misc\string{#1,^^J%
    \space\space note = \string{\@tempa\string},^^J%
    \string}^^J%
  }%
  \@esphack
  \acs@niib@after@text
}
\newcommand\acs@niib@no@write[2]{%
  \@esphack
  \acs@niib@after@text
}
\AtBeginDocument{
  \def\nmv@natbib@detect{%
    \ifNAT@super
      \expandafter\acs@nmv@activate
    \else
      \expandafter\acs@autonote
    \fi
  }
}
\newcommand*\acs@nmv@activate{%
  \let\nmv@citex@nat\@citex
  \let\@citex\nmv@citex
  \let\nmv@cite\cite
  \renewcommand*{\cite}[2][]{%
    \nmv@ifmtarg{##1}{%
      \nmv@citetrue
      \nmv@cite{##2}%
    }{%
      \nocite{##2}%
      \bibnote{Ref.~\citenum{##2}, ##1}%
    }%
  }%
}
\newcommand*\acs@autonote{%
  \let\nmv@cite\cite
  \renewcommand*{\cite}[2][]{%
    \nmv@ifmtarg{##1}{%
      \nmv@cite{##2}%
    }{%
      \nocite{##2}%
      \bibnote{Ref.~\citenum{##2}, ##1}%
    }%
  }%
}
\newwrite\acs@bib@file
\newcommand*\acs@bib@message{%
  This is an auxiliary file used by the `achemso' bundle.^^J%
  This file may safely be deleted. It will be recreated as required.^^J
}
\newcommand*\acs@bib@name{acs-\jobname.bib}
\newcommand*\acs@bib@write{%
  \if@filesw
    \expandafter\acs@bib@write@aux
  \fi
}
\AtBeginDocument{\acs@bib@write}
\newcommand*\acs@bib@write@aux{%
  \immediate\openout\acs@bib@file\acs@bib@name\relax
  \immediate\write\acs@bib@file{\acs@bib@message}%
  \edef\@tempa##1##2{%
    \space\space##1\space = "##2",^^J%
  }%
  \immediate\write\acs@bib@file{%
    @Control\string{%
      achemso-control,^^J%
      \@tempa{ctrl-article-title\space}{%
        \ifacs@articletitle yes\else no\fi
      }%
      \@tempa{ctrl-chapter-title\space}{%
        \ifacs@chaptertitle yes\else no\fi
      }%
      \@tempa{ctrl-etal-number\space\space\space}{\acs@maxauthors}%
      \@tempa{ctrl-etal-firstonly}{%
        \ifacs@etal@truncate no\else yes\fi
      }%
    \string}^^J%
  }%
  \immediate\write\@auxout{%
    \string\citation\string{achemso-control\string}%
  }%
  \AtEndDocument{%
    \immediate\closeout\acs@bib@file\relax
  }%
}
\AtBeginDocument{%
  \let\acs@bibliography\bibliography
  \def\bibliography#1{%
    \acs@bibliography{acs-\jobname,#1}%
  }%
}
\AtBeginDocument{
  \providecommand{\latin}[1]{#1}
}
\ifacs@super
  \RequirePackage[sort&compress,numbers,super]{natbib}
\else
  \RequirePackage[sort&compress,numbers,round]{natbib}
  \def\citenumfont{\textit}
\fi
\RequirePackage{natmove}
\IfFileExists{mciteplus.sty}{%
  \RequirePackage{mciteplus}
  \providecommand*{\@mciteNatbibCiteCmdList}{}%
  \edef\@tempa{\noexpand\in@{citenum}{\@mciteNatbibCiteCmdList}}%
  \@tempa
  \ifin@
  \else
    \edef\@mciteNatbibCiteCmdList{\@mciteNatbibCiteCmdList,citenum}%
  \fi
}{}
\newcommand*\acs@bibstyle{achemso}
\ifacs@biochem
  \def\acs@bibstyle{biochem}
  \bibliographystyle{biochem}
\else
  \bibliographystyle{achemso}
\fi
\newcommand*\acs@bibliographystyle{}
\let\acs@bibliographystyle\bibliographystyle
\def\bibliographystyle#1{%
  \acs@warning{\string\bibliographystyle\space ignored}%
  \expandafter\acs@bibliographystyle\expandafter{\acs@bibstyle}%
}
\AtBeginDocument{%
  \@ifpackageloaded{notes2bib}{}{%
    \acs@niib@create
  }%
}
%% 
%% Originally developed by Mats Dahlgren
%% Copyright (C) 1996-1998 by Mats Dahlgren
%% Copyright (C) 2008-2014 by
%%   Joseph Wright <joseph.wright@morningstar2.co.uk>
%% 
%% Part of this bundle is derived from cite.sty, to which the
%% following license applies:
%%   Copyright (C) 1989-2009 by Donald Arseneau
%%   These macros may be freely transmitted, reproduced, or
%%   modified provided that this notice is left intact.
%% 
%% It may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License (LPPL), either version 1.3c of
%% this license or (at your option) any later version.  The latest
%% version of this license is in the file:
%% 
%%    http://www.latex-project.org/lppl.txt
%% 
%% This work is "maintained" (as per LPPL maintenance status) by
%%   Joseph Wright.
%% 
%% This work consists of the file  achemso.dtx
%%           and the derived files achemso.cls,
%%                                 achemso.ins,
%%                                 achemso.pdf,
%%                                 achemso.sty,
%%                                 achemso-demo.bib,
%%                                 achemso-demo.tex,
%%                                 natmove.sty and
%%                                 a number of configuration files.
%% 
%%
%% End of file `achemso.sty'.