diff options
author | Karl Berry <karl@freefriends.org> | 2009-04-22 17:09:30 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-04-22 17:09:30 +0000 |
commit | da42a0204f57b55e973f5e1554170f84df8833e2 (patch) | |
tree | 5fe241e546b00c9903a383a822c3a148f3041d87 /Master/texmf-dist/tex/latex/achemso/achemso.sty | |
parent | 66c43c768dd459a054b014c5cb6652c87895d682 (diff) |
achemso 3.2 (20apr09)
git-svn-id: svn://tug.org/texlive/trunk@12793 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/achemso/achemso.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/achemso/achemso.sty | 458 |
1 files changed, 247 insertions, 211 deletions
diff --git a/Master/texmf-dist/tex/latex/achemso/achemso.sty b/Master/texmf-dist/tex/latex/achemso/achemso.sty index 8a018b233c1..dbbf7292e36 100644 --- a/Master/texmf-dist/tex/latex/achemso/achemso.sty +++ b/Master/texmf-dist/tex/latex/achemso/achemso.sty @@ -5,239 +5,275 @@ %% The original source files were: %% %% achemso.dtx (with options: `package') -%% ---------------------------------------------------------------- -%% achemso --- Support for submissions to American Chemical -%% Society journals -%% Maintained by Joseph Wright -%% 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 -%% ---------------------------------------------------------------- +%% ---------------------------------------------------------------- +%% 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} - [2009/02/03 v3.1a Support for ACS journals] -\@ifclassloaded{achemso}{} - {\PackageInfo{achemso}{When using the achemso bundle - for\MessageBreak submission of articles to the ACS, - please\MessageBreak use the achemso document class.}} -\RequirePackage{notes2bib,mciteplus,xkeyval} -\newcommand*{\acs@tempa}{} -\newcommand*{\acs@tempb}{} -\newcount\acs@tempcnta -\newcount\acs@tempcntb -\newcount\acs@tempcntc -\newif\ifacs@switch -\define@boolkeys[acs]{key}[acs@]{ - abbreviate, - biochem, - biochemistry, - super, - usetitle}[true] -\let\acs@key@biochem\acs@key@biochemistry -\define@cmdkeys[acs]{key}[acs@]{ - maxauthors, - journal, - manuscript} -\define@choicekey*[acs]{key}{biblabel} - [\acs@tempa\acs@tempb] - {plain,brackets,fullstop,period} - {\ifcase\acs@tempb\relax - \def\@biblabel##1{##1}\or - \def\@biblabel##1{(##1)}\or - \def\@biblabel##1{##1.}\or - \def\@biblabel##1{##1.}\fi} -\newcommand*{\acs@setkeys}{\setkeys[acs]{key}} -\acs@setkeys{ - maxauthors=15, - super=true, - biblabel=brackets} -\ProcessOptionsX*[acs]<key> -\newcommand*{\acs@cfgextension}{cfg} -\newcommand*{\acs@prefix}{acs-} -\newcommand*{\acs@validtype}[2][article]{% - \acs@switchfalse - \@ifundefined{acs@manuscript} - {\newcommand*{\acs@manuscript}{#1}} - {\@for\acs@tempa:=#2\do{% - \ifx\acs@tempa\acs@manuscript - \acs@switchtrue - \fi} - \ifacs@switch\else - \ClassWarning{achemso}{Invalid manuscript type: - \MessageBreak changing to #1}% - \renewcommand*{\acs@manuscript}{#1}% - \fi}} -\let\acs@orgstartsection\@startsection -\newcommand*{\acs@startsection}[6]{% - \if@noskipsec \leavevmode \fi - \par - \@tempskipa #4\relax - \@afterindenttrue - \ifdim\@tempskipa<\z@\relax - \@tempskipa -\@tempskipa \@afterindentfalse + [2009/04/21 v3.2 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 - \if@nobreak - \everypar{}% +} +\RequirePackage{xkeyval} +\define@boolkey{acs}[acs@]{biochem}[true]{} +\define@boolkey{acs}[acs@]{super}[true]{} +\define@boolkey{acs}[acs@]{usetitle}[true]{} +\newcommand*{\acs@journal}{jacsat} +\newcommand*{\acs@manuscript}{article} +\newcommand*{\acs@maxauthors}{15} +\define@cmdkey{acs}[acs@]{journal}{} +\define@cmdkey{acs}[acs@]{manuscript}{} +\define@cmdkey{acs}[acs@]{maxauthors}{} +\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% + }% + }{% + \@nameuse{acs@biblabel@#1}% + }% +} +\newcommand*{\acs@biblabel@brackets}{\def\@biblabel##1{(##1)}} +\newcommand*{\acs@biblabel@fullstop}{\def\@biblabel##1{##1.}} +\newcommand*{\acs@biblabel@period}{\def\@biblabel##1{##1.}} +\newcommand*{\acs@biblabel@plain}{\def\@biblabel##1{##1}} +\setkeys{acs}{ + super = true +} +\ProcessOptionsX*<acs> +\newcommand*{\acs@niib@create}{% + \@namedef{ver@notes2bib.sty}{% + 2009/04/20 v1.6a Integrating notes into the bibliography (achemso + version) + }% + \newcounter{bibnote} + \renewcommand*{\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 + \acs@bib@write + \if@filesw + \expandafter\acs@niib@write \else - \addpenalty\@secpenalty\addvspace\@tempskipa + \expandafter\acs@niib@no@write \fi - \@ifstar - {\@ssect{#3}{#4}{#5}{#6}} - {\@ssect{#3}{#4}{#5}{#6}}} -\newcommand*{\acs@killsecnums}{% - \let\@startsection\acs@startsection} -\newcommand*{\acs@restsecnums}{% - \let\@startsection\acs@orgstartsection} -\@ifclassloaded{achemso} - {\acs@killsecnums} - {} -\let\acs@section\section -\let\acs@subsection\subsection -\newcommand*{\acs@killsecs}{% - \newcommand*{\acs@gobblesection}{% - \ClassWarning{achemso} - {Sections not allowed for this manuscript type}% - \@ifstar{\@gobble}{\@gobble}} - \let\section\acs@gobblesection - \let\subsection\acs@gobblesection - \let\subsubsection\acs@gobblesection - \AtBeginDocument{ - \renewcommand*{\bibsection}{\acs@section*{\refname}}}} -\newcommand*{\acknowledgement}{% - \acs@subsection*{\acs@acknowledgement}} -\newcommand*{\suppinfo}{% - \acs@subsection*{\acs@suppinfo}} -\newcommand*{\acs@acknowledgement}{Acknowledgement} -\newcommand*{\acs@suppinfo}{Supporting Information Available} -\newcommand*{\acs@killabstract}{% - \let\abstract\acs@startgobble} -\begingroup - \catcode`{=\active - \catcode`}=12\relax - \catcode`(=1\relax - \catcode`)=2\relax - \gdef\acs@startgobble(% - \ClassWarning(achemso) - (Abstract not allowed for this\MessageBreak - manuscript type)% - \@bsphack - \catcode`{=\active - \catcode`}=12\relax - \let\end\fi - \let{\acs@endgobble%} - \iffalse)%{ - \gdef\acs@endgobble#1}(% - \def\acs@tempa(#1)% - \ifx\acs@tempa\@currenvir - \@Esphack\endgroup - \if@ignore - \global\@ignorefalse\ignorespaces - \fi - \else - \expandafter\acs@iffalse - \fi) -\endgroup -\newcommand*{\acs@iffalse}{\iffalse} -\@ifclassloaded{achemso} - {\@ifundefined{acs@journal} - {\ClassInfo{achemso}{No target journal specified: - \MessageBreak using package defaults}% - \@ifundefined{acs@manuscript}{} - {\ClassWarning{achemso}{The `type' option is only - applicable\MessageBreak when the `journal' option is - also specified}}}% - {\InputIfFileExists{\acs@journal.\acs@cfgextension} - {\ClassInfo{achemso}{Loading configuration for - journal\MessageBreak \acs@journal}} - {\ClassWarning{achemso}{Unknown journal - `\acs@journal'}% - \InputIfFileExists{jacsat.\acs@cfgextension} - {\ClassInfo{achemso}{Loading jacs - configuration\MessageBreak as a fall-back}} - {\ClassError{achemso}{Could not load - jacsat.cfg}{This is a core file of\MessageBreak - the achemso bundle: something is wrong with - \MessageBreak your installation}}}}}% - {\@ifundefined{acs@journal}{} - {\PackageWarning{achemso}{The `journal' option is only - applicable\MessageBreak when using the achemso - document class}}% - \@ifundefined{acs@manuscript}{} - {\PackageWarning{achemso}{The `type' option is only - applicable\MessageBreak when using the achemso - document class}}} +} +\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 +} \ifacs@super \RequirePackage[sort&compress,numbers,super]{natbib} \else \RequirePackage[sort&compress,numbers,round]{natbib} + \def\citenumfont{\textit} \fi \RequirePackage{natmove} -\renewcommand*{\nmv@activate}{% - \let\nmv@natcitex\@citex +\renewcommand*{\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}}}} -\renewcommand*{\nmv@notactivate}{% + \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}}}} -\ifacs@biochemistry - \newcommand*{\acs@bibstyle}{biochem} -\else - \newcommand*{\acs@bibstyle}{achemso} + \nmv@ifmtarg{##1}{% + \nmv@cite{##2}% + }{% + \nocite{##2}% + \bibnote{Ref.~\citenum{##2}, ##1}% + }% + }% +} +\newcommand*{\acs@bibstyle}{achemso} +\bibliographystyle{achemso} +\ifacs@biochem + \renewcommand*{\acs@bibstyle}{biochem} + \bibliographystyle{biochem} \fi -\expandafter\bibliographystyle\expandafter{\acs@bibstyle} +\newcommand*{\acs@bibliographystyle}{} \let\acs@bibliographystyle\bibliographystyle -\AtBeginDocument{ - \@ifpackageloaded{chapterbib} - {\renewcommand*{\bibliographystyle}[1]{% - \expandafter\acs@bibliographystyle\expandafter{% - \acs@bibstyle}}}} \renewcommand*{\bibliographystyle}[1]{% - \PackageWarning{achemso}{\string\bibliographystyle\space - ignored}} -\ifacs@super\else - \newcommand*{\citenumfont}{\textit} -\fi -\edef\acs@msg{% - This is an auxiliary file used by the `achemso' package.^^J% + \acs@warning{\string\bibliographystyle\space ignored}% + \expandafter\acs@bibliographystyle\expandafter{\acs@bibstyle}% +} +\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@writebib}{% - \immediate\openout\acs@out\acs@stream\relax - \immediate\write\acs@out{\acs@msg}% - \edef\acs@tempa##1##2{\space\space##1\space - =\space"##2",^^J}% - \immediate\write\acs@out{% - @Control\string{achemso-control,^^J% - \acs@tempa{ctrl-use-title}{\ifacs@usetitle - yes\else no\fi}% - \acs@tempa{ctrl-etal-number}{\acs@maxauthors}% - \string}^^J}} -\if@filesw - \newwrite\acs@out - \newcommand*\acs@stream{\acs@prefix\jobname.bib} - \acs@writebib - \AtBeginDocument{\immediate\closeout\acs@out} -\fi -\AtBeginDocument{ + required.^^J +} +\newcommand*{\acs@bib@name}{acs-\jobname.bib} +\newif\ifacs@bib@written +\newcommand*{\acs@bib@write}{% + \if@filesw + \ifacs@bib@written\else + \expandafter\expandafter\expandafter\acs@bib@write@aux + \fi + \fi +} +\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 = \space"##2",^^J% + }% + \immediate\write\acs@bib@file{% + @Control\string{% + achemso-control,^^J% + \@tempa{ctrl-use-title}{% + \ifacs@usetitle yes\else no\fi + }% + \@tempa{ctrl-etal-number}{\acs@maxauthors}% + \string}^^J% + }% + \immediate\write\@auxout{% + \string\citation\string{achemso-control\string}% + }% + \global\acs@bib@writtentrue + \AtEndDocument{% + \immediate\closeout\acs@bib@file\relax + }% +} +\IfFileExists{mciteplus.sty}{% + \RequirePackage{mciteplus} +}{} +\AtBeginDocument{% \let\acs@bibliography\bibliography \renewcommand*{\bibliography}[1]{% - \acs@bibliography{\acs@prefix\jobname,#1}}} -\g@addto@macro{\document}{% - \if@filesw - \immediate\write\@auxout{% - \string\citation\string{achemso-control\string}}% - \fi} -\endinput + \acs@bib@write + \acs@bibliography{acs-\jobname,#1}% + }% +} +\AtBeginDocument{% + \@ifpackageloaded{notes2bib}{}{% + \acs@niib@create + }% +} +%% +%% Originally developed by Mats Dahlgren +%% Copyright (C) 1996-1998 by Mats Dahlgren +%% Copyright (C) 2008-2009 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-2003 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.pdf, +%% achemso.bib, +%% achemso.cls, +%% achemso.ins, +%% achemso.sty, +%% achemso-demo.tex, +%% natmove.sty and +%% a number of configuration files. +%% %% %% End of file `achemso.sty'. |