summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/chemschemex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-02-23 22:07:28 +0000
committerKarl Berry <karl@freefriends.org>2018-02-23 22:07:28 +0000
commitfc5c9edd95a17a5ca54c6a9c8d6a5348afa5f6e5 (patch)
tree48aa98255e0785c0b21501ce196def31fab390a5 /Master/texmf-dist/tex/latex/chemschemex
parent01c5905c541381e74672a48e4750a6be0b5da8ee (diff)
chemschemex (23feb18)
git-svn-id: svn://tug.org/texlive/trunk@46723 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/chemschemex')
-rw-r--r--Master/texmf-dist/tex/latex/chemschemex/chemschemex.sty115
1 files changed, 64 insertions, 51 deletions
diff --git a/Master/texmf-dist/tex/latex/chemschemex/chemschemex.sty b/Master/texmf-dist/tex/latex/chemschemex/chemschemex.sty
index f39a9143436..194aeb85fca 100644
--- a/Master/texmf-dist/tex/latex/chemschemex/chemschemex.sty
+++ b/Master/texmf-dist/tex/latex/chemschemex/chemschemex.sty
@@ -8,7 +8,7 @@
%%
%% This is a generated file.
%%
-%% Copyright (C) 2014 by Dominik Siegel
+%% Copyright (C) 2014-2018 by Dominik Siegel
%%
%% This file may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
@@ -25,17 +25,19 @@
%%
%% latex chemschemex.dtx
\NeedsTeXFormat{LaTeX2e}[2005/12/01]
+\ProvidesPackage{chemschemex}[2018/01/20 v1.2 Typeset chemical schemes]
+\NeedsTeXFormat{LaTeX2e}[2005/12/01]
\ProvidesPackage{chemschemex}[2017/04/03 v1.1.1 Typeset chemical schemes]
\RequirePackage{xkeyval}
-\RequirePackage{etextools}
+\RequirePackage{etoolbox}
\RequirePackage{xargs}
-\RequirePackage{ifthen}
+\RequirePackage{xifthen}
\RequirePackage{suffix}
\RequirePackage{fancylabel}
\fancyref@DefineFamily{}{CSX}
-\def\fancylabelformatCSX{\arabic{fancylabel}}%
-\def\fancysublabelformatCSX{\arabic{fancylabel}\alph{fancysublabel}}%
-\def\fancyonlysublabelformatCSX{\alph{fancysublabel}}%
+\def\fancylabelformatCSX{\arabic{fancylabel}}
+\def\fancysublabelformatCSX{\arabic{fancylabel}\alph{fancysublabel}}
+\def\fancyonlysublabelformatCSX{\alph{fancysublabel}}
\RequirePackage{graphicx}
\RequirePackage{tikz}
\usetikzlibrary{%
@@ -50,7 +52,7 @@
% #2=filename of the image
\newcommand{\CSXimage}[2][]{%
\includegraphics[#1,##1]{##2}%
- }
+ }%
}
\define@key{chemschemex}{labelseparator}{%
\def\CSXlabelsep{#1}%
@@ -332,8 +334,8 @@
}%
}
\newif\ifCSX@scheme\CSX@schemefalse % Is true, if the struct appears in a Chemscheme environment
-\newif\ifCSX@generate@@@caption@% Is needed to get label and text out of the caption passed to customstruct
-\newif\ifCSX@generate@@@caption@LastEntryWasTextOnly% Is needed to detect text-only caption entries
+\newif\ifCSX@generate@@@caption@ % Is needed to get label and text out of the caption passed to customstruct
+\newif\ifCSX@generate@@@caption@LastEntryWasTextOnly % Is needed to detect text-only caption entries
\newlength{\CSXimagewidth}\setlength{\CSXimagewidth}{0pt}
\newlength{\CSXlabelwidth}\setlength{\CSXlabelwidth}{0pt}
\newlength{\CSXmaxlabelwidth}\setlength{\CSXmaxlabelwidth}{0pt}
@@ -361,7 +363,7 @@
}%
\AtBeginDocument{%
\immediate\write\@auxout{%
- \string\fancyref@addtolist
+ \string\fancyref@addtolist%
{\string{#2\string}}%
{\string\CSX@structlist@filenamesorted}%
}%
@@ -426,7 +428,7 @@
% #5=TikZ option for image
% #6=filename
\@struct{#1}{#2}{#6}%
- \expandnext{\customstruct[#4][#5]}{\@@struct}{\CSXimage[#3]{#6}}%
+ \customstruct[#4][#5]{\@@struct}{\CSXimage[#3]{#6}}%
}
\newcommandx\structalt[7][1={},2=CSX,3={},4={},5={},usedefault]{%
% #1=caption
@@ -437,7 +439,7 @@
% #6=filename of the referenced image
% #7=filename of the image shown instead of #6
\@struct{#1}{#2}{#6}%
- \expandnext{\customstruct[#4][#5]}{\@@struct}{\CSXimage[#3]{#7}}%
+ \customstruct[#4][#5]{\@@struct}{\CSXimage[#3]{#7}}%
}
\WithSuffix\newcommandx\struct*[6][1={},2=CSX,3={},4={},5={},usedefault]{%
% #1=caption
@@ -447,7 +449,7 @@
% #5=TikZ option for image
% #6=filename
\@struct*{#1}{#2}{#6}%
- \expandnext{\customstruct[#4][#5]}{\@@struct}{\CSXimage[#3]{#6}}%
+ \customstruct[#4][#5]{\@@struct}{\CSXimage[#3]{#6}}%
}
\WithSuffix\newcommandx\structalt*[7][1={},2=CSX,3={},4={},5={},usedefault]{%
% #1=caption
@@ -458,7 +460,7 @@
% #6=filename of the referenced image
% #7=filename of the image shown instead of #6
\@struct*{#1}{#2}{#6}%
- \expandnext{\customstruct[#4][#5]}{\@@struct}{\CSXimage[#3]{#7}}%
+ \customstruct[#4][#5]{\@@struct}{\CSXimage[#3]{#7}}%
}
\WithSuffix\newcommandx\struct-[5][1={},2={},3={},4={},usedefault]{%
% #1=caption
@@ -466,7 +468,7 @@
% #3=TikZ option for caption
% #4=TikZ option for image
% #5=filename
- \expandnext{\customstruct[#3][#4]}{{{},{#1}}}{\CSXimage[#2]{#5}}%
+ \customstruct[#3][#4]{{{},{#1}}}{\CSXimage[#2]{#5}}%
}
\newcommandx\Struct[6][1=CSX,2={},3={},4={},usedefault]{%
% #1=family
@@ -476,7 +478,7 @@
% #5=list of sublabels previously defined with \newstruct
% #6=filename
\@Struct{#1}{#5}{#6}%
- \expandnext{\customstruct[#3][#4]}{\@@struct}{\CSXimage[#2]{#6}}%
+ \customstruct[#3][#4]{\@@struct}{\CSXimage[#2]{#6}}%
}
\newcommandx\Structalt[7][1=CSX,2={},3={},4={},usedefault]{%
% #1=family
@@ -487,7 +489,7 @@
% #6=filename of the referenced image
% #7=filename of the image shown instead of #6
\@Struct{#1}{#5}{#6}%
- \expandnext{\customstruct[#3][#4]}{\@@struct}{\CSXimage[#2]{#7}}%
+ \customstruct[#3][#4]{\@@struct}{\CSXimage[#2]{#7}}%
}
\WithSuffix\newcommandx\Struct*[6][1=CSX,2={},3={},4={},usedefault]{%
% #1=family
@@ -497,7 +499,7 @@
% #5=list of sublabels previously defined with \newstruct
% #6=filename
\@Struct*{#1}{#5}{#6}%
- \expandnext{\customstruct[#3][#4]}{\@@struct}{\CSXimage[#2]{#6}}%
+ \customstruct[#3][#4]{\@@struct}{\CSXimage[#2]{#6}}%
}
\WithSuffix\newcommandx\Structalt*[7][1=CSX,2={},3={},4={},usedefault]{%
% #1=family
@@ -508,7 +510,7 @@
% #6=filename of the referenced image
% #7=filename of the image shown instead of #6
\@Struct*{#1}{#5}{#6}%
- \expandnext{\customstruct[#3][#4]}{\@@struct}{\CSXimage[#2]{#7}}%
+ \customstruct[#3][#4]{\@@struct}{\CSXimage[#2]{#7}}%
}
\newcommand{\structplus}{%
\customstruct{}{\tikz[CSXsimple]{\draw[-](1,0)to(-1,0);\draw[-](0,1)to(0,-1);}}%
@@ -518,7 +520,9 @@
}
\def\ChemschemeNextRow@list{}%
\newcommand{\ChemschemeNextRow}[1][]{%
- \ExpandNext{\fancyref@addtolist}{\theCSXstruct}{\ChemschemeNextRow@list}%
+ % #1=vertical margin
+ \edef\ChemschemeNextRow@helper{\noexpand\fancyref@addtolist{\theCSXstruct}{\noexpand\ChemschemeNextRow@list}}%
+ \ChemschemeNextRow@helper%
\expandafter\def\csname ChemschemeNextRow@\theCSXstruct\endcsname{#1}%
\ignorespaces%
}
@@ -594,15 +598,15 @@
% #1=boxname
% #2=box content
\@ifundefined{#1}{%
- \expandnext{\newsavebox}{\csname #1\endcsname}%
+ \edef\CSX@savebox@set@helper{\noexpand\newsavebox{\csname #1\endcsname}}\CSX@savebox@set@helper%
}{}
- \expandnext{\global\sbox}{\csname #1\endcsname}{#2}%
- \expandnext{\usebox}{\csname #1\endcsname}%
+ \global\sbox{\csname #1\endcsname}{#2}%
+ \usebox{\csname #1\endcsname}%
}%
\def\CSX@savebox@show#1#2{%
% #1=boxname
% #2=box content
- \expandnext{\usebox}{\csname #1\endcsname}%
+ \usebox{\@nameuse{#1}}%
}%
\newcommand{\customarrow}[4][\the\CSXarrowlength]{%
% #1=length
@@ -651,9 +655,11 @@
([CSXshiftB]\noexpand\CSXnodename .east);%
}%
}%
- \expandnext{\expandafter\gdef\csname CSX@list@image@\theCSXstruct\endcsname}{%
- \customarrow@temp%
- }%
+ \edef\customarrow@helper{%
+ \noexpand\expandafter\noexpand\gdef\noexpand\csname CSX@list@image@\theCSXstruct\endcsname{%
+ \expandonce\customarrow@temp%
+ }%
+ }\customarrow@helper%
\expandafter\gdef\csname CSX@list@caption@\theCSXstruct\endcsname{%
\node(Scheme\theCSXscheme Caption\theCSXstruct){};%
}%
@@ -686,14 +692,16 @@
\newcommand{\CSX@declarearrowbundle}[2]{%
% #1=macro name
% #2=TikZ style
- % normal arrow
- \expandnext{\CSXdeclarearrow}{\csname #1\endcsname}{#2}%
- % crossed out arrow
- \expandnext{\CSXdeclarearrow}{\csname C#1\endcsname}{#2,CSXCrossArrow}%
- % striked out arrow
- \expandnext{\CSXdeclarearrow}{\csname S#1\endcsname}{#2,CSXStrikeArrow}%
- % Double striked out arrow
- \expandnext{\CSXdeclarearrow}{\csname DS#1\endcsname}{#2,CSXDStrikeArrow}%
+ \edef\CSX@declarearrowbundle@helper{%
+ % normal arrow
+ \noexpand\CSXdeclarearrow{\csname #1\endcsname}{#2}%
+ % crossed out arrow
+ \noexpand\CSXdeclarearrow{\csname C#1\endcsname}{#2,CSXCrossArrow}%
+ % striked out arrow
+ \noexpand\CSXdeclarearrow{\csname S#1\endcsname}{#2,CSXStrikeArrow}%
+ % Double striked out arrow
+ \noexpand\CSXdeclarearrow{\csname DS#1\endcsname}{#2,CSXDStrikeArrow}%
+ }\CSX@declarearrowbundle@helper%
}
\CSXdeclarearrowbundle{RightArrow}{CSXallarrows,CSXRightArrow}
\CSXdeclarearrowbundle{LeftArrow}{CSXallarrows,CSXLeftArrow}
@@ -729,7 +737,7 @@
\ifthenelse{\equal{#1}{}}{%
\def\@@struct{{{\fancylabel[#2]{#3}},{}}}%
}{%
- \def\@@struct{{{\def\fancylabelShowLabelEvent{\CSXlabelsep}\fancylabel[#2]{#3}},{#1}}}%
+ \def\@@struct{{{\protecting{\def\fancylabelShowLabelEvent{\CSXlabelsep}}\fancylabel[#2]{#3}},{#1}}}%
}%
}
\WithSuffix\newcommand\@struct*[3]{%
@@ -748,9 +756,9 @@
\def\fancyref@sort@list{}%
\def\fancyref@sort@labellist@unsorted{}%
\fancyref@sort{#2}%
- \expandnext{\fancyref@addtolist}%
- {\fancyref@sort@labellist@unsorted}%
- {\fancyref@sort@list}%
+ \edef\@Struct@helper{%
+ \noexpand\fancyref@addtolist{\fancyref@sort@labellist@unsorted}{\noexpand\fancyref@sort@list}%
+ }\@Struct@helper%
\edef\CSX@sorted@list{\fancyref@sort@list}%
% Generate the caption
\edef\@@Struct##1##2{%
@@ -763,13 +771,15 @@
use the command \string\newstruct.}{}%
}{%
\noexpand\fancyref@addtolist{%
- {{\noexpand\def\noexpand\fancylabelShowLabelEvent{\noexpand\CSXlabelsep}%
+ {{\noexpand\protecting{\noexpand\def\noexpand\fancylabelShowLabelEvent{\noexpand\CSXlabelsep}}%
\noexpand\fancysublabel[#1]{#3}{##2}},%
{\noexpand\@nameuse{CSX@newstruct@#3@subcaption@##2}}}}%
{\noexpand\@@struct}%
}%
}%
- \expandnext{\fancyref@foreach{\@@Struct}{}}{\CSX@sorted@list}%
+ \edef\@Struct@helper{%
+ \noexpand\fancyref@foreach{\noexpand\@@Struct}{}{\CSX@sorted@list}%
+ }\@Struct@helper%
}
\WithSuffix\newcommand\@Struct*[3]{%
% #1=family
@@ -787,9 +797,11 @@
\edef\customstruct@outarrow@temp{%
\noexpand\node[\expandonce{#2}](Scheme\theCSXscheme Image\theCSXstruct){\expandonce{#4}};%
}%
- \expandnext{\expandafter\gdef\csname CSX@list@image@\theCSXstruct\endcsname}{%
- \customstruct@outarrow@temp%
- }%
+ \edef\customstruct@outarrow@helper{%
+ \noexpand\expandafter\noexpand\gdef\noexpand\csname CSX@list@image@\theCSXstruct\endcsname{%
+ \expandonce\customstruct@outarrow@temp%
+ }%
+ }\customstruct@outarrow@helper%
% Generate caption
\CSXgeneratecaption{#3}{#4}{Scheme\theCSXscheme Caption\theCSXstruct}{#1}%
% Set caption
@@ -800,9 +812,11 @@
}%
};%
}%
- \expandnext{\expandafter\gdef\csname CSX@list@caption@\theCSXstruct\endcsname}{%
- \customstruct@outarrow@temp%
- }%
+ \edef\customstruct@outarrow@helper{%
+ \noexpand\expandafter\noexpand\gdef\noexpand\csname CSX@list@caption@\theCSXstruct\endcsname{%
+ \expandonce\customstruct@outarrow@temp%
+ }%
+ }\customstruct@outarrow@helper%
\ifCSX@scheme%
% Inside Chemscheme environment
\else%
@@ -839,7 +853,7 @@
}%
}%
}%
- \expandnext{\CSX@savebox{CSX@savebox@\theCSXstructinarrow}}{%
+ \CSX@savebox{CSX@savebox@\theCSXstructinarrow}{%
\customstruct@inarrow@temp%
}%
\ignorespaces%
@@ -858,9 +872,8 @@
\def\CSX@generate@caption@captionstyle{CSXcaption,#4}%
\CSX@generate@@@caption@true%
\ifthenelse{\equal{#1}{}}{}{%
- \expandnext\expandnext\expandnext{%
- \fancyref@foreach{\CSX@generate@@caption}{}%
- }{#1}%
+ \protected@edef\CSXgeneratecaption@helper{\noexpand\fancyref@foreach{\noexpand\CSX@generate@@caption}{}{#1}}%
+ \CSXgeneratecaption@helper%
}%
}
\newcommand{\CSX@generate@@caption}[2]{%