diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/chemscheme/chemscheme.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/chemscheme/chemscheme.sty | 198 |
1 files changed, 147 insertions, 51 deletions
diff --git a/Master/texmf-dist/tex/latex/chemscheme/chemscheme.sty b/Master/texmf-dist/tex/latex/chemscheme/chemscheme.sty index 2f89ad65347..f26aca63ff7 100644 --- a/Master/texmf-dist/tex/latex/chemscheme/chemscheme.sty +++ b/Master/texmf-dist/tex/latex/chemscheme/chemscheme.sty @@ -6,84 +6,180 @@ %% %% chemscheme.dtx (with options: `package') %% ---------------------------------------------------------------- -%% The chemscheme package - Support for chemical schemes +%% The chemscheme package --- Support for chemical schemes %% 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 +%% Released under the LaTeX Project Public License v1.3 or later +%% See http://www.latex-project.org/lppl.txt %% ---------------------------------------------------------------- +%% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{chemscheme}% - [2007/08/05 v1.1 Support for chemical schemes] -\RequirePackage{psfrag} + [2007/10/04 v1.3 Support for chemical schemes] +\RequirePackage{psfrag,iflang} \@ifclassloaded{memoir}{} - {\RequirePackage{float}} -\newif \ifCHEMSCH@chapter \CHEMSCH@chapterfalse -\newif \ifCHEMSCH@bpchem \CHEMSCH@bpchemtrue -\DeclareOption{chapter}{\global\CHEMSCH@chaptertrue} -\DeclareOption{chemcompounds}{\global\CHEMSCH@bpchemfalse} -\DeclareOption{bpchem}{} + {\RequirePackage{float,caption}} +\newif \ifchemsch@bpchem \chemsch@bpchemfalse +\DeclareOption{chemcompounds}{\chemsch@bpchemfalse} +\DeclareOption{bpchem}{\chemsch@bpchemtrue} +\DeclareOption{chapter}% + {\PackageInfo{chemscheme}% + {Ignoring obsolete option `chapter'}} \ProcessOptions \newcommand*{\schemename}{Scheme} -\newcommand*{\listschemes}{List of Schemes} -\ifCHEMSCH@chapter - \ifx\chapter\@undefined - \PackageWarning{chemscheme}% - {No chapters in this document \MessageBreak% - Ignoring `chapter' option} - \@ifclassloaded{memoir} - {\newfloat{scheme}{los}{\schemename}} - {\newfloat{scheme}{tbp}{los}} - \else - \@ifclassloaded{memoir} - {\newfloat[chapter]{scheme}{los}{\schemename}} - {\newfloat{scheme}{tbp}{los}[chapter]} - \fi -\else - \@ifclassloaded{memoir} - {\newfloat{scheme}{los}{\schemename}} - {\newfloat{scheme}{tbp}{los}} -\fi +\newcommand*{\listschemename}{List of Schemes} +\@ifclassloaded{memoir}{% + \AtBeginDocument{% + \newfloat[chapter]{scheme}{los}{\schemename} + \kill@lastcounter{losdepth} + \renewcommand*{\thescheme}{\thechapter.\@arabic\c@scheme} + \addtodef{\@smemfront}{}{\counterwithout{scheme}{chapter}} + \addtodef{\@smemmain}{}{% + \ifartopt\else + \counterwithin{scheme}{chapter} + \fi} + \addtodef{\backmatter}{}{% + \ifartopt\else + \counterwithout{scheme}{chapter}% + \setcounter{scheme}{0}% + \fi} + \ifartopt + \counterwithout{scheme}{chapter}% + \fi + } +}{% + \AtBeginDocument{% + \@ifundefined{chapter}{% + \newfloat{scheme}{tbp}{los}% + }{% + \newfloat{scheme}{tbp}{los}[chapter] + \@ifundefined{KOMAScriptVersion}{% + \renewcommand*{\thescheme}% + {\ifnum\c@chapter>\z@ \thechapter.\fi \@arabic\c@scheme} + }{} + \let\chemsch@orig@chapter\@chapter + \def\chemsch@chapter{% + \addtocontents{los}{\protect\addvspace{10\p@}}% + \chemsch@orig@chapter} + \let\@chapter\chemsch@chapter + } + } +} \@ifclassloaded{memoir} - {\newlistof{listofschemes}{los}{\listschemes}} + {\AtBeginDocument{% + \newlistof{listofschemes}{los}{\listschemename} + \kill@lastcounter{losdepth} + \newlistentry[chapter]{scheme}{los}{0} + \cftsetindents{scheme}{0em}{2.3em} + \addtodef{\insertchapterspace}{}% + {\addtocontents{los}{\protect\addvspace{10pt}}} + \@ifundefined{c@losdepth}% + {\newcounter{losdepth}\setcounter{losdepth}{1}}{}% + } + } {\floatname{scheme}{\schemename} - \newcommand*{\listofschemes}[1][\listschemes]% - {\listof{scheme}{#1}}} + \newcommand*{\listofschemes}{\listof{scheme}{\listschemename}}} \newcommand*{\floatcontentscentre}% - {\let\CHEMSCH@everyfloat\centering} + {\let\chemsch@everyfloat\centering} \let\floatcontentscenter\floatcontentscentre \newcommand*{\floatcontentsleft}% - {\let\CHEMSCH@everyfloat\relax} + {\let\chemsch@everyfloat\relax} \newcommand*{\floatcontentsright}% - {\let\CHEMSCH@everyfloat\raggedleft} -\let\CHEMSCH@floatboxreset\@floatboxreset + {\let\chemsch@everyfloat\raggedleft} +\let\chemsch@floatboxreset\@floatboxreset \floatcontentsleft -\def\@floatboxreset{\CHEMSCH@everyfloat\CHEMSCH@floatboxreset} -\newcommand{\chemschemerefmarker}{TMP} -\newcommand{\chemschemerefformat}{\textsf} -\ifCHEMSCH@bpchem +\def\@floatboxreset{\chemsch@everyfloat\chemsch@floatboxreset} +\newif \ifchemsch@babel \chemsch@babelfalse +\@ifpackageloaded{babel} + {\chemsch@babeltrue} + {} +\@ifclassloaded{memoir} + {} + {\@ifpackageloaded{babel} + {\IfLanguageName{french} + {\let\floatc@plain\FB@makecaption} + {\IfLanguageName{frenchb} + {\let\floatc@plain\FB@makecaption} + {}}} + {}} +\AtBeginDocument{% + \@ifpackageloaded{babel}{% + \addto{\captionsngerman}{\renewcommand*{\schemename}{Schema}} + \addto{\captionsngerman}% + {\renewcommand*{\listschemename}{Schemenverzeichnis}} + \addto{\captionsgerman}{\renewcommand*{\schemename}{Schema}} + \addto{\captionsgerman}% + {\renewcommand*{\listschemename}{Schemenverzeichnis}} + \addto{\captionsfrench}% + {\renewcommand*{\schemename}{\scshape Sch\`eme}} + \addto{\captionsfrench}% + {\renewcommand*{\listschemename}{Table des sch\`emes}} + \addto{\captionsfrenchb}% + {\renewcommand*{\schemename}{\scshape Sch\`eme}} + \addto{\captionsfrenchb}% + {\renewcommand*{\listschemename}{Table des sch\`emes}} + \expandafter\selectlanguage\expandafter{\languagename} + \@ifclassloaded{memoir} + {} + {\IfLanguageName{french} + {\ifchemsch@babel\else + \let\floatc@plain\FB@makecaption + \fi} + {\IfLanguageName{frenchb} + {\ifchemsch@babel\else + \let\floatc@plain\FB@makecaption + \fi} + {}}} + {} + }{} +} +\newcommand*{\schemerefmarker}{TMP} +\newcommand*{\schemerefformat}{\textsf} +\ifchemsch@bpchem \RequirePackage{bpchem} - \let\CHEMSCH@label\CNlabel + \let\chemsch@label\CNlabel \else \RequirePackage{chemcompounds} - \let\CHEMSCH@label\compound + \let\chemsch@label\compound \fi -\newcommand{\chemschemeref}[2]{% - \psfrag{\chemschemerefmarker#1}[b][b]% - {\chemschemerefformat{\CHEMSCH@label{#2}}}% +\newcount\chemsch@num +\newcommand*{\schemeref}{% + \advance\chemsch@num\@ne% + \@ifnextchar[% + {\chemsch@schemeref} + {\chemsch@schemeref[\schemerefmarker\the\chemsch@num]} +} +\def\chemsch@schemeref[#1]#2{% + \wlog{Replaing #1 by #2}% + \psfrag{#1}[b][b]% + {\schemerefformat{\chemsch@label{#2}}}% } -\ifCHEMSCH@bpchem - \newcommand{\chemschemerefsub}[3]{% - \psfrag{\chemschemerefmarker#1}[b][b]% - {\chemschemerefformat{\CNlabelsub{#2}{#3}}}% +\def\chemsch@schemerefsub[#1]#2#3{% + \psfrag{#1}[b][b]% + {\schemerefformat{\CNlabelsub{#2}{#3}}}% +} +\newcommand*{\chemschemeref}[1]{% + \schemeref[#1]% +} +\ifchemsch@bpchem + \newcommand*{\schemerefsub}{% + \advance\chemsch@num\@ne% + \@ifnextchar[% + {\chemsch@schemerefsub} + {\chemsch@schemerefsub[\schemerefmarker\the\chemsch@num]} + } + \newcommand*{\chemschemerefsub}[1]{% + \schemerefsub[#1]% } \else - \newcommand{\chemschemerefsub}[3]{% + \newcommand*{\schemerefsub}[3][]{% + \advance\chemsch@num\@ne% \PackageWarning{chemscheme}% {`chemcompound' option active\MessageBreak Command \protect\chemschemerefsub\space not used \MessageBreak Please alter your source to \MessageBreak \protect\chemschemeref}} + \newcommand*{\chemschemerefsub}[1]{\schemerefsub}% \fi \endinput %% |