summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/chemstyle/chemstyle.sty
blob: 2c3bdce5ea901f8bfe8abc042f442ac7bcd07f6c (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
%%
%% This is file `chemstyle.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% chemstyle.dtx  (with options: `package')
%%  ----------------------------------------------------------------
%%  chemstyle - Writing chemistry with style
%%  Maintained by Joseph Wright
%%  E-mail: joseph.wright@morningstar2.co.uk
%%  Released under the GNU General Public License
%%  See http://www.gnu.org/licenses/gpl.txt
%%  ----------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{chemstyle}
  [2007/08/23 v1.0a Writing chemistry with style]
\ifx\fg\@undefined
\else
  \ifx\fg\relax
  \else
    \let\cst@fg\fg
    \let\fg\@undefined
  \fi
\fi
\RequirePackage{graphicx,amssymb,varioref,xspace,unitsdef}
\ifx\cst@fg\@undefined
  \let\fg\@undefined
\else
  \let\fg\cst@fg
\fi
\AtBeginDocument{%
  \ifx\fg\@undefined
    \newcommand{\fg}{\femtogram}
  \fi
}
\newunit{\cubiccentimeter}{\cm\unitsuperscript{3}}
\newcommand{\cmc}{\cubiccentimeter}
\newcommand{\Hz}{\hertz}
\newunit{\Molar}{\textsc{m}}
\newunit{\molar}{\mole\unitsep\dm\unitsuperscript{--3}}
\newunit{\mmHg}{mm\unitsep{}Hg}
\newcommand*{\standardstate}%
  {\textsuperscript{\rotatebox[origin=c]{140.8}%
  {\ensuremath{\varnothing}}}}
\let\cst@emph\relax
\def\cst@hyph{}
\let\cst@super\relax
\newif  \ifcst@prefix   \cst@prefixtrue
\def\cst@radical#1#2{%
  \expandafter\newcommand\expandafter{\csname #1#2\endcsname}{}%
  \expandafter\DeclareRobustCommand\expandafter{%
    \csname #1#2\endcsname}{%
    \ifcst@prefix
      \cst@super{\cst@emph{#1}}\cst@hyph#2%
    \else
      #2\cst@hyph\cst@super{\cst@emph{#1}}%
    \fi%
    \xspace
  }
}
\cst@radical{n}{Pr}%
\cst@radical{i}{Pr}%
\cst@radical{n}{Bu}%
\cst@radical{i}{Bu}%
\cst@radical{s}{Bu}%
\cst@radical{t}{Bu}%
\newif  \ifcst@notes    \cst@notestrue
\DeclareOption{ch}{\ExecuteOptions{chapter}}
\DeclareOption{chapter}%
  {\PassOptionsToPackage{chapter}{chemscheme}}
\DeclareOption{chemcompounds}%
  {\PassOptionsToPackage{chemcompounds}{chemscheme}}
\DeclareOption{nonotes}{\cst@notesfalse}
\let\cst@option\relax
\DeclareOption*{%
  \ifx\cst@option\relax\else
    \PackageWarning{chemstyle}
      {Extra option \cst@option\space ignored}
  \fi
  \edef\cst@option{\CurrentOption}
}
\ProcessOptions*
\RequirePackage{chemscheme}
\@ifclassloaded{memoir}
  {\let\newfloat\@undefined
   \RequirePackage{float}}
  {}
\floatstyle{plaintop}
\restylefloat{table}
\floatstyle{plain}
\restylefloat{scheme}
\restylefloat{figure}
\floatplacement{table}{htbp}
\floatplacement{scheme}{htbp}
\floatplacement{figure}{htbp}
\floatcontentscentre
\labelformat{scheme}{\schemename~#1}
\labelformat{figure}{\figurename~#1}
\labelformat{table}{\tablename~#1}
\ifx\latin\@undefined
  \newcommand{\latinemphon}{\let\latin\emph}
  \newcommand{\latinemphoff}{\let\latin\relax}
  \latinemphon
\else
  \let\latinemphon\relax
  \let\latinemphoff\relax
\fi

\providecommand{\etc}{\latin{etc}\@ifnextchar.{}{.\xspace}}
\providecommand{\invacuo}{\latin{in vacuo}\xspace}
\providecommand{\etal}{\latin{et~al}\@ifnextchar.{}{.\xspace}}
\providecommand{\eg}{\latin{e.g}\@ifnextchar.{}{.\xspace}}
\providecommand{\ie}{\latin{i.e}\@ifnextchar.{}{.\xspace}}
\newif  \ifcst@notesbefore  \cst@notesbeforetrue
\def\cst@name@refs#1#2#3{%
  \ifcst@notesbefore
    #3\ #2\ #1%
  \else
    #1\ #2\ #3%
  \fi
}
\def\cst@language{english}
\ifx\refname\@undefined
   \ifx\bibname\@undefined
      \PackageWarning{chemstyle}%
        {No bibliography name command defined in document class}
      \def\cst@namerefs#1#2#3#4{}%
    \else
      \def\cst@refsection{\bibname}
    \fi
 \else
   \def\cst@refsection{\refname}
\fi
\ifx\cst@namerefs\@undefined
  \def\cst@namerefs#1#2#3#4{%
    \ifcst@notes%
      \def\cst@language@check{#1}
      \ifx\cst@language\cst@language@check
        \expandafter\renewcommand\expandafter{\cst@refsection}%
          {\cst@name@refs{#2}{#3}{#4}}%
      \fi
      \AtBeginDocument{%
        \@ifpackageloaded{babel}{%
          \expandafter\addto\expandafter{\csname captions#1\endcsname}%
            {\expandafter\renewcommand\expandafter{\cst@refsection}%
            {\cst@name@refs{#2}{#3}{#4}}}%
          \expandafter\selectlanguage\expandafter{\languagename}}
        {}}
    \else%
      \ifx#1\cst@language
        \expandafter\renewcommand\expandafter{\cst@refsection}{#2}%
      \fi
      \AtBeginDocument{%
        \@ifpackageloaded{babel}{%
          \expandafter\addto\expandafter{\csname captions#1\endcsname}%
            {\expandafter\renewcommand\expandafter{\cst@refsection}{#2}}%
          \expandafter\selectlanguage\expandafter{\languagename}}%
        {}}
    \fi%
  }
\fi
\cst@namerefs{english}{References}{and}{Notes}
\cst@namerefs{UKenglish}{References}{and}{Notes}
\cst@namerefs{ngerman}{Literatur}{und}{Notizen}
\cst@namerefs{french}{R\'ef\'erences}{et}{Notes}
\ifx\cst@option\relax
  \PackageWarning{chemstyle}
    {You didn't say which style to use \MessageBreak
     Defaulting to the ``no change'' style: none}
  \def\cst@option{none}
\fi
\InputIfFileExists{\cst@option.jdf}
  {\PackageInfo{chemstyle}
    {Loaded \cst@option.jdf}}
  {\PackageWarning{chemstyle}
    {Required style \cst@option\space does not exist}}
\endinput
%%
%% End of file `chemstyle.sty'.