summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-07-20 22:10:34 +0000
committerKarl Berry <karl@freefriends.org>2014-07-20 22:10:34 +0000
commita2cfb7237c96e698f1f2933b008104555610ee89 (patch)
tree2f64ba48065ad97b0156dba404fa274782167269 /Master
parent3939eb6308172d96585a35eddc3214f037d356cf (diff)
chemschemex (20jul14)
git-svn-id: svn://tug.org/texlive/trunk@34667 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/latex/chemschemex/C2H4.pdf82
-rw-r--r--Master/texmf-dist/doc/latex/chemschemex/CH2CH-R2.pdfbin0 -> 3624 bytes
-rw-r--r--Master/texmf-dist/doc/latex/chemschemex/R1-CHCH2.pdfbin0 -> 3557 bytes
-rw-r--r--Master/texmf-dist/doc/latex/chemschemex/R2-CHCH-R1.pdfbin0 -> 3815 bytes
-rw-r--r--Master/texmf-dist/doc/latex/chemschemex/README49
-rw-r--r--Master/texmf-dist/doc/latex/chemschemex/RuCH-R1.pdfbin0 -> 3829 bytes
-rw-r--r--Master/texmf-dist/doc/latex/chemschemex/RuCH2.pdf119
-rw-r--r--Master/texmf-dist/doc/latex/chemschemex/chemschemex.pdfbin0 -> 290841 bytes
-rw-r--r--Master/texmf-dist/doc/latex/chemschemex/cp.pdf84
-rw-r--r--Master/texmf-dist/doc/latex/chemschemex/maleimid.pdfbin0 -> 3815 bytes
-rw-r--r--Master/texmf-dist/doc/latex/chemschemex/product.pdfbin0 -> 4057 bytes
-rw-r--r--Master/texmf-dist/doc/latex/chemschemex/product_num.pdfbin0 -> 4674 bytes
-rw-r--r--Master/texmf-dist/source/latex/chemschemex/chemschemex.dtx2300
-rw-r--r--Master/texmf-dist/source/latex/chemschemex/chemschemex.ins50
-rw-r--r--Master/texmf-dist/tex/latex/chemschemex/chemschemex.sty1127
-rwxr-xr-xMaster/tlpkg/bin/tlpkg-ctan-check2
-rw-r--r--Master/tlpkg/tlpsrc/chemschemex.tlpsrc0
-rw-r--r--Master/tlpkg/tlpsrc/collection-science.tlpsrc1
18 files changed, 3813 insertions, 1 deletions
diff --git a/Master/texmf-dist/doc/latex/chemschemex/C2H4.pdf b/Master/texmf-dist/doc/latex/chemschemex/C2H4.pdf
new file mode 100644
index 00000000000..c37e1456547
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/chemschemex/C2H4.pdf
@@ -0,0 +1,82 @@
+%PDF-1.4
+%쏢
+5 0 obj
+<</Length 6 0 R/Filter /FlateDecode>>
+stream
+x- 0D&P1tc? 1$; N4i$j 9݇ࢬPs'"g"Wh.FyVmendstream
+endobj
+6 0 obj
+95
+endobj
+4 0 obj
+<</Type/Page/MediaBox [0 0 19 15]
+/Parent 3 0 R
+/Resources<</ProcSet[/PDF]
+/ExtGState 8 0 R
+>>
+/Contents 5 0 R
+>>
+endobj
+3 0 obj
+<< /Type /Pages /Kids [
+4 0 R
+] /Count 1
+>>
+endobj
+1 0 obj
+<</Type /Catalog /Pages 3 0 R
+/Metadata 9 0 R
+>>
+endobj
+7 0 obj
+<</Type/ExtGState
+/OPM 1>>endobj
+8 0 obj
+<</R7
+7 0 R>>
+endobj
+9 0 obj
+<</Type/Metadata
+/Subtype/XML/Length 1351>>stream
+<?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?>
+<?adobe-xap-filters esc="CRLF"?>
+<x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='XMP toolkit 2.9.1-13, framework 1.6'>
+<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:iX='http://ns.adobe.com/iX/1.0/'>
+<rdf:Description rdf:about='uuid:b29e7f4e-b1a2-11e3-0000-802e0d00ac4f' xmlns:pdf='http://ns.adobe.com/pdf/1.3/' pdf:Producer='GPL Ghostscript 9.05'/>
+<rdf:Description rdf:about='uuid:b29e7f4e-b1a2-11e3-0000-802e0d00ac4f' xmlns:xmp='http://ns.adobe.com/xap/1.0/'><xmp:ModifyDate>2014-03-19T10:16:48+01:00</xmp:ModifyDate>
+<xmp:CreateDate>2014-03-19T10:16:48+01:00</xmp:CreateDate>
+<xmp:CreatorTool>ChemDraw Ultra(tm) 11.0d1</xmp:CreatorTool></rdf:Description>
+<rdf:Description rdf:about='uuid:b29e7f4e-b1a2-11e3-0000-802e0d00ac4f' xmlns:xapMM='http://ns.adobe.com/xap/1.0/mm/' xapMM:DocumentID='uuid:b29e7f4e-b1a2-11e3-0000-802e0d00ac4f'/>
+<rdf:Description rdf:about='uuid:b29e7f4e-b1a2-11e3-0000-802e0d00ac4f' xmlns:dc='http://purl.org/dc/elements/1.1/' dc:format='application/pdf'><dc:title><rdf:Alt><rdf:li xml:lang='x-default'>C2H4.eps</rdf:li></rdf:Alt></dc:title></rdf:Description>
+</rdf:RDF>
+</x:xmpmeta>
+
+
+<?xpacket end='w'?>
+endstream
+endobj
+2 0 obj
+<</Producer(GPL Ghostscript 9.05)
+/CreationDate(D:20140319101648+01'00')
+/ModDate(D:20140319101648+01'00')
+/Creator(ChemDraw Ultra\(tm\) 11.0d1)
+/Title(C2H4.eps)>>endobj
+xref
+0 10
+0000000000 65535 f
+0000000386 00000 n
+0000001947 00000 n
+0000000327 00000 n
+0000000198 00000 n
+0000000015 00000 n
+0000000180 00000 n
+0000000450 00000 n
+0000000491 00000 n
+0000000520 00000 n
+trailer
+<< /Size 10 /Root 1 0 R /Info 2 0 R
+/ID [<E55F7A3415A2DFE7EF736635809B35AE><E55F7A3415A2DFE7EF736635809B35AE>]
+>>
+startxref
+2125
+%%EOF
diff --git a/Master/texmf-dist/doc/latex/chemschemex/CH2CH-R2.pdf b/Master/texmf-dist/doc/latex/chemschemex/CH2CH-R2.pdf
new file mode 100644
index 00000000000..da9b4965f7c
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/chemschemex/CH2CH-R2.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/chemschemex/R1-CHCH2.pdf b/Master/texmf-dist/doc/latex/chemschemex/R1-CHCH2.pdf
new file mode 100644
index 00000000000..fc51e162beb
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/chemschemex/R1-CHCH2.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/chemschemex/R2-CHCH-R1.pdf b/Master/texmf-dist/doc/latex/chemschemex/R2-CHCH-R1.pdf
new file mode 100644
index 00000000000..75856cb747e
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/chemschemex/R2-CHCH-R1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/chemschemex/README b/Master/texmf-dist/doc/latex/chemschemex/README
new file mode 100644
index 00000000000..304f4746ff5
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/chemschemex/README
@@ -0,0 +1,49 @@
+---------------------------------------------------------
+chemschemex v1.0 2014/07/15
+
+ Chemical schemes including complex labeling and
+ referencing
+
+---------------------------------------------------------
+
+ Dominik Siegel
+ E-Mail: dominik.siegel@yahoo.de
+
+---------------------------------------------------------
+
+Copyright (C) 2014 by Dominik Siegel
+
+This file may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either
+version 1.2 of this license or (at your option) any later
+version. The latest version of this license is in:
+
+http://www.latex-project.org/lppl.txt
+
+and version 1.2 or later is part of all distributions of
+LaTeX version 1999/12/01 or later.
+
+---------------------------------------------------------
+
+If you have any ideas, questions, suggestions or bugs to report,
+please feel free to contact me.
+
+--------------------------------------------------------------------------
+
+This work consists of the files
+- C2H4.pdf
+- CH2=CH-R2.pdf
+- chemschemex.dtx
+- chemschemex.ins
+- chemschemex.pdf
+- cp.pdf
+- maleimid.pdf
+- product_num.pdf
+- product.pdf
+- R1-CH=CH2.pdf
+- R2-CH=CH-R1.pdf
+- README
+- Ru=CH2.pdf
+- Ru=CH-R1.pdf
+
+--------------------------------------------------------------------------
diff --git a/Master/texmf-dist/doc/latex/chemschemex/RuCH-R1.pdf b/Master/texmf-dist/doc/latex/chemschemex/RuCH-R1.pdf
new file mode 100644
index 00000000000..7de0d1a7513
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/chemschemex/RuCH-R1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/chemschemex/RuCH2.pdf b/Master/texmf-dist/doc/latex/chemschemex/RuCH2.pdf
new file mode 100644
index 00000000000..ccdbc1fcb8c
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/chemschemex/RuCH2.pdf
@@ -0,0 +1,119 @@
+%PDF-1.4
+%쏢
+5 0 obj
+<</Length 6 0 R/Filter /FlateDecode>>
+stream
+xM˱0 _qcjt!ʆ
+E?1ɀ<z[a=%ڏM?ŶJuM SA!Tg5s9aְ|UԲ;}@k9H8\" ףۓJbh/j)endstream
+endobj
+6 0 obj
+139
+endobj
+4 0 obj
+<</Type/Page/MediaBox [0 0 51 16]
+/Parent 3 0 R
+/Resources<</ProcSet[/PDF /Text]
+/ExtGState 10 0 R
+/Font 11 0 R
+>>
+/Contents 5 0 R
+>>
+endobj
+3 0 obj
+<< /Type /Pages /Kids [
+4 0 R
+] /Count 1
+>>
+endobj
+1 0 obj
+<</Type /Catalog /Pages 3 0 R
+/Metadata 13 0 R
+>>
+endobj
+7 0 obj
+<</Type/ExtGState
+/OPM 1>>endobj
+10 0 obj
+<</R7
+7 0 R>>
+endobj
+11 0 obj
+<</R8
+8 0 R>>
+endobj
+8 0 obj
+<</BaseFont/KRAURP+Helvetica/FontDescriptor 9 0 R/Type/Font
+/FirstChar 50/LastChar 117/Widths[ 556 0 0 0 0 0 0 0 0 0 0 0 0 0
+0 0 0 722 0 0 0 0 722 0 0 0 0 0 0 0
+0 0 722 0 0 0 0 0 0 0 0 278 0 278 0 0
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+0 0 0 0 0 556]
+/Encoding/WinAnsiEncoding/Subtype/Type1>>
+endobj
+9 0 obj
+<</Type/FontDescriptor/FontName/KRAURP+Helvetica/FontBBox[0 -212 679 741]/Flags 131104
+/Ascent 741
+/CapHeight 741
+/Descent -212
+/ItalicAngle 0
+/StemV 101
+/MissingWidth 278
+/XHeight 524
+/CharSet(/C/H/R/bracketleft/bracketright/two/u)/FontFile3 12 0 R>>
+endobj
+12 0 obj
+<</Filter/FlateDecode
+/Subtype/Type1C/Length 704>>stream
+xU_HSq{o:6I7\edbNRJʦmMi =?")jRҊRP3"K+5$nW##z;|9!4zsf*r1dE60 ? e]e,:l9^ !e PTjAd0ڸ蘘m$&۲"jJjӚ,%5\ZeqzCYW_bԚERhTv"JFrIQ9f4Bwp&>7%VVHp4N6d X G5>|h#xMgc#Mgl^̊々Lș6 UtEtV]5_gWZF=|< C>R%Vcߖa,V-eɀmG=IyI:Ҟ(>e ޗI\bF+)7Φ1 M<$Jh==M6K(;h㭆F_<H׏=,ȓpݲ 'az۵m帘U\ϒSIz/!ͳʥUt= ?OY<R=s꜅58kNT79uμݟW^e+vԋCn8!8'W 4 
+ \#qF%hZSE,= y[eAK
+endstream
+endobj
+13 0 obj
+<</Type/Metadata
+/Subtype/XML/Length 1353>>stream
+<?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?>
+<?adobe-xap-filters esc="CRLF"?>
+<x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='XMP toolkit 2.9.1-13, framework 1.6'>
+<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:iX='http://ns.adobe.com/iX/1.0/'>
+<rdf:Description rdf:about='uuid:0ce9113a-b19e-11e3-0000-5f8f5c7fffa5' xmlns:pdf='http://ns.adobe.com/pdf/1.3/' pdf:Producer='GPL Ghostscript 9.05'/>
+<rdf:Description rdf:about='uuid:0ce9113a-b19e-11e3-0000-5f8f5c7fffa5' xmlns:xmp='http://ns.adobe.com/xap/1.0/'><xmp:ModifyDate>2014-03-19T09:43:32+01:00</xmp:ModifyDate>
+<xmp:CreateDate>2014-03-19T09:43:32+01:00</xmp:CreateDate>
+<xmp:CreatorTool>ChemDraw Ultra(tm) 11.0d1</xmp:CreatorTool></rdf:Description>
+<rdf:Description rdf:about='uuid:0ce9113a-b19e-11e3-0000-5f8f5c7fffa5' xmlns:xapMM='http://ns.adobe.com/xap/1.0/mm/' xapMM:DocumentID='uuid:0ce9113a-b19e-11e3-0000-5f8f5c7fffa5'/>
+<rdf:Description rdf:about='uuid:0ce9113a-b19e-11e3-0000-5f8f5c7fffa5' xmlns:dc='http://purl.org/dc/elements/1.1/' dc:format='application/pdf'><dc:title><rdf:Alt><rdf:li xml:lang='x-default'>Ru=CH2.eps</rdf:li></rdf:Alt></dc:title></rdf:Description>
+</rdf:RDF>
+</x:xmpmeta>
+
+
+<?xpacket end='w'?>
+endstream
+endobj
+2 0 obj
+<</Producer(GPL Ghostscript 9.05)
+/CreationDate(D:20140319094332+01'00')
+/ModDate(D:20140319094332+01'00')
+/Creator(ChemDraw Ultra\(tm\) 11.0d1)
+/Title(Ru=CH2.eps)>>endobj
+xref
+0 14
+0000000000 65535 f
+0000000451 00000 n
+0000003405 00000 n
+0000000392 00000 n
+0000000243 00000 n
+0000000015 00000 n
+0000000224 00000 n
+0000000516 00000 n
+0000000617 00000 n
+0000000920 00000 n
+0000000557 00000 n
+0000000587 00000 n
+0000001187 00000 n
+0000001975 00000 n
+trailer
+<< /Size 14 /Root 1 0 R /Info 2 0 R
+/ID [<B2D7A49DD16B27D21CA92995781691DC><B2D7A49DD16B27D21CA92995781691DC>]
+>>
+startxref
+3585
+%%EOF
diff --git a/Master/texmf-dist/doc/latex/chemschemex/chemschemex.pdf b/Master/texmf-dist/doc/latex/chemschemex/chemschemex.pdf
new file mode 100644
index 00000000000..ec0013a4ac6
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/chemschemex/chemschemex.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/chemschemex/cp.pdf b/Master/texmf-dist/doc/latex/chemschemex/cp.pdf
new file mode 100644
index 00000000000..d709a82f1df
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/chemschemex/cp.pdf
@@ -0,0 +1,84 @@
+%PDF-1.4
+%쏢
+5 0 obj
+<</Length 6 0 R/Filter /FlateDecode>>
+stream
+xUM!XağcWh
+cu&.|=z}6=_*~v`Np غbtC%VlH1);4$EY.Ju*,$dc)Cr:gηYսrq\N3Nɢ[
+H92@Eendstream
+endobj
+6 0 obj
+162
+endobj
+4 0 obj
+<</Type/Page/MediaBox [0 0 29 28]
+/Parent 3 0 R
+/Resources<</ProcSet[/PDF]
+/ExtGState 8 0 R
+>>
+/Contents 5 0 R
+>>
+endobj
+3 0 obj
+<< /Type /Pages /Kids [
+4 0 R
+] /Count 1
+>>
+endobj
+1 0 obj
+<</Type /Catalog /Pages 3 0 R
+/Metadata 9 0 R
+>>
+endobj
+7 0 obj
+<</Type/ExtGState
+/OPM 1>>endobj
+8 0 obj
+<</R7
+7 0 R>>
+endobj
+9 0 obj
+<</Type/Metadata
+/Subtype/XML/Length 1352>>stream
+<?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?>
+<?adobe-xap-filters esc="CRLF"?>
+<x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='XMP toolkit 2.9.1-13, framework 1.6'>
+<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:iX='http://ns.adobe.com/iX/1.0/'>
+<rdf:Description rdf:about='uuid:0b54026a-7757-11e2-0000-f9c513ab6907' xmlns:pdf='http://ns.adobe.com/pdf/1.3/' pdf:Producer='GPL Ghostscript 9.05'/>
+<rdf:Description rdf:about='uuid:0b54026a-7757-11e2-0000-f9c513ab6907' xmlns:xmp='http://ns.adobe.com/xap/1.0/'><xmp:ModifyDate>2013-02-12T11:04:10+01:00</xmp:ModifyDate>
+<xmp:CreateDate>2013-02-12T11:04:10+01:00</xmp:CreateDate>
+<xmp:CreatorTool>ChemDraw Ultra(tm) 11.0d1</xmp:CreatorTool></rdf:Description>
+<rdf:Description rdf:about='uuid:0b54026a-7757-11e2-0000-f9c513ab6907' xmlns:xapMM='http://ns.adobe.com/xap/1.0/mm/' xapMM:DocumentID='uuid:0b54026a-7757-11e2-0000-f9c513ab6907'/>
+<rdf:Description rdf:about='uuid:0b54026a-7757-11e2-0000-f9c513ab6907' xmlns:dc='http://purl.org/dc/elements/1.1/' dc:format='application/pdf'><dc:title><rdf:Alt><rdf:li xml:lang='x-default'>E-002.eps</rdf:li></rdf:Alt></dc:title></rdf:Description>
+</rdf:RDF>
+</x:xmpmeta>
+
+
+<?xpacket end='w'?>
+endstream
+endobj
+2 0 obj
+<</Producer(GPL Ghostscript 9.05)
+/CreationDate(D:20130212110410+01'00')
+/ModDate(D:20130212110410+01'00')
+/Creator(ChemDraw Ultra\(tm\) 11.0d1)
+/Title(E-002.eps)>>endobj
+xref
+0 10
+0000000000 65535 f
+0000000454 00000 n
+0000002016 00000 n
+0000000395 00000 n
+0000000266 00000 n
+0000000015 00000 n
+0000000247 00000 n
+0000000518 00000 n
+0000000559 00000 n
+0000000588 00000 n
+trailer
+<< /Size 10 /Root 1 0 R /Info 2 0 R
+/ID [<C10112CEB519A27E84AF08A43C2F96B3><C10112CEB519A27E84AF08A43C2F96B3>]
+>>
+startxref
+2195
+%%EOF
diff --git a/Master/texmf-dist/doc/latex/chemschemex/maleimid.pdf b/Master/texmf-dist/doc/latex/chemschemex/maleimid.pdf
new file mode 100644
index 00000000000..aa4283a8d1b
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/chemschemex/maleimid.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/chemschemex/product.pdf b/Master/texmf-dist/doc/latex/chemschemex/product.pdf
new file mode 100644
index 00000000000..8409065d4f8
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/chemschemex/product.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/chemschemex/product_num.pdf b/Master/texmf-dist/doc/latex/chemschemex/product_num.pdf
new file mode 100644
index 00000000000..da8c531ad3d
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/chemschemex/product_num.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/chemschemex/chemschemex.dtx b/Master/texmf-dist/source/latex/chemschemex/chemschemex.dtx
new file mode 100644
index 00000000000..d51561cfdd7
--- /dev/null
+++ b/Master/texmf-dist/source/latex/chemschemex/chemschemex.dtx
@@ -0,0 +1,2300 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 2014 by Dominik Siegel
+%
+% This file may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either
+% version 1.2 of this license or (at your option) any later
+% version. The latest version of this license is in:
+%
+% http://www.latex-project.org/lppl.txt
+%
+% and version 1.2 or later is part of all distributions of
+% LaTeX version 1999/12/01 or later.
+%%
+%% To produce the documentation, do the following
+%%
+%% latex chemschemex.dtx
+%
+% <package>\NeedsTeXFormat{LaTeX2e}[2005/12/01]
+% <package>\ProvidesPackage{chemschemex}
+% <package>[2014/07/15 v1.0]
+%
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{chemschemex}
+\usepackage{caption}
+\usepackage{float}
+\newfloat{example}{htbp}{los}%
+\floatname{example}{Example}%
+\captionsetup{font={footnotesize},textfont={sf},labelfont={sf,bf}}
+%\captionsetup[example]{singlelinecheck=false}
+\usepackage{sectsty}
+\usepackage[hidelinks]{hyperref}
+\usepackage{fancyvrb}
+\allsectionsfont{\sffamily}
+\GetFileInfo{chemschemex.dtx}
+\EnableCrossrefs
+\CodelineIndex
+\OnlyDescription
+\RecordChanges
+\newstruct[{R=H},{R=Me},{R=Ph}]{maleimid}{maleimid}{Maleimid}{}
+\newstruct{cp}{cyclopentadiene}{Cyclopentadiene}{cp}
+\newstruct[{R=H},{R=Me},{R=Ph}]{product}{}{}{}
+\date{2014/07/15}
+\begin{document}
+ \DocInput{chemschemex.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \CheckSum{0}
+%
+% \CharacterTable
+% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+% Digits \0\1\2\3\4\5\6\7\8\9
+% Exclamation \! Double quote \" Hash (number) \#
+% Dollar \$ Percent \% Ampersand \&
+% Acute accent \' Left paren \( Right paren \)
+% Asterisk \* Plus \+ Comma \,
+% Minus \- Point \. Solidus \/
+% Colon \: Semicolon \; Less than \<
+% Equals \= Greater than \> Question mark \?
+% Commercial at \@ Left bracket \[ Backslash \\
+% Right bracket \] Circumflex \^ Underscore \_
+% Grave accent \` Left brace \{ Vertical bar \|
+% Right brace \} Tilde \~}
+%
+% \changes{v1.0}{2014/07/15}{Initial version}
+%
+% \GetFileInfo{chemschemex.sty}
+%
+%
+% \title{The \CSX{} package\thanks{This document corresponds to \CSX{}~\fileversion{}, dated \filedate.}}
+%
+% \author{Dominik Siegel \\ \texttt{dominik.siegel@yahoo.de}}
+% \newcommand{\CSX}{\textsf{chemschemex}}
+% \newcommand{\FL}{\textsf{fancylabel}}
+% \newcommand{\TikZ}{\textsf{Ti\emph{k}Z}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% The \CSX{} package provides a comfortable method for the typesetting of (chemical) schemes based on \TikZ{} code, including an automatical structure referencing.
+% \end{abstract}
+%
+% \begin{example}
+% \begin{minipage}[c]{0.49\linewidth}
+% \begin{Chemscheme}
+% \struct{maleimid}
+% \RightArrow{\struct{cp}}{DEE}
+% \struct[80\,\%]{product}
+% \end{Chemscheme}
+% \end{minipage}
+% \begin{minipage}[c]{0.5\linewidth}
+%\begin{verbatim}
+%\begin{Chemscheme}
+% \struct{maleimid}
+% \RightArrow{\struct{cp}}{DEE}
+% \struct[80\,\%]{product}
+%\end{Chemscheme}
+%\end{verbatim}
+% \end{minipage}
+% \caption{Chemical scheme (left) produced by a simple code (right).}\label{fig.intro.1}
+% \end{example}
+%
+% \tableofcontents
+%
+% \section{Introduction and motivation}
+% While \LaTeX{} is a powerful tool for mathematical or physical issues the typesetting of chemistry derived problems is still a little bit annoying. When I wrote my thesis in organic chemistry I missed a package which produces chemical schemes as easy as you include a graphic into your document. I simply wanted to draw my structures in \textsc{ChemDraw}, inlcude them into my document and label them.
+%
+% The packages \textsf{chemscheme} and \textsf{chemnum} offer a possibility to rerender image files for this purpose. Nevertheless, they only modify a scheme that already exists. This means, that arrows, margins, alignments and other parameters cannot be defined or changed globally in your document.
+%
+% By using the \TikZ{} and the \FL{} package (which has actually been written as slave of this package) the \CSX{} package meets all these requirements (see example \ref{fig.intro.1}).
+%
+%
+%
+% \section{Usage}
+% \noindent\DescribeMacro{\usepackage}
+% |\usepackage[<options>]{chemschemex}|\vspace{0.5em}
+%
+% \noindent The command above will load the \CSX{} package. It requires the packages \textsf{xkeyval}, \textsf{etextools}, \textsf{xargs}, \textsf{ifthen}, \textsf{suffix}, \TikZ{}, \textsf{graphicx}, and \FL{}. I strongly recommend to read the documentation of the \FL{} package because all referencing functions are provided by this package. It contains a lot of useful options that are not described in this documentation.
+%
+%
+% \newpage
+% \section{User commands}
+%
+% \subsection{Basic commands}
+% \noindent\DescribeMacro{\customstruct}
+% |\customstruct[<TikZ-capt>][<TikZ-obj>]{<capt>}{<obj>}|\vspace{0.5em}
+%
+% \noindent The |\customstruct| command typesets the object \textcolor{red}{|<obj>|} in the first row of a \TikZ{} matrix and the caption \textcolor{blue}{|<capt>|} in the second row. The caption is supposed to be given as comma-separated list of label(s) and text. The two optional arguments |<TikZ-capt>| and |<TikZ-obj>| can be used to pass options to \TikZ{} elements (for further information see section \ref{custom}). All the following structure commands are based on |\customstruct|.
+%
+% \begin{minipage}{0.27\linewidth}
+% \begin{Chemscheme}
+% \customstruct[nodes={draw=blue}]
+% [draw=red]
+% {{{label1:},{text}},{{ll2:},{a longer text}}}
+% {object e.g. image}
+% \end{Chemscheme}
+% \end{minipage}
+% \begin{minipage}{0.6\linewidth}
+% \begin{verbatim}
+% \customstruct[nodes={draw=blue}][draw=red]
+% {{{label1:},{text}},
+% {{ll2:},{a longer text}}}
+% {object e.g. image}
+% \end{verbatim}
+% \end{minipage}
+%
+%
+% \vspace{3ex}\noindent\DescribeMacro{\CSXimage}
+% |\CSXimage[<img-opt>]{<img>}|\vspace{0.5em}
+%
+% \noindent The |\CSXimage| command includes the image |<img>| using the global options |<global-img-opt>| defined by the |image| option (see section \ref{image}) and the options given by |<img-opt>|. This command is used in all the following structure commands and expands to |\includegraphics[<global-img-opt>,<img-opt>]{<img>}|.
+%
+%
+%
+% \subsection{Structure commands}
+% \vspace{3ex}\noindent\DescribeMacro{\struct}
+% |\struct[<capt>][<fam>][<img-opt>][<TikZ-capt>][<TikZ-obj>]{<img>}|\vspace{0.5em}
+%
+% \noindent The |\struct| command inlcudes the image |<img>|, sets a fancylabel (therefore it uses |<img>| as marker and |<fam>| as family, default: |<fam>|=|CSX|; the use of families is described in the \FL{} package) and prints it. If a |<caption>| is given, it will also print the caption behind the label. The macro |\CSXlabelsep| can be changed with the |labelseparator| option.
+%
+% \begin{minipage}{0.2\linewidth}
+% \struct[text]{maleimid}
+% \end{minipage}
+% \begin{minipage}{0.79\linewidth}
+% \begin{verbatim}
+% \struct[text]{maleimid}
+% expands to:
+% \customstruct{{{\fancylabel[CSX]{maleimid}\CSXlabelsep},{}}}
+% {\CSXimage{maleimid}}
+% \end{verbatim}
+% \end{minipage}
+%
+%
+% \newpage
+% \vspace{3ex}\noindent\DescribeMacro{\structalt}
+% |\structalt[<capt>][<fam>][<img-opt>][<TikZ-capt>][<TikZ-obj>]{<img>}{<alt-img>}|\vspace{0.5em}
+%
+% \noindent The |\structalt| command includes an image |<alt-img>| but the labeling corresponds to |<img>|.
+%
+% \begin{minipage}{0.2\linewidth}
+% \structalt{product}{product_num}
+% \end{minipage}
+% \begin{minipage}{0.7\linewidth}
+% \begin{verbatim}
+% \structalt{product}{product_num}
+% expands to:
+% \customstruct{{{\fancylabel[CSX]{product}},{}}}
+% {\CSXimage{product_num}}
+% \end{verbatim}
+% \end{minipage}
+%
+%
+% \vspace{3ex}\noindent\DescribeMacro{\struct*}
+% \noindent\DescribeMacro{\structalt*}
+% |\struct*[<capt>][<fam>][<img-opt>][<TikZ-capt>][<TikZ-obj>]{<img>}|\\
+% |\structalt*[<capt>][<fam>][<img-opt>][<TikZ-capt>][<TikZ-obj>]{<img>}{<alt-img>}|\vspace{0.5em}
+%
+% \noindent The |\struct*| and |\structalt*| commands do the same as the corresponding nonstarred versions but use |\fancylabel*| instead of |\fancylabel|. This means, that a label for this structure will be defined but not printed.
+%
+% \begin{minipage}{0.2\linewidth}
+% \struct*{maleimid}
+% \end{minipage}
+% \begin{minipage}{0.7\linewidth}
+% \begin{verbatim}
+% \struct*{maleimid}
+% expands to:
+% \customstruct{{{\fancylabel*[CSX]{maleimid}},{}}}
+% {\CSXimage{maleimid}}
+% \end{verbatim}
+% \end{minipage}
+%
+%
+% \vspace{3ex}\noindent\DescribeMacro{\struct-}
+% |\struct-[<capt>][<img-opt>][<TikZ-capt>][<TikZ-obj>]{<img>}|\vspace{0.5em}
+%
+% \noindent The |\struct-| command includes an image |<img>| without any labeling.
+%
+% \begin{minipage}{0.2\linewidth}
+% \struct-[text]{maleimid}
+% \end{minipage}
+% \begin{minipage}{0.7\linewidth}
+% \begin{verbatim}
+% \struct-[text]{maleimid}
+% expands to:
+% \customstruct{{{},{text}}}
+% {\CSXimage{maleimid}}
+% \end{verbatim}
+% \end{minipage}
+%
+%
+%
+%
+% \vspace{3ex}\noindent\DescribeMacro{\newstruct}
+% |\newstruct[<sublabels>]{<img>}{<structname>}{<Structname>}{<abbr>}|\vspace{0.5em}
+%
+% \noindent If you want to use substructures you have to define them in the preamble. The optional argument |<sublabels>| is a comma-separated list of subcaptions. Whenever you want to refer to them you just have to use their numbers. In this example the first entry (|R=H|) gets the number 1, the second entry (|R=Me|) gets the number 2 and so on. If you use a structure without substructures it is not necessary to use |\newstruct|. However, the |\newstruct| command defines the name (and Name) und abbreviation of the structure what allows you to use the commands |\structname|, |\Structname| and |\structabbr| for this structure.\vspace{2ex}
+%
+% \begin{minipage}{0.9\linewidth}
+% \begin{verbatim}
+%\newstruct[{R=H},{R=Me},{R=Ph}]{product}{}{}{}
+% \end{verbatim}
+% \end{minipage}
+%
+% \vspace{3ex}\noindent\textbf{Note:} All of the following structure commands assume that |\newstruct| has been used for the filename |<img>| before.
+%
+% \vspace{3ex}\noindent\DescribeMacro{\Struct}
+% |\Struct[<fam>][<img-opt>][<TikZ-capt>][<TikZ-obj>]{<sublabels>}{<img>}|\vspace{0.5em}
+%
+% \noindent To use the |\Struct| command, the structure and its substructure have to be defined by the |\newstruct| command. It inlcudes the image |<img>|, sets the sublabels given in the comma-separated list of |<sublabels>| and prints each sublabel with the subcaption previously given to the |\newstruct| command (one line per sublabel).
+%
+% \begin{minipage}{0.2\linewidth}
+% \Struct{1,2,3}{product}
+% \end{minipage}
+% \begin{minipage}{0.7\linewidth}
+% \begin{verbatim}
+% \Struct{1,2,3}{product}
+% expands to:
+% \customstruct{{{\fancysublabel[CSX]{product}{1}\CSXlabelsep},{R=H}},
+% {{\fancysublabel[CSX]{product}{2}\CSXlabelsep},{R=Me}},
+% {{\fancysublabel[CSX]{product}{3}\CSXlabelsep},{R=Ph}}}
+% {\CSXimage{product}}
+% \end{verbatim}
+% \end{minipage}
+%
+% \vspace{3ex}\noindent\DescribeMacro{\Struct*}
+% |\Struct*[<fam>][<img-opt>][<TikZ-capt>][<TikZ-obj>]{<sublabels>}{<img>}|\vspace{0.5em}
+%
+% \noindent To use the |\Struct*| command, the structure and its substructure have to be defined by the |\newstruct| command. It inlcudes the image |<filename>|, sets the sublabels given in the comma-separated list of |<sublabels>| and prints each sublabel without its subcaption previously given to the |\newstruct| command.
+%
+% \begin{minipage}{0.2\linewidth}
+% \Struct*{1,3}{product}
+% \end{minipage}
+% \begin{minipage}{0.7\linewidth}
+% \begin{verbatim}
+% \Struct*{1,3}{product}
+% expands to:
+% \customstruct{{{\fancysublabel[CSX]{product}{1,3}},{}}}
+% {\CSXimage{product}}
+% \end{verbatim}
+% \end{minipage}
+%
+%
+% \vspace{3ex}\noindent\DescribeMacro{\Structalt}
+% |\Structalt[<fam>][<img-opt>][<TikZ-capt>][<TikZ-obj>]{<sublabels>}{<img>}{<alt-img>}|\vspace{0.5em}
+%
+% \noindent Works like the |\Struct| command but includes the image |<alt-img>|. Labeling corresponds to |<img>|.
+%
+%
+% \vspace{3ex}\noindent\DescribeMacro{\Structalt*}
+% |\Structalt*[<fam>][<img-opt>][<TikZ-capt>][<TikZ-obj>]{<sublabels>}{<img>}{<alt-img>}|\vspace{0.5em}
+%
+% \noindent Works like the |\Struct*| command but includes the image |<alt-img>|. Labeling corresponds to |<img>|.
+%
+%
+% \vspace{3ex}\noindent\DescribeMacro{\structname}
+% |\structname{<img>}|\vspace{0.5em}
+%
+% \noindent Prints the name of the structure |<img>| that has been previously defined by the |\newstruct| command. This command is recommended for the chemical name without a leading capital letter (inside a sentence).
+%
+%
+% \vspace{3ex}\noindent\DescribeMacro{\Structname}
+% |\Structname{<img>}|\vspace{0.5em}
+%
+% \noindent Prints the name of the structure |<img>| that has been previously defined by the |\newstruct| command. This command is recommended for the chemical name with a leading capital letter (at the beginning of a sentence).
+%
+%
+% \vspace{3ex}\noindent\DescribeMacro{\structabbr}
+% |\structabbr{<img>}|\vspace{0.5em}
+%
+% \noindent Prints the abbreviation of the structure |<img>| that has been previously defined by the |\newstruct| command.
+%
+%
+%
+%
+% \subsection{The Chemscheme environment}
+%
+% \noindent\DescribeEnv{Chemscheme}
+% |\begin{Chemscheme}...structure code...\end{Chemscheme}|\vspace{0.5em}
+%
+% \noindent If a structure command appears outside a |Chemscheme| environment each command will typeset the image and caption in its own matrix. This causes no kind of adjustment.
+%
+% \begin{minipage}{0.3\linewidth}
+% \struct{cp}
+% \struct[long caption]{maleimid}
+% \end{minipage}
+% \begin{minipage}{0.59\linewidth}
+% \begin{verbatim}
+% \struct{cp}
+% \struct[long caption]{maleimid}
+% \end{verbatim}
+% \end{minipage}
+%
+% \noindent But if structure commands appear inside a |Chemscheme| environment all images and captions are printed in one matrix. This causes adjustment of the image (by default center) and the caption row (by default top) according to the \TikZ{} style |CSXmatrix|.
+%
+%
+% \begin{minipage}{0.3\linewidth}
+% \begin{Chemscheme}
+% \struct{cp}
+% \struct[long caption]{maleimid}
+% \end{Chemscheme}
+% \end{minipage}
+% \begin{minipage}{0.59\linewidth}
+% \begin{verbatim}
+% \begin{Chemscheme}
+% \struct{cp}
+% \struct[long caption]{maleimid}
+% \end{Chemscheme}
+% \end{verbatim}
+% \end{minipage}
+%
+%
+% \vspace{3ex}\noindent\DescribeMacro{\ChemschemeNextRow}
+% |\ChemschemeNextRow[<row-sep>]|\vspace{0.5em}
+%
+% \noindent If you want to use the matrix adjustment over multiple lines you can produce a 'linebreak' using the |\ChemschemeNextRow| command. The optional argument |<row-sep>| allows you to define the space between the rows.
+%
+% \begin{minipage}[c]{0.49\linewidth}
+% \begin{Chemscheme}
+% \struct{maleimid}
+% \RightArrow{\struct{cp}}{DEE}
+% \struct[80\,\%]{product}
+% \ChemschemeNextRow[10pt]
+% \struct[80\,\%]{product}
+% \LeftArrow{\struct{cp}}{DEE}
+% \struct{maleimid}
+% \end{Chemscheme}
+% \end{minipage}
+% \begin{minipage}[c]{0.5\linewidth}
+%\begin{verbatim}
+%\begin{Chemscheme}
+% \struct{maleimid}
+% \RightArrow{\struct{cp}}{DEE}
+% \struct[80\,\%]{product}
+% \ChemschemeNextRow[10pt]
+% \struct[80\,\%]{product}
+% \LeftArrow{\struct{cp}}{DEE}
+% \struct{maleimid}
+%\end{Chemscheme}
+%\end{verbatim}
+% \end{minipage}
+%
+% \begin{minipage}[c]{0.49\linewidth}
+% \begin{Chemscheme}
+% \struct{maleimid}
+% \RightArrow{\struct{cp}}{DEE}
+% \struct[80\,\%]{product}
+% \end{Chemscheme}
+% \begin{Chemscheme}
+% \struct[80\,\%]{product}
+% \LeftArrow{\struct{cp}}{DEE}
+% \struct{maleimid}
+% \end{Chemscheme}
+% \end{minipage}
+% \begin{minipage}[c]{0.5\linewidth}
+%\begin{verbatim}
+%\begin{Chemscheme}
+% \struct{maleimid}
+% \RightArrow{\struct{cp}}{DEE}
+% \struct[80\,\%]{product}
+%\end{Chemscheme}
+%\begin{Chemscheme}
+% \struct[80\,\%]{product}
+% \LeftArrow{\struct{cp}}{DEE}
+% \struct{maleimid}
+%\end{Chemscheme}
+%\end{verbatim}
+% \end{minipage}
+%
+%
+%
+% \vspace{3ex}\noindent\DescribeMacro{\CSXcommands}
+% |\CSXcommands{<TikZ-code>}|\vspace{0.5em}
+%
+% \noindent The |CSXcommands| macro allows you to draw any \TikZ{} element(s) after the typesetting of the structure matrix.
+%
+% \hspace{-30pt}\begin{minipage}[c]{0.39\linewidth}
+% \begin{Chemscheme}
+% \struct{maleimid}
+% \RightArrow{\struct{cp}}{DEE}
+% \Struct{1,2}{product}
+% \CSXcommands{\draw[->,CSXallarrows,draw=red]
+% (Scheme\theCSXscheme Caption3Entry1.west) to
+% ([xshift=-8pt]Scheme\theCSXscheme Caption3Entry1.west) to
+% node[auto,swap,CSXlabelfont,red]{a}
+% ([xshift=-8pt]Scheme\theCSXscheme Caption3Entry2.west) to
+% (Scheme\theCSXscheme Caption3Entry2.west);}
+% \end{Chemscheme}
+% \end{minipage}
+% \begin{minipage}[c]{0.6\linewidth}
+%\begin{verbatim}
+%\begin{Chemscheme}
+% \struct{maleimid}
+% \RightArrow{\struct{cp}}{DEE}
+% \Struct{1,2}{product}
+% \CSXcommands{
+% \draw[->,CSXallarrows,draw=red]
+% (Scheme\theCSXscheme Caption3Entry1.west) to
+% ([xshift=-8pt]Scheme\theCSXscheme Caption3Entry1.west) to
+% node[auto,swap,CSXlabelfont,red]{a}
+% ([xshift=-8pt]Scheme\theCSXscheme Caption3Entry2.west) to
+% (Scheme\theCSXscheme Caption3Entry2.west);
+% }
+%\end{Chemscheme}
+%\end{verbatim}
+% \end{minipage}
+%
+%
+%
+% \newpage
+% \subsection{Ref commands}
+% \noindent\DescribeMacro{\structref}
+% \noindent\DescribeMacro{\structref*}
+% \noindent\DescribeMacro{\structsubref}
+% \noindent\DescribeMacro{\structsubref-}
+% \noindent\DescribeMacro{\structsubref*}
+% |\structref[<fam>]{<img>}|\\
+% |\structref*[<fam>]{<img>}|\\
+% |\structsubref[<fam>]{<img>}{<sublabels>}|\\
+% |\structsubref-[<fam>]{<img>}{<sublabels>}|\\
+% |\structsubref*[<fam>]{<img>}{<sublabels>}|\vspace{0.5em}
+%
+% \noindent The \CSX{} package defines ref commands that actually do exactly what their analogs from the \FL{} package do, but with |CSX| as default family.\footnote{For further information please have a look into the \textsf{fancylabel} package documentation.}
+%
+%
+%
+% \vspace{3ex}\noindent\DescribeMacro{\CSXstructref}
+% \noindent The |\CSXstructref| macro allows you to change the style of all referencing commands that are shown above. The definition is shown below and may be changed as required.
+%\begin{verbatim}
+% \newcommand{\CSXstructref}[1]{%
+% % #1=fancyref command
+% \textbf{#1}%
+% }
+%\end{verbatim}
+%
+%
+% \subsection{Arrows and simples}
+%
+% \noindent\DescribeMacro{\customarrow}
+% |\customarrow[<length>]{<style>}{<upper-capt>}{<lower-capt>}|\vspace{0.5em}
+%
+% \noindent The basic command for arrows is the |\customarrow| command. If the optional argument |<length>| is used, the arrow will have this length. Otherwise the arrow is stretched to the length of the widest caption advanced by the length globally defined via the |arrowadvance| option. The style argument |<style>| allows you to pass options to the \TikZ{} |\draw| command.\vspace{1em}
+%
+% \begin{minipage}{0.25\linewidth}
+% \customarrow{->,line width=1pt}{this is a long caption}{short}
+% \end{minipage}
+% \begin{minipage}{0.74\linewidth}
+% \begin{verbatim}
+% \customarrow{->,line width=1pt}
+% {this is a long caption}
+% {short}
+% \end{verbatim}
+% \end{minipage}
+%
+% \begin{minipage}{0.25\linewidth}
+% \customarrow[60pt]{->,CSXarrowupper/.append style={red}}{this is a long caption}{short}
+% \end{minipage}
+% \begin{minipage}{0.74\linewidth}
+% \begin{verbatim}
+% \customarrow[60pt]
+% {->,CSXarrowupper/.append style={red}}
+% {this is a long caption}
+% {short}
+% \end{verbatim}
+% \end{minipage}
+%
+%
+% \noindent\DescribeMacro{\RightArrow}
+% \noindent\DescribeMacro{\<arrow-cmd>}
+% |\RightArrow[<length>]{<upper-capt>}{<lower-capt>}|\\
+% |\<arrow-cmd>[<length>]{<upper-capt>}{<lower-capt>}|\vspace{0.5em}
+%
+% \noindent The table below shows a couple of arrows that are based on the |\customarrow| command. You might define some other arrows using the |\CSXdeclarearrow| command.
+%
+% {
+% \newcommand{\CSXarrowtablex}[2][60pt]{
+% \CSXarrowtable[#1]{#2}
+% \CSXarrowtable[#1]{C#2}
+% \CSXarrowtable[#1]{S#2}
+% \CSXarrowtable[#1]{DS#2}
+% }
+% \newcommand{\CSXarrowtable}[2][60pt]{
+% \csname #2\endcsname[#1]{}{\textbackslash #2}
+% }
+% \def\CSXarrowadvance{0pt}
+% \tikzset{%
+% CSXarrowfont/.style={%
+% font={\tiny\sffamily},%
+% },%
+% CSXmatrix/.style={%
+% column sep=20pt,%
+% row sep=5pt,%
+% }%
+% }
+% \begin{Chemscheme}
+% \CSXarrowtablex{RightArrow}\ChemschemeNextRow
+% \CSXarrowtablex{RightArrowDashed}
+% \end{Chemscheme}
+%
+% \noindent All shown arrows have a normal, a crossed out (leading |C|), a striked out (leading |S|) and a double striked out (leading |DS|) version of the solid and the dashed (appending |Dashed|) arrow.
+%
+% \begin{Chemscheme}
+% \CSXarrowtable{RightArrow}
+% \CSXarrowtable{LeftArrow}
+% \CSXarrowtable{LeftRightArrow}\ChemschemeNextRow
+% \CSXarrowtable{DoubleRightArrow}
+% \CSXarrowtable{DoubleLeftArrow}
+% \CSXarrowtable{DoubleLeftRightArrow}\ChemschemeNextRow
+% \CSXarrowtable{RightupHarpoon}
+% \CSXarrowtable{RightdownHarpoon}
+% \CSXarrowtable{LeftupHarpoon}
+% \CSXarrowtable{LeftdownHarpoon}\ChemschemeNextRow
+% \CSXarrowtable{LeftupRightupHarpoon}
+% \CSXarrowtable{LeftupRightdownHarpoon}
+% \CSXarrowtable{LeftdownRightupHarpoon}
+% \CSXarrowtable{LeftdownRightdownHarpoon}\ChemschemeNextRow
+% \CSXarrowtable{Equilibrium}
+% \CSXarrowtable{RightEquilibrium}
+% \CSXarrowtable{RRightEquilibrium}
+% \CSXarrowtable{LeftEquilibrium}
+% \CSXarrowtable{LLeftEquilibrium}\ChemschemeNextRow
+% \CSXarrowtable{TwoRightArrow}
+% \CSXarrowtable{TTwoRightArrow}
+% \CSXarrowtable{TwoLeftArrow}
+% \CSXarrowtable{TTwoLeftArrow}\ChemschemeNextRow
+% \CSXarrowtable{ThreeRightArrow}
+% \CSXarrowtable{TThreeRightArrow}
+% \CSXarrowtable{ThreeLeftArrow}
+% \CSXarrowtable{TThreeLeftArrow}
+% \end{Chemscheme}
+% }
+%
+%
+% \vspace{3ex}\noindent\DescribeMacro{\CSXdeclarearrow}
+% |\CSXdeclarearrow{<arrow-cmd>}{<style>}|\vspace{0.5em}
+%
+% \noindent You can use the |\CSXdeclarearrow| command to declare arrows based on the customstruct command. The definition of |\RightArrow| is:
+%
+% \begin{verbatim}
+% \CSXdeclarearrow{\RightArrow}{CSXnormalarrows,CSXRightArrow}
+% \end{verbatim}
+%
+% \noindent Considering the default setting of |CSXnormalarrows| and |CSXRightArrow| this means:
+%
+% \begin{verbatim}
+% \CSXdeclarearrow{\RightArrow}{line width=0.7pt,->}
+% \end{verbatim}
+%
+%
+% \noindent\DescribeMacro{\structplus}
+% \noindent\DescribeMacro{\structminus}
+% |\structplus|\\
+% |\structminus|\vspace{0.5em}
+%
+% \noindent The simples (this is how I call arrow-like elements without a upper or lower caption) |\structplus| and |\structminus| can be used like any structure or arrow command:
+%
+% \begin{minipage}{0.59\linewidth}
+% \begin{Chemscheme}
+% \struct{maleimid}
+% \structplus
+% \struct{cp}
+% \RightArrow{}{DEE}
+% \struct{product}
+% \end{Chemscheme}
+% \end{minipage}
+% \begin{minipage}{0.35\linewidth}
+% \begin{verbatim}
+% \begin{Chemscheme}
+% \struct{maleimid}
+% \structplus
+% \struct{cp}
+% \RightArrow{}{DEE}
+% \struct{product}
+% \end{Chemscheme}
+% \end{verbatim}
+% \end{minipage}
+%
+%
+%
+%
+% \section{Options}
+% \subsection{The image option}\label{image}
+% \noindent\DescribeMacro{image=}
+% |\usepackage[image={<global-img-opt>}]{chemschemex}|\vspace{0.5em}
+%
+% \noindent All structure commands except |\customstruct| internally use the |\CSXimage| command to include pictures with |\includegraphics|. The |image| option allows you to define options that will be passed to any image that is inserted via |\CSXimage|. The default value is |image={scale=0.7}|.
+%
+%
+% \subsection{The labelseparator option}
+% \noindent\DescribeMacro{labelseparator=}
+% |\usepackage[labelseparator=<value>]{chemschemex}|\vspace{0.5em}
+%
+% \noindent The |<value>| given by the |labelseparator| option is set behind every |\fancylabel| inside a structure command if some text follows. The value is saved in |\CSXlabelsep|. The default value is |labelseparator={:\,}|.
+%
+%\begin{Chemscheme}
+% \struct[text]{maleimid}
+% \CSXcommands{%
+% \draw[<-,draw=red]([xshift=-2pt]Scheme\theCSXscheme Caption1Entry1.one split south)%
+% to ([xshift=-2pt,yshift=-10pt]Scheme\theCSXscheme Caption1Entry1.one split south) node[yshift=-3pt,font={\tiny\sffamily}]{\textcolor{red}{labelseparator}};
+% }
+%\end{Chemscheme}
+%
+%
+%
+%
+% \subsection{The arrowadvance option}
+% \noindent\DescribeMacro{arrowadvance=}
+% |\usepackage[arrowadvance=<length>]{chemschemex}|\vspace{0.5em}
+%
+% \noindent Every arrow with undefined length argument will be as long as its widest caption plus the length given by the |arrowadvance| option. This is also the minimal length of an arrow (when no captions are given). The default value is |arrowadvance=10pt|.
+%
+%
+%
+%
+% \section{Customization and advanced examples}
+% \subsection{Predefined \TikZ{} styles}\label{custom}
+%
+% \noindent There are a lot of \TikZ{} styles that are already defined by the \CSX{} package. The following two examples show the code that is generated by \CSX{} and hopefully help you to understand the function of each style. Some of them can be changed (\textcolor{green!75!black}{green}), some of them must not be changed (\textcolor{red}{red}) to prevent strange results or even errors. If you want to change fonts please use the \textcolor{blue}{blue} coloured styles instead of appending |font=| to any style since this will cause wrong calculations. The \textcolor{orange}{orange} entries are styles that are optional arguments of |\customstruct|.
+%
+% \begin{minipage}{0.16\linewidth}
+% \customstruct{{{text}}}{\CSXimage{maleimid}}
+% \end{minipage}
+% \begin{minipage}{0.7\linewidth}
+% \begin{verbatim}
+% \customstruct{{{text}}}{\CSXimage{maleimid}}
+% \end{verbatim}
+% \end{minipage}
+%
+% \newcommand{\textred}[1]{\textcolor{red}{#1}}
+% \newcommand{\textblue}[1]{\textcolor{blue}{#1}}
+% \newcommand{\textorange}[1]{\textcolor{orange}{#1}}
+% \newcommand{\textgreen}[1]{\textcolor{green!75!black}{#1}}
+% \begin{Verbatim}[gobble=1,fontsize=\small,commandchars=!*~]
+%\begin{tikzpicture}[!textgreen*CSX~]
+% \matrix [!textgreen*CSXmatrix~]{
+% % Image row
+% \node[!textorange*<TikZ-obj>~]
+% (Scheme1Image1)
+% {\CSXimage{maleimid}};\\
+% % Caption row
+% \node(Scheme1Caption1)
+% {\tikz[!textgreen*CSXcaption~,!textorange*<TikZ-capt>~]
+% {\node[!textblue*CSXtextfont~,!textred*CSXsettextwidth~,!textgreen*CSXcaptionTextOnly~]
+% (Scheme1Caption1Entry1)
+% {text};
+% }
+% };\\
+% };
+%\end{tikzpicture}
+% \end{Verbatim}
+%
+%
+%
+% \vspace{3ex}\begin{minipage}{0.42\linewidth}
+% \begin{Chemscheme}
+% \customstruct{{{text}}}{\CSXimage{maleimid}}
+% \RightArrow{\customstruct{{{1},{}}}{\CSXimage{cp}}}{DEE}
+% \customstruct{{{label 1},{text 1}},
+% {{label 2},{text 2}},
+% {text 3}}
+% {\CSXimage{product}}
+% \end{Chemscheme}
+% \end{minipage}
+% \begin{minipage}{0.56\linewidth}
+% \begin{verbatim}
+% \begin{Chemscheme}
+% \customstruct{{{text}}}{\CSXimage{maleimid}}
+% \RightArrow{\customstruct{{{1},{}}}
+% {\CSXimage{cp}}}{DEE}
+% \customstruct{{{label 1},{text 1}},
+% {{label 2},{text 2}},
+% {text 3}}
+% {\CSXimage{product}}
+% \end{Chemscheme}
+% \end{verbatim}
+% \end{minipage}
+%
+% \begin{Verbatim}[gobble=1,fontsize=\small,commandchars=!*~]
+%\begin{tikzpicture}[!textgreen*CSX~]
+% \matrix [!textgreen*CSXmatrix~]{
+% % Image row
+% \node[!textorange*<TikZ-obj>~]
+% (Scheme1Image1)
+% {\CSXimage{maleimid}};&
+% \node(Scheme1Image2)
+% {\hbox to <arrowlength>{}};&
+% \node[!textorange*<TikZ-obj>~]
+% (Scheme1Image3)
+% {\CSXimage{product}};\\
+% % Caption row
+% \node(Scheme1Caption1)
+% {\tikz[!textgreen*CSXcaption~,!textorange*<TikZ-capt>~]
+% {\node[!textblue*CSXtextfont~,!textred*CSXsettextwidth~,!textgreen*CSXcaptionTextOnly~]
+% (Scheme1Caption1Entry1)
+% {text};
+% }
+% };&
+% \node(Scheme1Caption2)
+% {};&
+% \node(Scheme1Caption3)
+% {\tikz[!textgreen*CSXcaption~,!textorange*<TikZ-capt>~]
+% {\node[!textblue*CSXlabelfont~,!textred*CSXsetlabelwidth~,!textgreen*CSXcaptionLabelandText~,
+% rectangle split,rectangle split horizontal,
+% rectangle split parts=2,rectangle split part align=base,
+% every two node part/.style={!textblue*CSXtextfont~,!textred*CSXsettextwidth~}]
+% (Scheme1Caption3Entry1)
+% {label 1\nodepart{two}text 1};
+% \node[!textblue*CSXlabelfont~,!textred*CSXsetlabelwidth~,!textgreen*CSXcaptionLabelandText~,
+% rectangle split,rectangle split horizontal,
+% rectangle split parts=2,rectangle split part align=base,
+% every two node part/.style={!textblue*CSXtextfont~,!textred*CSXsettextwidth~}
+% below left=of Scheme1Caption3Entry1.one split south,
+% anchor=one split north]
+% (Scheme1Caption3Entry2)
+% {label 2\nodepart{two}text 2};
+% \node[!textblue*CSXtextfont~,!textred*CSXsettextwidth~,!textgreen*CSXcaptionTextOnly~%
+% below=of Scheme1Caption3Entry2.south]
+% (Scheme1Caption3Entry3)
+% {text 3};
+% }
+% };\\
+% };
+% \draw[!textgreen*CSXallarrows~,CSXRightArrow,text width=(<arrowlength>-\CSXarrowadvance)]
+% ([CSXshiftA]Scheme1Image2.west) to
+% node(Scheme1Image2Upper)
+% [!textblue*CSXarrowfont~,!textgreen*CSXarrowupper~,auto]
+% {\tikz[remember picture,!textgreen*CSXStructInArrow~]
+% {\node[!textorange*<TikZ-obj>~]
+% (Scheme1Image2UpperImage1)
+% {\CSXimage{cp}};
+% \node[below=of Scheme1Image2UpperImage1]
+% (Scheme1Image2UpperCaption1)
+% {\tikz[CSXcaption,!textorange*<TikZ-capt>~]
+% {\node[!textblue*CSXlabelfont~,!textred*CSXsetlabelwidth~,
+% !textgreen*CSXcaptionLabelandText~,rectangle split,
+% rectangle split horizontal,
+% rectangle split parts=2,
+% rectangle split part align=base,
+% every two node part/.style={
+% !textblue*CSXtextfont~,
+% !textred*CSXsettextwidth~
+% }]
+% (Scheme1Image2UpperCaption1Entry1)
+% {1\nodepart{two}};
+% }
+% };
+% }
+% }
+% node(Scheme1Image2Lower)
+% [!textblue*CSXarrowfont~,!textgreen*CSXarrowlower~,auto,swap]
+% {DEE}
+% ([CSXshiftB]Scheme1Image2.east);
+%\end{tikzpicture}
+% \end{Verbatim}
+%
+% \subsection{Style adjustment -- some examples}
+%
+% \noindent As already mentioned above, please use the styles \textblue{|CSXlabelfont|} and \textblue{|CSXtextfont|} for any changes of the node font. This is necessary to ensure correct measurements. For local font adjustment of captions in structure commands use the optional argument \textorange{|<TikZ-capt>|}.
+%
+% \begin{minipage}{0.15\linewidth}
+% \struct[text]{maleimid}
+% \end{minipage}
+% \begin{minipage}{0.75\linewidth}
+% \begin{Verbatim}[gobble=1,fontsize=\small]
+%\struct[text]{maleimid}
+% \end{Verbatim}
+% \end{minipage}
+%
+% \begin{minipage}{0.15\linewidth}
+% \struct[text][][][CSXlabelfont/.style={red,font={\large}}]{maleimid}
+% \end{minipage}
+% \begin{minipage}{0.75\linewidth}
+% \begin{Verbatim}[gobble=1,fontsize=\small]
+%\struct[text]
+% []
+% []
+% [CSXlabelfont/.style={red,font={\large}}]
+% {maleimid}
+% \end{Verbatim}
+% \end{minipage}
+%
+% \begin{minipage}{0.15\linewidth}
+% \struct[text][][][nodes={draw=green},CSXtextfont/.style={blue,font={\large}}]{maleimid}
+% \end{minipage}
+% \begin{minipage}{0.75\linewidth}
+% \begin{Verbatim}[gobble=1,fontsize=\small]
+%\struct[text]
+% []
+% []
+% [nodes={draw=green},
+% CSXtextfont/.style={blue,font={\large}}]
+% {maleimid}
+% \end{Verbatim}
+% \end{minipage}
+%
+% \begin{minipage}{0.15\linewidth}
+% \struct[][][scale=1.5][][draw=red]{maleimid}
+% \end{minipage}
+% \begin{minipage}{0.75\linewidth}
+% \begin{Verbatim}[gobble=1,fontsize=\small]
+%\struct[][][scale=1.5][][draw=red]{maleimid}
+% \end{Verbatim}
+% \end{minipage}
+%
+%
+% \subsection{Chemical mechanisms}
+% \noindent For more complex chemical mechanisms you can either use the matrix provided by the |Chemscheme| environment or the internal commands |\CSXimage| and |\fancylabel|:
+%
+% {
+%\tikzset{
+% CSXmatrix/.append style={
+% column sep=30pt,
+% }
+%}
+% \begin{Chemscheme}
+% \struct{R2-CH=CH-R1}
+% \struct{Ru=CH2}
+% \struct{R1-CH=CH2}\ChemschemeNextRow[20pt]
+% \struct{CH2=CH-R2}
+% \struct{Ru=CH-R1}
+% \struct{C2H4}
+% \CSXcommands{
+% \draw[->,draw=blue] (Scheme\theCSXscheme Image4)
+% to [bend right=90,distance=22pt] (Scheme\theCSXscheme Image1);
+% \draw[->,draw=red] (Scheme\theCSXscheme Image5)
+% to [bend right=-90,distance=22pt] (Scheme\theCSXscheme Image2);
+% \draw[->,draw=orange] (Scheme\theCSXscheme Image2)
+% to [bend right=-90,distance=22pt] (Scheme\theCSXscheme Image5);
+% \draw[->,draw=green!75!black] (Scheme\theCSXscheme Image3)
+% to [bend right=90,distance=22pt] (Scheme\theCSXscheme Image6);
+% }
+% \end{Chemscheme}
+% }
+%
+% \begin{Verbatim}[gobble=1,fontsize=\small,commandchars=?*~]
+%\tikzset{CSXmatrix/.append style={column sep=30pt}}
+%\begin{Chemscheme}
+% \struct{R2-CH=CH-R1}
+% \struct{Ru=CH2}
+% \struct{R1-CH=CH2}\ChemschemeNextRow[20pt]
+% \struct{CH2=CH-R2}
+% \struct{Ru=CH-R1}
+% \struct{C2H4}
+% \CSXcommands{
+% \draw[->,?textblue*draw=blue~] (Scheme\theCSXscheme Image4)
+% to [bend right=90,distance=22pt] (Scheme\theCSXscheme Image1);
+% \draw[->,?textred*draw=red~] (Scheme\theCSXscheme Image5)
+% to [bend right=-90,distance=22pt] (Scheme\theCSXscheme Image2);
+% \draw[->,?textorange*draw=orange~] (Scheme\theCSXscheme Image2)
+% to [bend right=-90,distance=22pt] (Scheme\theCSXscheme Image5);
+% \draw[->,?textgreen*draw=green!75!black~] (Scheme\theCSXscheme Image3)
+% to [bend right=90,distance=22pt] (Scheme\theCSXscheme Image6);
+% }
+%\end{Chemscheme}
+% \end{Verbatim}
+%
+% \tikz[node distance=1pt,mycaption/.style={CSXlabelfont}]{
+% \node (n) at (0,2){\CSXimage{Ru=CH2}};
+% \node (ncapt) [mycaption,below=of n] {\fancylabel[CSX]{Ru=CH2}};
+% \node (s) at (0,-2){\CSXimage{Ru=CH-R1}};
+% \node (scapt) [mycaption,below=of s] {\fancylabel[CSX]{Ru=CH-R1}};
+% \node (nw) at (-4,1){\CSXimage{R2-CH=CH-R1}};
+% \node (nwcapt) [mycaption,below=of nw] {\fancylabel[CSX]{R2-CH=CH-R1}};
+% \node (sw) at (-4,-1){\CSXimage{CH2=CH-R2}};
+% \node (swcapt) [mycaption,below=of sw] {\fancylabel[CSX]{CH2=CH-R2}};
+% \node (ne) at (4,1){\CSXimage{R1-CH=CH2}};
+% \node (necapt) [mycaption,below=of ne] {\fancylabel[CSX]{R1-CH=CH2}};
+% \node (se) at (4,-1){\CSXimage{C2H4}};
+% \node (ecapt) [mycaption,below=of se] {\fancylabel[CSX]{C2H4}};
+% \node (w) at (-2.5,0) {};
+% \node (e) at (2.5,0) {};
+% \draw [->] (s) to [out=180,in=270] (w) to [out=90,in=180] (n);
+% \draw [->] (n) to [out=0,in=90] (e) to [out=270,in=0] (s);
+% \draw [->] (sw) to [out=0,in=270] (w) to [out=90,in=0] (nw);
+% \draw [->] (ne) to [out=180,in=90] (e) to [out=270,in=180] (se);
+% }
+%
+% \begin{Verbatim}[gobble=1,fontsize=\small,commandchars=?*~]
+% \tikz[node distance=1pt,mycaption/.style={CSXlabelfont}]{
+% \node (n) at (0,2){\CSXimage{Ru=CH2}};
+% \node (ncapt) [mycaption,below=of n] {\fancylabel[CSX]{Ru=CH2}};
+% \node (s) at (0,-2){\CSXimage{Ru=CH-R1}};
+% \node (scapt) [mycaption,below=of s] {\fancylabel[CSX]{Ru=CH-R1}};
+% \node (nw) at (-4,1){\CSXimage{R2-CH=CH-R1}};
+% \node (nwcapt) [mycaption,below=of nw] {\fancylabel[CSX]{R2-CH=CH-R1}};
+% \node (sw) at (-4,-1){\CSXimage{CH2=CH-R2}};
+% \node (swcapt) [mycaption,below=of sw] {\fancylabel[CSX]{CH2=CH-R2}};
+% \node (ne) at (4,1){\CSXimage{R1-CH=CH2}};
+% \node (necapt) [mycaption,below=of ne] {\fancylabel[CSX]{R1-CH=CH2}};
+% \node (se) at (4,-1){\CSXimage{C2H4}};
+% \node (ecapt) [mycaption,below=of se] {\fancylabel[CSX]{C2H4}};
+% \node (w) at (-2.5,0) {};
+% \node (e) at (2.5,0) {};
+% \draw [->] (s) to [out=180,in=270] (w) to [out=90,in=180] (n);
+% \draw [->] (n) to [out=0,in=90] (e) to [out=270,in=0] (s);
+% \draw [->] (sw) to [out=0,in=270] (w) to [out=90,in=0] (nw);
+% \draw [->] (ne) to [out=180,in=90] (e) to [out=270,in=180] (se);
+% }
+% \end{Verbatim}
+%
+%
+%
+% \StopEventually{}
+%
+% \section{The implementation}
+% \subsection{Identification}
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}[2005/12/01]
+\ProvidesPackage{chemschemex}[2014/07/15 v1.0 Typeset chemical schemes]
+% \end{macrocode}
+%
+% \subsection{Loading packages and define counter formats}
+% \begin{macrocode}
+\RequirePackage{xkeyval}
+\RequirePackage{etextools}
+\RequirePackage{xargs}
+\RequirePackage{ifthen}
+\RequirePackage{suffix}
+\RequirePackage{fancylabel}
+\fancyref@DefineFamily{}{CSX}
+\def\fancylabelformatCSX{\arabic{fancylabel}}%
+\def\fancysublabelformatCSX{\arabic{fancylabel}\alph{fancysublabel}}%
+\def\fancyonlysublabelformatCSX{\alph{fancysublabel}}%
+\RequirePackage{graphicx}
+\RequirePackage{tikz}
+\usetikzlibrary{%
+ shapes.multipart,%
+ decorations,%
+ decorations.markings,%
+ positioning,%
+ arrows.meta%
+}
+% \end{macrocode}
+%
+% \subsection{The options}
+% \begin{macro}{image=}
+% \begin{macrocode}
+\define@key{chemschemex}{image}{%
+ % #1=additional options
+ % #2=filename of the image
+ \newcommand{\CSXimage}[2][]{%
+ \includegraphics[#1,##1]{##2}%
+ }
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{labelseparator=}
+% \begin{macrocode}
+\define@key{chemschemex}{labelseparator}{%
+ \def\CSXlabelsep{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{arrowadvance=}
+% \begin{macrocode}
+\define@key{chemschemex}{arrowadvance}{%
+ \def\CSXarrowadvance{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\presetkeys{chemschemex}{%
+ image={scale=0.7},%
+ labelseparator={:\,},%
+ arrowadvance={10pt},%
+}{}
+\ProcessOptionsX<chemschemex>
+% \end{macrocode}
+% \subsection{TikZ styles}
+% \begin{macrocode}
+% TikZ styles that must not be changed
+\tikzset{%
+ CSXsettextwidth/.style={%
+ text width=(%
+ % if
+ (\CSXtextwidth - \CSXimagewidth - \CSXmaxlabelwidth)>0%
+ % then
+ ?(\CSXimagewidth - \CSXmaxlabelwidth)%
+ % else
+ :(\CSXtextwidth+0.00001)%
+ ),%
+ },%
+ CSXsetlabelwidth/.style={%
+ text width=(%
+ % if
+ (\CSXlabelwidth)>0%
+ % then
+ ?(\CSXlabelwidth+0.00001)%
+ % else
+ :(0.00001)%
+ ),%
+ },%
+ CSXshiftA/.style={},%
+ CSXshiftB/.style={},%
+ CSXshiftcompensation/.style={},%
+}
+% TikZ styles that can be changed
+\tikzset{%
+ % TikZ
+ CSX/.style={%
+ remember picture%
+ },%
+ % Matrix
+ CSXmatrix/.style={%
+ column sep=10pt,%
+ row sep=4pt,%
+ nodes={%
+ inner xsep=0pt,%
+ inner ysep=1pt,%
+ outer sep=0pt%
+ },%
+ every odd row/.style={anchor=center},%
+ every even row/.style={anchor=north},%
+ },%
+ % Structure caption
+ CSXcaption/.style={%
+ node distance=0pt,%
+ },%
+ CSXcaptionLabelandText/.style={%
+ align=right,%
+ every two node part/.style={%
+ align=justify%
+ },%
+ },%
+ CSXcaptionTextOnly/.style={%
+ align=justify%
+ },%
+ % Fonts
+ CSXlabelfont/.style={%
+ font={\footnotesize\sffamily\bfseries}%
+ },%
+ CSXtextfont/.style={%
+ font={\footnotesize\sffamily}%
+ },%
+ CSXarrowfont/.style={%
+ font={\footnotesize\sffamily}%
+ },%
+ CSXsimple/.style={%
+ x=3pt,%
+ y=3pt,%
+ line width=0.7pt%
+ },%
+ % Arrows
+ CSXarrowupper/.style={%
+ align=flush center,%
+ },%
+ CSXarrowlower/.style={%
+ align=flush center%
+ },%
+ CSXStructInArrow/.style={%
+ node distance=1pt,%
+ text width=,%
+ inner sep=0pt,%
+ outer sep=0pt%
+ },%
+ CSXallarrows/.style={%
+ x=1pt,y=1pt,%
+ line width=0.7,%
+ inner ysep=3,%
+ >=Classical TikZ Rightarrow,%
+ },%
+ CSXdoublearrows/.style={%
+ double distance=1.5,%
+ >=Implies%
+ },%
+ CSXharpoonup/.style={%
+ >={Classical TikZ Rightarrow[harpoon]}%
+ },%
+ CSXharpoondown/.style={%
+ >={Classical TikZ Rightarrow[harpoon,swap]}%
+ },%
+ CSXRightArrow/.style={%
+ ->%
+ },%
+ CSXRightupHarpoon/.style={%
+ ->[harpoon]%
+ },%
+ CSXRightdownHarpoon/.style={%
+ ->[{harpoon,swap}]%
+ },%
+ CSXLeftArrow/.style={%
+ <-%
+ },%
+ CSXLeftupHarpoon/.style={%
+ <[{harpoon,swap}]-%
+ },%
+ CSXLeftdownHarpoon/.style={%
+ <[harpoon]-%
+ },%
+ CSXLeftRightArrow/.style={%
+ <->%
+ },%
+ CSXLeftupRightupHarpoon/.style={%
+ <[{harpoon,swap}]->[harpoon]%
+ },%
+ CSXLeftupRightdownHarpoon/.style={%
+ <[{harpoon,swap}]->[{harpoon,swap}]%
+ },%
+ CSXLeftdownRightupHarpoon/.style={%
+ <[{harpoon}]->[{harpoon}]%
+ },%
+ CSXLeftdownRightdownHarpoon/.style={%
+ <[{harpoon}]->[{harpoon,swap}]%
+ },%
+ CSXequilibrium/.style={%
+ inner ysep/.expanded=(1+\pgfkeysvalueof{/pgf/inner ysep}),%
+ CSXshiftA/.style={yshift=1},%
+ CSXshiftB/.style={yshift=1},%
+ CSXshiftcompensation/.style={yshift=-1},%
+ postaction=decorate,%
+ decoration={%
+ markings,%
+ mark=at position 0.5 with{%
+ \draw([yshift=-1]\CSXnodename .east) to%
+ ([yshift=-1]\CSXnodename .west);%
+ }%
+ }%
+ },%
+ CSXRightequilibrium/.style={%
+ inner ysep/.expanded=(1+\pgfkeysvalueof{/pgf/inner ysep}),%
+ CSXshiftA/.style={yshift=1},%
+ CSXshiftB/.style={yshift=1},%
+ CSXshiftcompensation/.style={yshift=-1},%
+ postaction=decorate,%
+ decoration={%
+ markings,%
+ mark=at position 0.5 with{%
+ \draw([yshift=-1,xshift=-0.25\CSXarrowlength]\CSXnodename .east) to%
+ ([yshift=-1,xshift=0.25\CSXarrowlength]\CSXnodename .west);%
+ }%
+ }%
+ },%
+ CSXLeftequilibrium/.style={%
+ inner ysep/.expanded=(1+\pgfkeysvalueof{/pgf/inner ysep}),%
+ CSXshiftA/.style={yshift=1,xshift=0.25\CSXarrowlength},%
+ CSXshiftB/.style={yshift=1,xshift=-0.25\CSXarrowlength},%
+ CSXshiftcompensation/.style={yshift=-1},%
+ postaction=decorate,%
+ decoration={%
+ markings,%
+ mark=at position 0.5 with{%
+ \draw([yshift=-1]\CSXnodename .east) to%
+ ([yshift=-1]\CSXnodename .west);%
+ }%
+ }%
+ },%
+ CSXslashtwoarrow/.style={%
+ inner ysep/.expanded=(1.5+\pgfkeysvalueof{/pgf/inner ysep}),%
+ CSXshiftA/.style={yshift=1.5,xshift=5},%
+ CSXshiftB/.style={yshift=1.5},%
+ CSXshiftcompensation/.style={yshift=-1.5,xshift=-2.5},%
+ postaction=decorate,%
+ decoration={%
+ markings,%
+ mark=at position 0.5 with{%
+ \draw([yshift=-1.5]\CSXnodename .west) to%
+ ([yshift=-1.5,xshift=-5]\CSXnodename .east);%
+ }%
+ }%
+ },%
+ CSXbackslashtwoarrow/.style={%
+ inner ysep/.expanded=(1.5+\pgfkeysvalueof{/pgf/inner ysep}),%
+ CSXshiftA/.style={yshift=1.5},%
+ CSXshiftB/.style={yshift=1.5,xshift=-5},%
+ CSXshiftcompensation/.style={yshift=-1.5,xshift=2.5},%
+ postaction=decorate,%
+ decoration={%
+ markings,%
+ mark=at position 0.5 with{%
+ \draw([yshift=-1.5,xshift=5]\CSXnodename .west) to%
+ ([yshift=-1.5]\CSXnodename .east);%
+ }%
+ }%
+ },%
+ CSXslashthreearrow/.style={%
+ inner ysep/.expanded=(3+\pgfkeysvalueof{/pgf/inner ysep}),%
+ CSXshiftA/.style={xshift=5},%
+ CSXshiftB/.style={xshift=-5},%
+ CSXshiftcompensation/.style={x=1.4,y=1.4},%
+ postaction=decorate,%
+ decoration={%
+ markings,%
+ mark=at position 0.5 with{%
+ \draw([yshift=3,xshift=10]\CSXnodename .west) to%
+ ([yshift=3]\CSXnodename .east);%
+ \draw([yshift=-3]\CSXnodename .west) to%
+ ([yshift=-3,xshift=-10]\CSXnodename .east);%
+ }%
+ }%
+ },%
+ CSXbackslashthreearrow/.style={%
+ inner ysep/.expanded=(3+\pgfkeysvalueof{/pgf/inner ysep}),%
+ CSXshiftA/.style={xshift=5},%
+ CSXshiftB/.style={xshift=-5},%
+ CSXshiftcompensation/.style={x=1.4,y=1.4},%
+ postaction=decorate,%
+ decoration={%
+ markings,%
+ mark=at position 0.5 with{%
+ \draw([yshift=3]\CSXnodename .west) to%
+ ([yshift=3,xshift=-10]\CSXnodename .east);%
+ \draw([yshift=-3,xshift=10]\CSXnodename .west) to%
+ ([yshift=-3]\CSXnodename .east);%
+ }%
+ }%
+ },%
+ CSXCrossArrow/.style={%
+ inner ysep/.expanded=1.5+\pgfkeysvalueof{/pgf/inner ysep},%
+ postaction=decorate,%
+ decoration={%
+ markings,%
+ mark=at position 0.5 with{%
+ \draw[-,solid,CSXshiftcompensation](-3,-3)--(3,3);%
+ \draw[-,solid,CSXshiftcompensation](3,-3)--(-3,3);%
+ }%
+ }%
+ },%
+ CSXStrikeArrow/.style={%
+ inner ysep/.expanded=2+\pgfkeysvalueof{/pgf/inner ysep},%
+ postaction=decorate,%
+ decoration={%
+ markings,%
+ mark=at position 0.5 with{%
+ \draw[-,solid,CSXshiftcompensation](-2,-3.5)--(2, 3.5);%
+ }%
+ }%
+ },%
+ CSXDStrikeArrow/.style={%
+ inner ysep/.expanded=2+\pgfkeysvalueof{/pgf/inner ysep},%
+ postaction=decorate,%
+ decoration={%
+ markings,%
+ mark=at position 0.5 with{%
+ \draw[-,solid,xshift=-2,CSXshiftcompensation](-2,-3.5)--(2, 3.5);%
+ \draw[-,solid,xshift=2,CSXshiftcompensation](-2,-3.5)--(2, 3.5);%
+ }%
+ }%
+ }%
+}
+% \end{macrocode}
+% \subsection{Booleans, Lengths and Counters}
+% \begin{macrocode}
+% Booleans
+\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
+% Lengths
+\newlength{\CSXimagewidth}\setlength{\CSXimagewidth}{0pt}
+\newlength{\CSXlabelwidth}\setlength{\CSXlabelwidth}{0pt}
+\newlength{\CSXmaxlabelwidth}\setlength{\CSXmaxlabelwidth}{0pt}
+\newlength{\CSXtextwidth}\setlength{\CSXtextwidth}{0pt}
+\newlength{\CSXmaxtextwidth}\setlength{\CSXmaxtextwidth}{0pt}
+\newlength{\CSXarrowlength}\setlength{\CSXarrowlength}{0pt}
+% Counters
+\newcounter{CSXscheme}\setcounter{CSXscheme}{1}
+\newcounter{CSXstruct}\setcounter{CSXstruct}{0}
+\newcounter{CSXstructinarrow}\setcounter{CSXstructinarrow}{0}
+\newcounter{CSXcaption}\setcounter{CSXcaption}{0}
+% \end{macrocode}
+% \subsection{User macros}
+% \begin{macro}{\newstruct}
+% \begin{macrocode}
+\def\CSX@structlist@filenamesorted{}
+\newcommand{\newstruct}[5][]{%
+ % #1=comma-separated list of subcaptions
+ % #2=filename
+ % #3=structname
+ % #4=Structname
+ % #5=abbreviation
+ \@ifundefined{CSX@newstruct@#2@structname}{%
+ \global\@namedef{CSX@newstruct@#2@structname}{#3}%
+ \global\@namedef{CSX@newstruct@#2@Structname}{#4}%
+ \global\@namedef{CSX@newstruct@#2@abbreviation}{#5}%
+ \ifthenelse{\equal{#1}{}}{}{%
+ \setcounter{CSXcaption}{0}% No need to define a new counter, just use the CSXcaption
+ \fancyref@foreach{\CSX@newsubstruct}{#2}{#1}%
+ }%
+ \AtBeginDocument{%
+ \immediate\write\@auxout{%
+ \string\fancyref@addtolist
+ {\string{#2\string}}%
+ {\string\CSX@structlist@filenamesorted}%
+ }%
+ }%
+ }{%
+ \PackageError{chemschemex}{Multiple definitions of '#2' by %
+ \string\newstruct}{}%
+ }%
+}
+\@onlypreamble\newstruct
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\structname}
+% \begin{macrocode}
+\DeclareRobustCommand{\structname}[1]{%
+ \@ifundefined{CSX@newstruct@#1@structname}{%
+ ???%
+ \PackageWarning{chemschemex}{No structure '#1' defined by \string\newstruct}%
+ }{%
+ \ifthenelse{\equal{\@nameuse{CSX@newstruct@#1@structname}}{}}{%
+ ???%
+ \PackageWarning{chemschemex}{structname of structure '#1' is empty.}%
+ }{%
+ \@nameuse{CSX@newstruct@#1@structname}%
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Structname}
+% \begin{macrocode}
+\DeclareRobustCommand{\Structname}[1]{%
+ \@ifundefined{CSX@newstruct@#1@Structname}{%
+ ???%
+ \PackageWarning{chemschemex}{No structure '#1' defined by \string\newstruct}%
+ }{%
+ \ifthenelse{\equal{\@nameuse{CSX@newstruct@#1@Structname}}{}}{%
+ ???%
+ \PackageWarning{chemschemex}{Structname of structure '#1' is empty.}%
+ }{%
+ \@nameuse{CSX@newstruct@#1@Structname}%
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\structabbr}
+% \begin{macrocode}
+\DeclareRobustCommand{\structabbr}[1]{%
+ \@ifundefined{CSX@newstruct@#1@abbreviation}{%
+ ???%
+ \PackageWarning{chemschemex}{No structure '#1' defined by \string\newstruct}%
+ }{%
+ \ifthenelse{\equal{\@nameuse{CSX@newstruct@#1@abbreviation}}{}}{%
+ ???%
+ \PackageWarning{chemschemex}{structabbr of structure '#1' is empty.}%
+ }{%
+ \@nameuse{CSX@newstruct@#1@abbreviation}%
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\customstruct}
+% \begin{macrocode}
+\newcommandx\customstruct[4][1={},2={}]{%
+ % #1=TikZ option for caption
+ % #2=TikZ option for image
+ % #3=caption
+ % #4=image
+ \customstruct@outarrow[#1][#2]{#3}{#4}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\struct}
+% \begin{macrocode}
+\newcommandx\struct[6][1={},2=CSX,3={},4={},5={},usedefault]{%
+ % #1=caption
+ % #2=family
+ % #3=image options
+ % #4=TikZ option for caption
+ % #5=TikZ option for image
+ % #6=filename
+ \@struct{#1}{#2}{#6}%
+ \expandnext{\customstruct[#4][#5]}{\@@struct}{\CSXimage[#3]{#6}}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\structalt}
+% \begin{macrocode}
+\newcommandx\structalt[7][1={},2=CSX,3={},4={},5={},usedefault]{%
+ % #1=caption
+ % #2=family
+ % #3=image options
+ % #4=TikZ option for caption
+ % #5=TikZ option for image
+ % #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}}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\struct*}
+% \begin{macrocode}
+\WithSuffix\newcommandx\struct*[6][1={},2=CSX,3={},4={},5={},usedefault]{%
+ % #1=caption
+ % #2=family
+ % #3=image options
+ % #4=TikZ option for caption
+ % #5=TikZ option for image
+ % #6=filename
+ \@struct*{#1}{#2}{#6}%
+ \expandnext{\customstruct[#4][#5]}{\@@struct}{\CSXimage[#3]{#6}}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\structalt*}
+% \begin{macrocode}
+\WithSuffix\newcommandx\structalt*[7][1={},2=CSX,3={},4={},5={},usedefault]{%
+ % #1=caption
+ % #2=family
+ % #3=image options
+ % #4=TikZ option for caption
+ % #5=TikZ option for image
+ % #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}}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\struct-}
+% \begin{macrocode}
+\WithSuffix\newcommandx\struct-[5][1={},2={},3={},4={},usedefault]{%
+ % #1=caption
+ % #2=image options
+ % #3=TikZ option for caption
+ % #4=TikZ option for image
+ % #5=filename
+ \expandnext{\customstruct[#3][#4]}{{{},{#1}}}{\CSXimage[#2]{#5}}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Struct}
+% \begin{macrocode}
+\newcommandx\Struct[6][1=CSX,2={},3={},4={},usedefault]{%
+ % #1=family
+ % #2=image options
+ % #3=TikZ option for caption
+ % #4=TikZ option for image
+ % #5=list of sublabels previously defined with \newstruct
+ % #6=filename
+ \@Struct{#1}{#5}{#6}%
+ \expandnext{\customstruct[#3][#4]}{\@@struct}{\CSXimage[#2]{#6}}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Structalt}
+% \begin{macrocode}
+\newcommandx\Structalt[7][1=CSX,2={},3={},4={},usedefault]{%
+ % #1=family
+ % #2=image options
+ % #3=TikZ option for caption
+ % #4=TikZ option for image
+ % #5=list of sublabels previously defined with \newstruct
+ % #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}}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Struct*}
+% \begin{macrocode}
+\WithSuffix\newcommandx\Struct*[6][1=CSX,2={},3={},4={},usedefault]{%
+ % #1=family
+ % #2=image options
+ % #3=TikZ option for caption
+ % #4=TikZ option for image
+ % #5=list of sublabels previously defined with \newstruct
+ % #6=filename
+ \@Struct*{#1}{#5}{#6}%
+ \expandnext{\customstruct[#3][#4]}{\@@struct}{\CSXimage[#2]{#6}}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Structalt*}
+% \begin{macrocode}
+\WithSuffix\newcommandx\Structalt*[7][1=CSX,2={},3={},4={},usedefault]{%
+ % #1=family
+ % #2=image options
+ % #3=TikZ option for caption
+ % #4=TikZ option for image
+ % #5=list of sublabels previously defined with \newstruct
+ % #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}}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\structplus}
+% \begin{macrocode}
+\newcommand{\structplus}{%
+ \customstruct{}{\tikz[CSXsimple]{\draw[-](1,0)to(-1,0);\draw[-](0,1)to(0,-1);}}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\structminus}
+% \begin{macrocode}
+\newcommand{\structminus}{%
+ \customstruct{}{\tikz[CSXsimple]{\draw[-](1,0)to(-1,0);}}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ChemschemeNextRow}
+% \begin{macrocode}
+\def\ChemschemeNextRow@list{}%
+\newcommand{\ChemschemeNextRow}[1][]{%
+ \ExpandNext{\fancyref@addtolist}{\theCSXstruct}{\ChemschemeNextRow@list}%
+ \expandafter\def\csname ChemschemeNextRow@\theCSXstruct\endcsname{#1}%
+ \ignorespaces%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{environment}{Chemscheme}
+% \begin{macrocode}
+\newenvironment{Chemscheme}{%
+ \CSX@schemetrue%
+ \ignorespaces%
+}{%
+ \CSX@print%
+ \CSX@schemefalse%
+}
+% \end{macrocode}
+% \end{environment}
+% \begin{macro}{\structref}
+% \begin{macrocode}
+\DeclareRobustCommand\structref[2][CSX]{%
+ % #1=family
+ % #2=label
+ \CSXstructref{\fancyref[#1]{#2}}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\structref*}
+% \begin{macrocode}
+\WithSuffix\DeclareRobustCommand\structref*[2][CSX]{%
+ % #1=family
+ % #2=label
+ \CSXstructref{\fancyref*[#1]{#2}}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\structsubref}
+% \begin{macrocode}
+\DeclareRobustCommand\structsubref[3][CSX]{%
+ % #1=family
+ % #2=label
+ % #3=sublabel
+ \CSXstructref{\fancysubref[#1]{#2}{#3}}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\structsubref-}
+% \begin{macrocode}
+\WithSuffix\DeclareRobustCommand\structsubref-[3][CSX]{%
+ % #1=family
+ % #2=label
+ % #3=sublabel
+ \CSXstructref{\fancysubref-[#1]{#2}{#3}}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\structsubref*}
+% \begin{macrocode}
+\WithSuffix\DeclareRobustCommand\structsubref*[3][CSX]{%
+ % #1=family
+ % #2=label
+ % #3=sublabel
+ \CSXstructref{\fancysubref*[#1]{#2}{#3}}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\CSXstructref}
+% \begin{macrocode}
+\newcommand{\CSXstructref}[1]{%
+ % #1=fancyref command
+ \textbf{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\CSXcommands}
+% \begin{macrocode}
+\newcommand{\CSXcommands}[1]{%
+ \gappto\CSX@commands{#1}%
+ \ignorespaces%
+}
+\def\CSX@commands{}%
+% \end{macrocode}
+% \end{macro}
+% \subsection{Helper macros}
+% \begin{macro}{\CSX@newsubstruct}
+% \begin{macrocode}
+\newcommand{\CSX@newsubstruct}[2]{%
+ % #1=label
+ % #2=caption
+ \stepcounter{CSXcaption}%
+ \xdef\chemschemes@getcountervalue{%
+ \theCSXcaption%
+ }%
+ \expandafter\xdef\csname CSX@newstruct@#1@subcaption@%
+ \chemschemes@getcountervalue\endcsname{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\CSX@customarrow@widestcaption}
+% \begin{macrocode}
+\newcommand{\CSX@customarrow@widestcaption}[2]{%
+ % #1=label
+ % #2=style
+ \pgfmathwidth{"%
+ \noexpand\tikz[minimum width=0pt,inner sep=0pt,outer sep=0pt]{%
+ \noexpand\node[\expandonce{#2}]{\noexpand#1};%
+ }%
+ "}%
+ \pgfmathsetlength{\CSXlabelwidth}{\pgfmathresult}%
+ \ifnum\CSXlabelwidth>\CSXarrowlength%
+ \pgfmathsetlength{\CSXarrowlength}{\pgfmathresult}%
+ \edef\CSX@arrowlength{\pgfmathresult}%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\CSX@savebox@set}
+% \begin{macrocode}
+\def\CSX@savebox@set#1#2{%
+ % #1=boxname
+ % #2=box content
+ \@ifundefined{#1}{%
+ \expandnext{\newsavebox}{\csname #1\endcsname}%
+ }{}
+ \expandnext{\global\sbox}{\csname #1\endcsname}{#2}%
+ \expandnext{\usebox}{\csname #1\endcsname}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{CSX@savebox@show}
+% \begin{macrocode}
+\def\CSX@savebox@show#1#2{%
+ % #1=boxname
+ % #2=box content
+ \expandnext{\usebox}{\csname #1\endcsname}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\customarrow}
+% \begin{macrocode}
+\newcommand{\customarrow}[4][\the\CSXarrowlength]{%
+ % #1=length
+ % #2=arrow style
+ % #3=upper text
+ % #4=lower text
+ \stepcounter{CSXstruct}%
+ % Measure upper und lower text
+ \setlength{\CSXarrowlength}{0pt}%
+ \def\CSX@nodename{Scheme\theCSXscheme Image\theCSXstruct}%
+ \def\CSXcustomarrow@uppertext{%
+ \let\customstruct\customstruct@inarrow%
+ \def\customstruct@inarrow@nodename{\CSX@nodename Upper}%
+ #3%
+ \let\customstruct\customstruct@outarrow%
+ }%
+ \def\CSXcustomarrow@lowertext{%
+ \let\customstruct\customstruct@inarrow%
+ \def\customstruct@inarrow@nodename{\CSX@nodename Lower}%
+ #4%
+ \let\customstruct\customstruct@outarrow%
+ }%
+ \let\CSX@savebox\CSX@savebox@set%
+ \edef\CSX@arrowlength{0}%
+ \CSX@customarrow@widestcaption{\CSXcustomarrow@uppertext}{CSXarrowfont,CSXarrowupper}%
+ \CSX@customarrow@widestcaption{\CSXcustomarrow@lowertext}{CSXarrowfont,CSXarrowlower}%
+ \let\CSX@savebox\CSX@savebox@show%
+ % Set matrix entries
+ \pgfmathsetlength{\CSXarrowlength}{\CSX@arrowlength + \CSXarrowadvance}%
+ \edef\customarrow@temp{%
+ % Reserve space in matrix
+ \noexpand\node(\CSX@nodename)%
+ {\noexpand\hbox to #1{}};%
+ % Add arrow command
+ \noexpand\CSXcommands{%
+ \noexpand\pgfmathsetlength{\noexpand\CSXarrowlength}{#1}%
+ \noexpand\def\noexpand\CSXnodename{\CSX@nodename}%
+ \noexpand\draw [text width=(#1-\CSXarrowadvance),#2]%
+ ([CSXshiftA]\noexpand\CSXnodename .west) to%
+ node (\noexpand\CSXnodename Upper)%
+ [CSXshiftcompensation,CSXarrowfont,CSXarrowupper,auto]%
+ {\expandonce\CSXcustomarrow@uppertext}%
+ node (\noexpand\CSXnodename Lower)%
+ [CSXshiftcompensation,CSXarrowfont,CSXarrowlower,auto,swap]%
+ {\expandonce\CSXcustomarrow@lowertext}%
+ ([CSXshiftB]\noexpand\CSXnodename .east);%
+ }%
+ }%
+ \expandnext{\expandafter\gdef\csname CSX@list@image@\theCSXstruct\endcsname}{%
+ \customarrow@temp%
+ }%
+ \expandafter\gdef\csname CSX@list@caption@\theCSXstruct\endcsname{%
+ \node(Scheme\theCSXscheme Caption\theCSXstruct){};%
+ }%
+ \ifCSX@scheme%
+ % Inside Chemscheme environment
+ \else%
+ % Outside Chemscheme environment
+ \CSX@print%
+ \fi%
+ \ignorespaces%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\CSXdeclarearrow}
+% \begin{macrocode}
+\newcommand{\CSXdeclarearrow}[2]{%
+ % #1=macro name
+ % #2=TikZ style
+ \newcommand{#1}[3][\the\CSXarrowlength]{%
+ % ##1=length
+ % ##2=upper caption
+ % ##3=lower caption
+ \customarrow[##1]{#2}{##2}{##3}%
+ }
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\CSXdeclarearrowbundle}
+% \begin{macrocode}
+\newcommand{\CSXdeclarearrowbundle}[2]{%
+ % #1=macro name
+ % #2=TikZ style
+ % normal
+ \CSX@declarearrowbundle{#1}{#2}%
+ % dashed
+ \CSX@declarearrowbundle{#1Dashed}{#2,dashed}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\CSX@declarearrowbundle}
+% \begin{macrocode}
+\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}%
+}
+% Normal arrows
+\CSXdeclarearrowbundle{RightArrow}{CSXallarrows,CSXRightArrow}
+\CSXdeclarearrowbundle{LeftArrow}{CSXallarrows,CSXLeftArrow}
+\CSXdeclarearrowbundle{LeftRightArrow}{CSXallarrows,CSXLeftRightArrow}
+% Double arrow
+\CSXdeclarearrowbundle{DoubleRightArrow}{CSXallarrows,CSXdoublearrows,CSXRightArrow}
+\CSXdeclarearrowbundle{DoubleLeftArrow}{CSXallarrows,CSXdoublearrows,CSXLeftArrow}
+\CSXdeclarearrowbundle{DoubleLeftRightArrow}{CSXallarrows,CSXdoublearrows,CSXLeftRightArrow}
+% Single harpoons
+\CSXdeclarearrowbundle{RightupHarpoon}{CSXallarrows,CSXRightupHarpoon}
+\CSXdeclarearrowbundle{RightdownHarpoon}{CSXallarrows,CSXRightdownHarpoon}
+\CSXdeclarearrowbundle{LeftupHarpoon}{CSXallarrows,CSXLeftupHarpoon}
+\CSXdeclarearrowbundle{LeftdownHarpoon}{CSXallarrows,CSXLeftdownHarpoon}
+\CSXdeclarearrowbundle{LeftupRightupHarpoon}{CSXallarrows,CSXLeftupRightupHarpoon}
+\CSXdeclarearrowbundle{LeftupRightdownHarpoon}{CSXallarrows,CSXLeftupRightdownHarpoon}
+\CSXdeclarearrowbundle{LeftdownRightupHarpoon}{CSXallarrows,CSXLeftdownRightupHarpoon}
+\CSXdeclarearrowbundle{LeftdownRightdownHarpoon}{CSXallarrows,CSXLeftdownRightdownHarpoon}
+% Equilibrium
+\CSXdeclarearrowbundle{Equilibrium}{CSXallarrows,CSXequilibrium,CSXRightupHarpoon}
+\CSXdeclarearrowbundle{RightEquilibrium}{CSXallarrows,CSXRightequilibrium,CSXRightupHarpoon}
+\CSXdeclarearrowbundle{LeftEquilibrium}{CSXallarrows,CSXLeftequilibrium,CSXRightupHarpoon}
+\CSXdeclarearrowbundle{RRightEquilibrium}{CSXallarrows,CSXLeftequilibrium,CSXLeftupHarpoon}
+\CSXdeclarearrowbundle{LLeftEquilibrium}{CSXallarrows,CSXRightequilibrium,CSXLeftupHarpoon}
+% Two Arrows
+\CSXdeclarearrowbundle{TwoRightArrow}{CSXallarrows,CSXslashtwoarrow,CSXRightArrow}
+\CSXdeclarearrowbundle{TTwoRightArrow}{CSXallarrows,CSXbackslashtwoarrow,CSXRightArrow}
+\CSXdeclarearrowbundle{TwoLeftArrow}{CSXallarrows,CSXslashtwoarrow,CSXLeftArrow}
+\CSXdeclarearrowbundle{TTwoLeftArrow}{CSXallarrows,CSXbackslashtwoarrow,CSXLeftArrow}
+% Three Arrows
+\CSXdeclarearrowbundle{ThreeRightArrow}{CSXallarrows,CSXslashthreearrow,CSXRightArrow}
+\CSXdeclarearrowbundle{TThreeRightArrow}{CSXallarrows,CSXbackslashthreearrow,CSXRightArrow}
+\CSXdeclarearrowbundle{ThreeLeftArrow}{CSXallarrows,CSXslashthreearrow,CSXLeftArrow}
+\CSXdeclarearrowbundle{TThreeLeftArrow}{CSXallarrows,CSXbackslashthreearrow,CSXLeftArrow}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@struct}
+% \begin{macrocode}
+\newcommand{\@struct}[3]{%
+ % #1=caption
+ % #2=family
+ % #3=filename
+ \ifthenelse{\equal{#1}{}}{%
+ \def\@@struct{{{\fancylabel[#2]{#3}},{}}}%
+ }{%
+ \def\@@struct{{{\def\fancylabelShowLabelEvent{\CSXlabelsep}\fancylabel[#2]{#3}},{#1}}}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@struct*}
+% \begin{macrocode}
+\WithSuffix\newcommand\@struct*[3]{%
+ % #1=caption
+ % #2=family
+ % #3=filename
+ \def\@@struct{{{\fancylabel*[#2]{#3}},{#1}}}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@Struct}
+% \begin{macrocode}
+\newcommand\@Struct[3]{%
+ % #1=family
+ % #2=list of sublabels previously defined with \newstruct
+ % #3=filename
+ % Use the sort-function of the fancylabel package to sort the label-list
+ \def\@@struct{}%
+ \def\fancyref@@@@@sort{fancyref@PrevRun@#1@#3@\fancyref@@sort@value}%
+ \def\fancyref@sort@list{}%
+ \def\fancyref@sort@labellist@unsorted{}%
+ \fancyref@sort{#2}%
+ \expandnext{\fancyref@addtolist}%
+ {\fancyref@sort@labellist@unsorted}%
+ {\fancyref@sort@list}%
+ \edef\CSX@sorted@list{\fancyref@sort@list}%
+ % Generate the caption
+ \def\@Struct@family{#1}%
+ \def\@Struct@filename{#3}%
+ \expandnext{\fancyref@foreach{\@@Struct}{}}{\CSX@sorted@list}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@@Struct}
+% \begin{macrocode}
+\newcommand{\@@Struct}[2]{%
+ % #1=
+ % #2=sublabel
+ \@ifundefined{CSX@newstruct@\@Struct@filename @subcaption@#2}{%
+ \PackageError{chemschemex}{Substructure '#2' not defined as %
+ substructure of '\@Struct@filename '. %
+ Use the \noexpand\newstruct command for %
+ the definition of substructures.}{}%
+ }{%
+ \fancyref@addtolist{%
+ {{\def\fancylabelShowLabelEvent{\CSXlabelsep}\fancysublabel[\@Struct@family]{\@Struct@filename}{#2}},%
+ {\@nameuse{CSX@newstruct@\@Struct@filename @subcaption@#2}}}}%
+ {\@@struct}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@Struct*}
+% \begin{macrocode}
+\WithSuffix\newcommand\@Struct*[3]{%
+ % #1=family
+ % #2=list of sublabels previously defined with \newstruct
+ % #3=filename
+ \def\@@struct{{{\fancysublabel[#1]{#3}{#2}},{}}}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\customstruct@outarrow}
+% \begin{macrocode}
+\newcommandx\customstruct@outarrow[4][1={},2={}]{%
+ % #1=TikZ option for caption
+ % #2=TikZ option for image
+ % #3=caption
+ % #4=image
+ \stepcounter{CSXstruct}%
+ % Set Image
+ \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%
+ }%
+ % Generate caption
+ \CSXgeneratecaption{#3}{#4}{Scheme\theCSXscheme Caption\theCSXstruct}{#1}%
+ % Set caption
+ \edef\customstruct@outarrow@temp{%
+ \noexpand\node(Scheme\theCSXscheme Caption\theCSXstruct){%
+ \noexpand\tikz[CSXcaption,\expandonce{#1}]{%
+ \expandonce\CSXcaption%
+ }%
+ };%
+ }%
+ \expandnext{\expandafter\gdef\csname CSX@list@caption@\theCSXstruct\endcsname}{%
+ \customstruct@outarrow@temp%
+ }%
+ \ifCSX@scheme%
+ % Inside Chemscheme environment
+ \else%
+ % Outside Chemscheme environment
+ \CSX@print%
+ \fi%
+ \ignorespaces%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\customstruct@inarrow}
+% \begin{macrocode}
+\newcommandx\customstruct@inarrow[4][1={},2={}]{%
+ % #1=TikZ option for caption
+ % #2=TikZ option for image
+ % #3=caption
+ % #4=image
+ \stepcounter{CSXstructinarrow}%
+ \CSXgeneratecaption{#3}{#4}{\customstruct@inarrow@nodename Caption\theCSXstructinarrow}{#1}%
+ \ifthenelse{\CSXmaxlabelwidth=0 \AND \CSXmaxtextwidth=0}{%
+ \edef\customstruct@inarrow@temp{%
+ \noexpand\tikz[remember picture,CSXStructInArrow]{%
+ \noexpand\node [\expandonce{#2}]%
+ (\customstruct@inarrow@nodename Image\theCSXstructinarrow)%
+ {\expandonce{#4}};%
+ }%
+ }%
+ }{%
+ \edef\customstruct@inarrow@temp{%
+ \noexpand\tikz[remember picture,CSXStructInArrow,%
+ baseline=(\CSX@generate@caption@captionname Entry\theCSXcaption .base)]{%
+ \noexpand\node [\expandonce{#2}]%
+ (\customstruct@inarrow@nodename Image\theCSXstructinarrow)%
+ {\expandonce{#4}};%
+ \noexpand\node [below=of \customstruct@inarrow@nodename Image\theCSXstructinarrow]%
+ (\customstruct@inarrow@nodename Caption\theCSXstructinarrow)%
+ {\noexpand\tikz[CSXcaption,\expandonce{#1}]{\expandonce\CSXcaption}};%
+ }%
+ }%
+ }%
+ \expandnext{\CSX@savebox{CSX@savebox@\theCSXstructinarrow}}{%
+ \customstruct@inarrow@temp%
+ }%
+ \ignorespaces%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\CSXgeneratecaption}
+% \begin{macrocode}
+\newcommand{\CSXgeneratecaption}[4]{%
+ % #1=list of labels and text: {{label1},{text1}},{{label2},{text2}},...
+ % #2=Image
+ % #3=caption name
+ % #4=caption style
+ \setcounter{CSXcaption}{0}%
+ \setlength{\CSXmaxlabelwidth}{0pt}%
+ \setlength{\CSXmaxtextwidth}{0pt}%
+ \def\CSXcaption{}%
+ \def\CSX@generate@caption@image{#2}%
+ \def\CSX@generate@caption@captionname{#3}%
+ \def\CSX@generate@caption@captionstyle{CSXcaption,#4}%
+ \CSX@generate@@@caption@true%
+ \ifthenelse{\equal{#1}{}}{}{%
+ \expandnext\expandnext\expandnext{%
+ \fancyref@foreach{\CSX@generate@@caption}{}%
+ }{#1}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\CSX@generate@@caption}
+% \begin{macrocode}
+\newcommand{\CSX@generate@@caption}[2]{%
+ % #1=
+ % #2=label and text: {label1},{text1}
+ \edef\CSX@generate@@@caption@lastCSXcaption{\theCSXcaption}%
+ \stepcounter{CSXcaption}%
+ \fancyref@foreach{\CSX@generate@@@caption}{}{#2}%
+ % Execute text-only event
+ \ifCSX@generate@@@caption@\else%
+ \CSX@generate@@@caption@TextOnly%
+ {\CSX@generate@caption@image}%
+ {\CSX@generate@caption@captionname Entry\theCSXcaption}%
+ {\CSX@generate@caption@captionname Entry\CSX@generate@@@caption@lastCSXcaption}%
+ {\CSX@generate@@@caption@label}%
+ \CSX@generate@@@caption@true%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\CSX@generate@@@caption}
+% \begin{macrocode}
+\newcommand{\CSX@generate@@@caption}[2]{%
+ % #1=
+ % #2=label or text: label1 or text1
+ \ifCSX@generate@@@caption@%
+ % Label
+ \def\CSX@generate@@@caption@label{#2}%
+ \CSX@generate@@@caption@false%
+ \else%
+ % Text and execute label-and-text event
+ \def\CSX@generate@@@caption@text{#2}%
+ \CSX@generate@@@caption@LabelAndText%
+ {\CSX@generate@caption@image}%
+ {\CSX@generate@caption@captionname Entry\theCSXcaption}%
+ {\CSX@generate@caption@captionname Entry\CSX@generate@@@caption@lastCSXcaption}%
+ {\CSX@generate@@@caption@label}%
+ {\CSX@generate@@@caption@text}%
+ \CSX@generate@@@caption@true%
+ \def\CSX@generate@@@caption@label{}%
+ \def\CSX@generate@@@caption@text{}%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\CSX@setimagewidth}
+% \begin{macrocode}
+\newcommand{\CSX@setimagewidth}[1]{%
+ % #1=image
+ \pgfmathwidth{"%
+ \noexpand\tikz[minimum width=0pt,inner sep=0pt,outer sep=0pt]{%
+ \noexpand\node{\noexpand#1};%
+ }%
+ "}%
+ \edef\CSX@imagewidth{\pgfmathresult}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\CSX@setmaxlabelwidth}
+% \begin{macrocode}
+\newcommand{\CSX@setmaxlabelwidth}[1]{%
+ % #1=label
+ \pgfmathwidth{"%
+ \noexpand\tikz[\expandonce\CSX@generate@caption@captionstyle ,minimum width=0pt,inner sep=0pt,outer sep=0pt]{%
+ \noexpand\node[CSXlabelfont]{\noexpand#1};%
+ }%
+ "}%
+ \pgfmathsetlength{\CSXlabelwidth}{\pgfmathresult}%
+ \edef\CSX@labelwidth{\pgfmathresult}%
+ \ifnum\CSXlabelwidth<\CSXmaxlabelwidth%
+ \else%
+ \pgfmathsetlength{\CSXmaxlabelwidth}{\pgfmathresult}%
+ \edef\CSX@maxlabelwidth{\pgfmathresult}%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\CSX@settextwidth}
+% \begin{macrocode}
+\newcommand{\CSX@settextwidth}[1]{%
+ % #1=text
+ \pgfmathwidth{"%
+ \noexpand\tikz[\expandonce\CSX@generate@caption@captionstyle ,minimum width=0pt,inner sep=0pt,outer sep=0pt]{%
+ \noexpand\node[CSXtextfont]{\noexpand#1};%
+ }%
+ "}%
+ \pgfmathsetlength{\CSXtextwidth}{\pgfmathresult}%
+ \edef\CSX@textwidth{\pgfmathresult}%
+ \ifnum\CSXtextwidth<\CSXmaxtextwidth%
+ \else%
+ \pgfmathsetlength{\CSXmaxtextwidth}{\pgfmathresult}%
+ \edef\CSX@maxtextwidth{\pgfmathresult}%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\CSX@setvphantom}
+% \begin{macrocode}
+\newcommand{\CSX@setvphantom}{%
+ \ifdim\CSXlabelwidth=0pt%
+ \ifdim\CSXtextwidth=0pt%
+ \def\CSX@vphantom{}%
+ \else%
+ \def\CSX@vphantom{font/.expand once={\tikz@textfont\vphantom{Ag}}}%
+ \fi%
+ \else%
+ \def\CSX@vphantom{font/.expand once={\tikz@textfont\vphantom{Ag}}}%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\CSX@generate@@@caption@LabelAndText}
+% \begin{macrocode}
+\newcommand{\CSX@generate@@@caption@LabelAndText}[5]{%
+ % #1=image command
+ % #2=node name
+ % #3=last node name
+ % #4=label
+ % #5=text
+ % Get the image width
+ \CSX@setimagewidth{#1}%
+ % Get the widest label
+ \CSX@setmaxlabelwidth{#4}%
+ % Measure the text width
+ \def\CSX@textwidth{0}%
+ \CSX@settextwidth{#5}%
+ \CSX@setvphantom%
+ % Typeset caption
+ \edef\CSX@generate@@@caption@tempentry{%
+ \noexpand\gappto\noexpand\CSXcaption{%
+ % Set \CSXimagewidth
+ \noexpand\pgfmathsetlength{\noexpand\CSXimagewidth}%
+ {\CSX@imagewidth}%
+ % Set \CSXlabelwidth
+ \noexpand\pgfmathsetlength{\noexpand\CSXlabelwidth}%
+ {\CSX@labelwidth}%
+ % Set \CSXmaxlabelwidth
+ \noexpand\pgfmathsetlength{\noexpand\CSXmaxlabelwidth}%
+ {\CSX@maxlabelwidth}%
+ % Set \CSXtextwidth
+ \noexpand\pgfmathsetlength{\noexpand\CSXtextwidth}%
+ {\CSX@textwidth}%
+ % Set \CSXmaxtextwidth
+ \noexpand\pgfmathsetlength{\noexpand\CSXmaxtextwidth}%
+ {\CSX@maxtextwidth}%
+ % Print node
+ \noexpand\node(#2)[%
+ CSXlabelfont,%
+ \expandonce\CSX@vphantom,%
+ CSXsetlabelwidth,%
+ CSXcaptionLabelandText,%
+ rectangle split,%
+ rectangle split horizontal,%
+ rectangle split parts=2,%
+ rectangle split part align=base,%
+ every two node part/.append style={%
+ CSXtextfont,%
+ CSXsettextwidth,%
+ },%
+ \ifCSX@generate@@@caption@LastEntryWasTextOnly%
+ \ifnum\theCSXcaption>1%
+ below=of #3.south,%
+ \fi%
+ \else%
+ \ifnum\theCSXcaption>1%
+ below left=of #3.one split south,%
+ \fi%
+ anchor=one split north%
+ \fi%
+ ]{%
+ \expandonce#4%
+ \noexpand\nodepart{two}%
+ \expandonce#5%
+ };%
+ }%
+ }\CSX@generate@@@caption@tempentry%
+ \CSX@generate@@@caption@LastEntryWasTextOnlyfalse%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\CSX@generate@@@caption@TextOnly}
+% \begin{macrocode}
+\newcommand{\CSX@generate@@@caption@TextOnly}[4]{%
+ % #1=image command
+ % #2=node name
+ % #3=last node name
+ % #4=label
+ % Get the image width
+ \CSX@setimagewidth{#1}%
+ % Get the widest label
+ \CSX@setmaxlabelwidth{}%
+ % Measure the text width
+ \def\CSX@textwidth{0}%
+ \CSX@settextwidth{#4}%
+ \CSX@setvphantom%
+ % Typeset caption
+ \edef\CSX@generate@@@caption@tempentry{%
+ \noexpand\gappto\noexpand\CSXcaption{%
+ % Set \CSXimagewidth
+ \noexpand\pgfmathsetlength{\noexpand\CSXimagewidth}%
+ {\CSX@imagewidth}%
+ % Set \CSXmaxlabelwidth
+ \noexpand\pgfmathsetlength{\noexpand\CSXmaxlabelwidth}%
+ {\CSX@maxlabelwidth}%
+ % Set \CSXtextwidth
+ \noexpand\pgfmathsetlength{\noexpand\CSXtextwidth}%
+ {\CSX@textwidth}%
+ % Set \CSXmaxtextwidth
+ \noexpand\pgfmathsetlength{\noexpand\CSXmaxtextwidth}%
+ {\CSX@maxtextwidth}%
+ % Print node
+ \noexpand\node(#2)[%
+ CSXtextfont,%
+ \expandonce\CSX@vphantom,%
+ CSXsettextwidth,%
+ CSXcaptionTextOnly,%
+ \ifnum\theCSXcaption>1%
+ below=of #3.south,%
+ \fi%
+ ]{%
+ \expandonce#4%
+ };%
+ }%
+ }\CSX@generate@@@caption@tempentry%
+ \CSX@generate@@@caption@LastEntryWasTextOnlytrue%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\CSX@print}
+% \begin{macrocode}
+\newcommand{\CSX@print}{%
+ \ifnum\theCSXstruct=0%
+ \PackageWarning{chemschemex}{Empty Chemscheme environment detected.}
+ \else%
+ \let\CSX@printlist\empty%
+ \CSX@@print%
+ \fi%
+ \setcounter{CSXstructinarrow}{0}%
+ % Print scheme
+ \begin{tikzpicture}[CSX]%
+ \matrix [CSXmatrix]{%
+ \CSX@printlist%
+ };%
+ \CSX@commands%
+ \end{tikzpicture}%
+ \stepcounter{CSXscheme}%
+ \setcounter{CSXstruct}{0}%
+ \setcounter{CSXstructinarrow}{0}%
+ \gdef\CSX@printlist{}%
+ \gdef\CSX@commands{}%
+ \gdef\ChemschemeNextRow@list{}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\CSX@@print}
+% \begin{macrocode}
+\newcommand{\CSX@@print}{%
+ % #1=
+ % #2=row (integer)
+ \def\lastx{1}%
+ \ChemschemeNextRow%
+ \foreach \x [remember=\xplus as \lastx,%
+ evaluate=\x as \xplus using int(\x+1)]%
+ in \ChemschemeNextRow@list {%
+ \ifthenelse{\x < \lastx}{}{%
+ % Create Image row
+ \foreach \y in {\lastx,...,\x}{%
+ \CSX@@@print{\csname CSX@list@image@\y\endcsname}%
+ }%
+ \gappto\CSX@printlist{\pgfmatrixendrow}%
+ % Create Caption row
+ \foreach \y in {\lastx,...,\x}{%
+ \CSX@@@print{\csname CSX@list@caption@\y\endcsname}%
+ }%
+ \edef\CSX@print@tempentry{%
+ \noexpand\gappto\noexpand\CSX@printlist{%
+ \noexpand\pgfmatrixendrow[\csname ChemschemeNextRow@\x\endcsname]%
+ }%
+ }\CSX@print@tempentry%
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\CSX@@@print}
+% \begin{macrocode}
+\newcommand{\CSX@@@print}[2]{%
+ % #1=image
+ \ifnum\y<\x%
+ \def\CSX@@@print@nextcell{\pgfmatrixnextcell}%
+ \else%
+ \def\CSX@@@print@nextcell{}%
+ \fi%
+ \edef\CSX@print@tempentry{%
+ \noexpand\gappto\noexpand\CSX@printlist{%
+ \noexpand#1%
+ \expandonce\CSX@@@print@nextcell%
+ }%
+ }\CSX@print@tempentry%
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+\endinput
+% \Finale \ No newline at end of file
diff --git a/Master/texmf-dist/source/latex/chemschemex/chemschemex.ins b/Master/texmf-dist/source/latex/chemschemex/chemschemex.ins
new file mode 100644
index 00000000000..2c44c134fd0
--- /dev/null
+++ b/Master/texmf-dist/source/latex/chemschemex/chemschemex.ins
@@ -0,0 +1,50 @@
+%% Copyright (C) 2014 by Dominik Siegel
+%%
+%% This file may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.2 of this license or (at your option) any later
+%% version. The latest version of this license is in:
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% and version 1.2 or later is part of all distributions of
+%% LaTeX version 1999/12/01 or later.
+\input docstrip.tex
+\keepsilent
+
+\preamble
+
+ This is a generated file.
+
+ Copyright (C) 2014 by Dominik Siegel
+
+ This file may be distributed and/or modified under the
+ conditions of the LaTeX Project Public License, either
+ version 1.2 of this license or (at your option) any later
+ version. The latest version of this license is in:
+
+ http://www.latex-project.org/lppl.txt
+
+ and version 1.2 or later is part of all distributions of
+ LaTeX version 1999/12/01 or later.
+
+\endpreamble
+
+\generate{\file{chemschemex.sty}{\from{chemschemex.dtx}{package}}}
+
+\obeyspaces
+\Msg{****************************************************}
+\Msg{* *}
+\Msg{* To finish the installation you have to move the *}
+\Msg{* following file into a directory searched by TeX: *}
+\Msg{* *}
+\Msg{* chemschemex.sty *}
+\Msg{* *}
+\Msg{* To produce the documentation run the file *}
+\Msg{* chemschemex.dtx through LaTeX. *}
+\Msg{* *}
+\Msg{* Happy TeXing! *}
+\Msg{* *}
+\Msg{****************************************************}
+
+\endbatchfile
diff --git a/Master/texmf-dist/tex/latex/chemschemex/chemschemex.sty b/Master/texmf-dist/tex/latex/chemschemex/chemschemex.sty
new file mode 100644
index 00000000000..a4f80eb66ed
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/chemschemex/chemschemex.sty
@@ -0,0 +1,1127 @@
+%%
+%% This is file `chemschemex.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% chemschemex.dtx (with options: `package')
+%%
+%% This is a generated file.
+%%
+%% Copyright (C) 2014 by Dominik Siegel
+%%
+%% This file may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.2 of this license or (at your option) any later
+%% version. The latest version of this license is in:
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% and version 1.2 or later is part of all distributions of
+%% LaTeX version 1999/12/01 or later.
+%%
+%%
+%% To produce the documentation, do the following
+%%
+%% latex chemschemex.dtx
+\NeedsTeXFormat{LaTeX2e}[2005/12/01]
+\ProvidesPackage{chemschemex}[2014/07/15 v1.0 Typeset chemical schemes]
+\RequirePackage{xkeyval}
+\RequirePackage{etextools}
+\RequirePackage{xargs}
+\RequirePackage{ifthen}
+\RequirePackage{suffix}
+\RequirePackage{fancylabel}
+\fancyref@DefineFamily{}{CSX}
+\def\fancylabelformatCSX{\arabic{fancylabel}}%
+\def\fancysublabelformatCSX{\arabic{fancylabel}\alph{fancysublabel}}%
+\def\fancyonlysublabelformatCSX{\alph{fancysublabel}}%
+\RequirePackage{graphicx}
+\RequirePackage{tikz}
+\usetikzlibrary{%
+ shapes.multipart,%
+ decorations,%
+ decorations.markings,%
+ positioning,%
+ arrows.meta%
+}
+\define@key{chemschemex}{image}{%
+ % #1=additional options
+ % #2=filename of the image
+ \newcommand{\CSXimage}[2][]{%
+ \includegraphics[#1,##1]{##2}%
+ }
+}
+\define@key{chemschemex}{labelseparator}{%
+ \def\CSXlabelsep{#1}%
+}
+\define@key{chemschemex}{arrowadvance}{%
+ \def\CSXarrowadvance{#1}%
+}
+\presetkeys{chemschemex}{%
+ image={scale=0.7},%
+ labelseparator={:\,},%
+ arrowadvance={10pt},%
+}{}
+\ProcessOptionsX<chemschemex>
+\tikzset{%
+ CSXsettextwidth/.style={%
+ text width=(%
+ % if
+ (\CSXtextwidth - \CSXimagewidth - \CSXmaxlabelwidth)>0%
+ % then
+ ?(\CSXimagewidth - \CSXmaxlabelwidth)%
+ % else
+ :(\CSXtextwidth+0.00001)%
+ ),%
+ },%
+ CSXsetlabelwidth/.style={%
+ text width=(%
+ % if
+ (\CSXlabelwidth)>0%
+ % then
+ ?(\CSXlabelwidth+0.00001)%
+ % else
+ :(0.00001)%
+ ),%
+ },%
+ CSXshiftA/.style={},%
+ CSXshiftB/.style={},%
+ CSXshiftcompensation/.style={},%
+}
+\tikzset{%
+ % TikZ
+ CSX/.style={%
+ remember picture%
+ },%
+ % Matrix
+ CSXmatrix/.style={%
+ column sep=10pt,%
+ row sep=4pt,%
+ nodes={%
+ inner xsep=0pt,%
+ inner ysep=1pt,%
+ outer sep=0pt%
+ },%
+ every odd row/.style={anchor=center},%
+ every even row/.style={anchor=north},%
+ },%
+ % Structure caption
+ CSXcaption/.style={%
+ node distance=0pt,%
+ },%
+ CSXcaptionLabelandText/.style={%
+ align=right,%
+ every two node part/.style={%
+ align=justify%
+ },%
+ },%
+ CSXcaptionTextOnly/.style={%
+ align=justify%
+ },%
+ % Fonts
+ CSXlabelfont/.style={%
+ font={\footnotesize\sffamily\bfseries}%
+ },%
+ CSXtextfont/.style={%
+ font={\footnotesize\sffamily}%
+ },%
+ CSXarrowfont/.style={%
+ font={\footnotesize\sffamily}%
+ },%
+ CSXsimple/.style={%
+ x=3pt,%
+ y=3pt,%
+ line width=0.7pt%
+ },%
+ % Arrows
+ CSXarrowupper/.style={%
+ align=flush center,%
+ },%
+ CSXarrowlower/.style={%
+ align=flush center%
+ },%
+ CSXStructInArrow/.style={%
+ node distance=1pt,%
+ text width=,%
+ inner sep=0pt,%
+ outer sep=0pt%
+ },%
+ CSXallarrows/.style={%
+ x=1pt,y=1pt,%
+ line width=0.7,%
+ inner ysep=3,%
+ >=Classical TikZ Rightarrow,%
+ },%
+ CSXdoublearrows/.style={%
+ double distance=1.5,%
+ >=Implies%
+ },%
+ CSXharpoonup/.style={%
+ >={Classical TikZ Rightarrow[harpoon]}%
+ },%
+ CSXharpoondown/.style={%
+ >={Classical TikZ Rightarrow[harpoon,swap]}%
+ },%
+ CSXRightArrow/.style={%
+ ->%
+ },%
+ CSXRightupHarpoon/.style={%
+ ->[harpoon]%
+ },%
+ CSXRightdownHarpoon/.style={%
+ ->[{harpoon,swap}]%
+ },%
+ CSXLeftArrow/.style={%
+ <-%
+ },%
+ CSXLeftupHarpoon/.style={%
+ <[{harpoon,swap}]-%
+ },%
+ CSXLeftdownHarpoon/.style={%
+ <[harpoon]-%
+ },%
+ CSXLeftRightArrow/.style={%
+ <->%
+ },%
+ CSXLeftupRightupHarpoon/.style={%
+ <[{harpoon,swap}]->[harpoon]%
+ },%
+ CSXLeftupRightdownHarpoon/.style={%
+ <[{harpoon,swap}]->[{harpoon,swap}]%
+ },%
+ CSXLeftdownRightupHarpoon/.style={%
+ <[{harpoon}]->[{harpoon}]%
+ },%
+ CSXLeftdownRightdownHarpoon/.style={%
+ <[{harpoon}]->[{harpoon,swap}]%
+ },%
+ CSXequilibrium/.style={%
+ inner ysep/.expanded=(1+\pgfkeysvalueof{/pgf/inner ysep}),%
+ CSXshiftA/.style={yshift=1},%
+ CSXshiftB/.style={yshift=1},%
+ CSXshiftcompensation/.style={yshift=-1},%
+ postaction=decorate,%
+ decoration={%
+ markings,%
+ mark=at position 0.5 with{%
+ \draw([yshift=-1]\CSXnodename .east) to%
+ ([yshift=-1]\CSXnodename .west);%
+ }%
+ }%
+ },%
+ CSXRightequilibrium/.style={%
+ inner ysep/.expanded=(1+\pgfkeysvalueof{/pgf/inner ysep}),%
+ CSXshiftA/.style={yshift=1},%
+ CSXshiftB/.style={yshift=1},%
+ CSXshiftcompensation/.style={yshift=-1},%
+ postaction=decorate,%
+ decoration={%
+ markings,%
+ mark=at position 0.5 with{%
+ \draw([yshift=-1,xshift=-0.25\CSXarrowlength]\CSXnodename .east) to%
+ ([yshift=-1,xshift=0.25\CSXarrowlength]\CSXnodename .west);%
+ }%
+ }%
+ },%
+ CSXLeftequilibrium/.style={%
+ inner ysep/.expanded=(1+\pgfkeysvalueof{/pgf/inner ysep}),%
+ CSXshiftA/.style={yshift=1,xshift=0.25\CSXarrowlength},%
+ CSXshiftB/.style={yshift=1,xshift=-0.25\CSXarrowlength},%
+ CSXshiftcompensation/.style={yshift=-1},%
+ postaction=decorate,%
+ decoration={%
+ markings,%
+ mark=at position 0.5 with{%
+ \draw([yshift=-1]\CSXnodename .east) to%
+ ([yshift=-1]\CSXnodename .west);%
+ }%
+ }%
+ },%
+ CSXslashtwoarrow/.style={%
+ inner ysep/.expanded=(1.5+\pgfkeysvalueof{/pgf/inner ysep}),%
+ CSXshiftA/.style={yshift=1.5,xshift=5},%
+ CSXshiftB/.style={yshift=1.5},%
+ CSXshiftcompensation/.style={yshift=-1.5,xshift=-2.5},%
+ postaction=decorate,%
+ decoration={%
+ markings,%
+ mark=at position 0.5 with{%
+ \draw([yshift=-1.5]\CSXnodename .west) to%
+ ([yshift=-1.5,xshift=-5]\CSXnodename .east);%
+ }%
+ }%
+ },%
+ CSXbackslashtwoarrow/.style={%
+ inner ysep/.expanded=(1.5+\pgfkeysvalueof{/pgf/inner ysep}),%
+ CSXshiftA/.style={yshift=1.5},%
+ CSXshiftB/.style={yshift=1.5,xshift=-5},%
+ CSXshiftcompensation/.style={yshift=-1.5,xshift=2.5},%
+ postaction=decorate,%
+ decoration={%
+ markings,%
+ mark=at position 0.5 with{%
+ \draw([yshift=-1.5,xshift=5]\CSXnodename .west) to%
+ ([yshift=-1.5]\CSXnodename .east);%
+ }%
+ }%
+ },%
+ CSXslashthreearrow/.style={%
+ inner ysep/.expanded=(3+\pgfkeysvalueof{/pgf/inner ysep}),%
+ CSXshiftA/.style={xshift=5},%
+ CSXshiftB/.style={xshift=-5},%
+ CSXshiftcompensation/.style={x=1.4,y=1.4},%
+ postaction=decorate,%
+ decoration={%
+ markings,%
+ mark=at position 0.5 with{%
+ \draw([yshift=3,xshift=10]\CSXnodename .west) to%
+ ([yshift=3]\CSXnodename .east);%
+ \draw([yshift=-3]\CSXnodename .west) to%
+ ([yshift=-3,xshift=-10]\CSXnodename .east);%
+ }%
+ }%
+ },%
+ CSXbackslashthreearrow/.style={%
+ inner ysep/.expanded=(3+\pgfkeysvalueof{/pgf/inner ysep}),%
+ CSXshiftA/.style={xshift=5},%
+ CSXshiftB/.style={xshift=-5},%
+ CSXshiftcompensation/.style={x=1.4,y=1.4},%
+ postaction=decorate,%
+ decoration={%
+ markings,%
+ mark=at position 0.5 with{%
+ \draw([yshift=3]\CSXnodename .west) to%
+ ([yshift=3,xshift=-10]\CSXnodename .east);%
+ \draw([yshift=-3,xshift=10]\CSXnodename .west) to%
+ ([yshift=-3]\CSXnodename .east);%
+ }%
+ }%
+ },%
+ CSXCrossArrow/.style={%
+ inner ysep/.expanded=1.5+\pgfkeysvalueof{/pgf/inner ysep},%
+ postaction=decorate,%
+ decoration={%
+ markings,%
+ mark=at position 0.5 with{%
+ \draw[-,solid,CSXshiftcompensation](-3,-3)--(3,3);%
+ \draw[-,solid,CSXshiftcompensation](3,-3)--(-3,3);%
+ }%
+ }%
+ },%
+ CSXStrikeArrow/.style={%
+ inner ysep/.expanded=2+\pgfkeysvalueof{/pgf/inner ysep},%
+ postaction=decorate,%
+ decoration={%
+ markings,%
+ mark=at position 0.5 with{%
+ \draw[-,solid,CSXshiftcompensation](-2,-3.5)--(2, 3.5);%
+ }%
+ }%
+ },%
+ CSXDStrikeArrow/.style={%
+ inner ysep/.expanded=2+\pgfkeysvalueof{/pgf/inner ysep},%
+ postaction=decorate,%
+ decoration={%
+ markings,%
+ mark=at position 0.5 with{%
+ \draw[-,solid,xshift=-2,CSXshiftcompensation](-2,-3.5)--(2, 3.5);%
+ \draw[-,solid,xshift=2,CSXshiftcompensation](-2,-3.5)--(2, 3.5);%
+ }%
+ }%
+ }%
+}
+\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
+\newlength{\CSXimagewidth}\setlength{\CSXimagewidth}{0pt}
+\newlength{\CSXlabelwidth}\setlength{\CSXlabelwidth}{0pt}
+\newlength{\CSXmaxlabelwidth}\setlength{\CSXmaxlabelwidth}{0pt}
+\newlength{\CSXtextwidth}\setlength{\CSXtextwidth}{0pt}
+\newlength{\CSXmaxtextwidth}\setlength{\CSXmaxtextwidth}{0pt}
+\newlength{\CSXarrowlength}\setlength{\CSXarrowlength}{0pt}
+\newcounter{CSXscheme}\setcounter{CSXscheme}{1}
+\newcounter{CSXstruct}\setcounter{CSXstruct}{0}
+\newcounter{CSXstructinarrow}\setcounter{CSXstructinarrow}{0}
+\newcounter{CSXcaption}\setcounter{CSXcaption}{0}
+\def\CSX@structlist@filenamesorted{}
+\newcommand{\newstruct}[5][]{%
+ % #1=comma-separated list of subcaptions
+ % #2=filename
+ % #3=structname
+ % #4=Structname
+ % #5=abbreviation
+ \@ifundefined{CSX@newstruct@#2@structname}{%
+ \global\@namedef{CSX@newstruct@#2@structname}{#3}%
+ \global\@namedef{CSX@newstruct@#2@Structname}{#4}%
+ \global\@namedef{CSX@newstruct@#2@abbreviation}{#5}%
+ \ifthenelse{\equal{#1}{}}{}{%
+ \setcounter{CSXcaption}{0}% No need to define a new counter, just use the CSXcaption
+ \fancyref@foreach{\CSX@newsubstruct}{#2}{#1}%
+ }%
+ \AtBeginDocument{%
+ \immediate\write\@auxout{%
+ \string\fancyref@addtolist
+ {\string{#2\string}}%
+ {\string\CSX@structlist@filenamesorted}%
+ }%
+ }%
+ }{%
+ \PackageError{chemschemex}{Multiple definitions of '#2' by %
+ \string\newstruct}{}%
+ }%
+}
+\@onlypreamble\newstruct
+\DeclareRobustCommand{\structname}[1]{%
+ \@ifundefined{CSX@newstruct@#1@structname}{%
+ ???%
+ \PackageWarning{chemschemex}{No structure '#1' defined by \string\newstruct}%
+ }{%
+ \ifthenelse{\equal{\@nameuse{CSX@newstruct@#1@structname}}{}}{%
+ ???%
+ \PackageWarning{chemschemex}{structname of structure '#1' is empty.}%
+ }{%
+ \@nameuse{CSX@newstruct@#1@structname}%
+ }%
+ }%
+}
+\DeclareRobustCommand{\Structname}[1]{%
+ \@ifundefined{CSX@newstruct@#1@Structname}{%
+ ???%
+ \PackageWarning{chemschemex}{No structure '#1' defined by \string\newstruct}%
+ }{%
+ \ifthenelse{\equal{\@nameuse{CSX@newstruct@#1@Structname}}{}}{%
+ ???%
+ \PackageWarning{chemschemex}{Structname of structure '#1' is empty.}%
+ }{%
+ \@nameuse{CSX@newstruct@#1@Structname}%
+ }%
+ }%
+}
+\DeclareRobustCommand{\structabbr}[1]{%
+ \@ifundefined{CSX@newstruct@#1@abbreviation}{%
+ ???%
+ \PackageWarning{chemschemex}{No structure '#1' defined by \string\newstruct}%
+ }{%
+ \ifthenelse{\equal{\@nameuse{CSX@newstruct@#1@abbreviation}}{}}{%
+ ???%
+ \PackageWarning{chemschemex}{structabbr of structure '#1' is empty.}%
+ }{%
+ \@nameuse{CSX@newstruct@#1@abbreviation}%
+ }%
+ }%
+}
+\newcommandx\customstruct[4][1={},2={}]{%
+ % #1=TikZ option for caption
+ % #2=TikZ option for image
+ % #3=caption
+ % #4=image
+ \customstruct@outarrow[#1][#2]{#3}{#4}%
+}
+\newcommandx\struct[6][1={},2=CSX,3={},4={},5={},usedefault]{%
+ % #1=caption
+ % #2=family
+ % #3=image options
+ % #4=TikZ option for caption
+ % #5=TikZ option for image
+ % #6=filename
+ \@struct{#1}{#2}{#6}%
+ \expandnext{\customstruct[#4][#5]}{\@@struct}{\CSXimage[#3]{#6}}%
+}
+\newcommandx\structalt[7][1={},2=CSX,3={},4={},5={},usedefault]{%
+ % #1=caption
+ % #2=family
+ % #3=image options
+ % #4=TikZ option for caption
+ % #5=TikZ option for image
+ % #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}}%
+}
+\WithSuffix\newcommandx\struct*[6][1={},2=CSX,3={},4={},5={},usedefault]{%
+ % #1=caption
+ % #2=family
+ % #3=image options
+ % #4=TikZ option for caption
+ % #5=TikZ option for image
+ % #6=filename
+ \@struct*{#1}{#2}{#6}%
+ \expandnext{\customstruct[#4][#5]}{\@@struct}{\CSXimage[#3]{#6}}%
+}
+\WithSuffix\newcommandx\structalt*[7][1={},2=CSX,3={},4={},5={},usedefault]{%
+ % #1=caption
+ % #2=family
+ % #3=image options
+ % #4=TikZ option for caption
+ % #5=TikZ option for image
+ % #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}}%
+}
+\WithSuffix\newcommandx\struct-[5][1={},2={},3={},4={},usedefault]{%
+ % #1=caption
+ % #2=image options
+ % #3=TikZ option for caption
+ % #4=TikZ option for image
+ % #5=filename
+ \expandnext{\customstruct[#3][#4]}{{{},{#1}}}{\CSXimage[#2]{#5}}%
+}
+\newcommandx\Struct[6][1=CSX,2={},3={},4={},usedefault]{%
+ % #1=family
+ % #2=image options
+ % #3=TikZ option for caption
+ % #4=TikZ option for image
+ % #5=list of sublabels previously defined with \newstruct
+ % #6=filename
+ \@Struct{#1}{#5}{#6}%
+ \expandnext{\customstruct[#3][#4]}{\@@struct}{\CSXimage[#2]{#6}}%
+}
+\newcommandx\Structalt[7][1=CSX,2={},3={},4={},usedefault]{%
+ % #1=family
+ % #2=image options
+ % #3=TikZ option for caption
+ % #4=TikZ option for image
+ % #5=list of sublabels previously defined with \newstruct
+ % #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}}%
+}
+\WithSuffix\newcommandx\Struct*[6][1=CSX,2={},3={},4={},usedefault]{%
+ % #1=family
+ % #2=image options
+ % #3=TikZ option for caption
+ % #4=TikZ option for image
+ % #5=list of sublabels previously defined with \newstruct
+ % #6=filename
+ \@Struct*{#1}{#5}{#6}%
+ \expandnext{\customstruct[#3][#4]}{\@@struct}{\CSXimage[#2]{#6}}%
+}
+\WithSuffix\newcommandx\Structalt*[7][1=CSX,2={},3={},4={},usedefault]{%
+ % #1=family
+ % #2=image options
+ % #3=TikZ option for caption
+ % #4=TikZ option for image
+ % #5=list of sublabels previously defined with \newstruct
+ % #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}}%
+}
+\newcommand{\structplus}{%
+ \customstruct{}{\tikz[CSXsimple]{\draw[-](1,0)to(-1,0);\draw[-](0,1)to(0,-1);}}%
+}
+\newcommand{\structminus}{%
+ \customstruct{}{\tikz[CSXsimple]{\draw[-](1,0)to(-1,0);}}%
+}
+\def\ChemschemeNextRow@list{}%
+\newcommand{\ChemschemeNextRow}[1][]{%
+ \ExpandNext{\fancyref@addtolist}{\theCSXstruct}{\ChemschemeNextRow@list}%
+ \expandafter\def\csname ChemschemeNextRow@\theCSXstruct\endcsname{#1}%
+ \ignorespaces%
+}
+\newenvironment{Chemscheme}{%
+ \CSX@schemetrue%
+ \ignorespaces%
+}{%
+ \CSX@print%
+ \CSX@schemefalse%
+}
+\DeclareRobustCommand\structref[2][CSX]{%
+ % #1=family
+ % #2=label
+ \CSXstructref{\fancyref[#1]{#2}}%
+}
+\WithSuffix\DeclareRobustCommand\structref*[2][CSX]{%
+ % #1=family
+ % #2=label
+ \CSXstructref{\fancyref*[#1]{#2}}%
+}
+\DeclareRobustCommand\structsubref[3][CSX]{%
+ % #1=family
+ % #2=label
+ % #3=sublabel
+ \CSXstructref{\fancysubref[#1]{#2}{#3}}%
+}
+\WithSuffix\DeclareRobustCommand\structsubref-[3][CSX]{%
+ % #1=family
+ % #2=label
+ % #3=sublabel
+ \CSXstructref{\fancysubref-[#1]{#2}{#3}}%
+}
+\WithSuffix\DeclareRobustCommand\structsubref*[3][CSX]{%
+ % #1=family
+ % #2=label
+ % #3=sublabel
+ \CSXstructref{\fancysubref*[#1]{#2}{#3}}%
+}
+\newcommand{\CSXstructref}[1]{%
+ % #1=fancyref command
+ \textbf{#1}%
+}
+\newcommand{\CSXcommands}[1]{%
+ \gappto\CSX@commands{#1}%
+ \ignorespaces%
+}
+\def\CSX@commands{}%
+\newcommand{\CSX@newsubstruct}[2]{%
+ % #1=label
+ % #2=caption
+ \stepcounter{CSXcaption}%
+ \xdef\chemschemes@getcountervalue{%
+ \theCSXcaption%
+ }%
+ \expandafter\xdef\csname CSX@newstruct@#1@subcaption@%
+ \chemschemes@getcountervalue\endcsname{#2}%
+}
+\newcommand{\CSX@customarrow@widestcaption}[2]{%
+ % #1=label
+ % #2=style
+ \pgfmathwidth{"%
+ \noexpand\tikz[minimum width=0pt,inner sep=0pt,outer sep=0pt]{%
+ \noexpand\node[\expandonce{#2}]{\noexpand#1};%
+ }%
+ "}%
+ \pgfmathsetlength{\CSXlabelwidth}{\pgfmathresult}%
+ \ifnum\CSXlabelwidth>\CSXarrowlength%
+ \pgfmathsetlength{\CSXarrowlength}{\pgfmathresult}%
+ \edef\CSX@arrowlength{\pgfmathresult}%
+ \fi%
+}
+\def\CSX@savebox@set#1#2{%
+ % #1=boxname
+ % #2=box content
+ \@ifundefined{#1}{%
+ \expandnext{\newsavebox}{\csname #1\endcsname}%
+ }{}
+ \expandnext{\global\sbox}{\csname #1\endcsname}{#2}%
+ \expandnext{\usebox}{\csname #1\endcsname}%
+}%
+\def\CSX@savebox@show#1#2{%
+ % #1=boxname
+ % #2=box content
+ \expandnext{\usebox}{\csname #1\endcsname}%
+}%
+\newcommand{\customarrow}[4][\the\CSXarrowlength]{%
+ % #1=length
+ % #2=arrow style
+ % #3=upper text
+ % #4=lower text
+ \stepcounter{CSXstruct}%
+ % Measure upper und lower text
+ \setlength{\CSXarrowlength}{0pt}%
+ \def\CSX@nodename{Scheme\theCSXscheme Image\theCSXstruct}%
+ \def\CSXcustomarrow@uppertext{%
+ \let\customstruct\customstruct@inarrow%
+ \def\customstruct@inarrow@nodename{\CSX@nodename Upper}%
+ #3%
+ \let\customstruct\customstruct@outarrow%
+ }%
+ \def\CSXcustomarrow@lowertext{%
+ \let\customstruct\customstruct@inarrow%
+ \def\customstruct@inarrow@nodename{\CSX@nodename Lower}%
+ #4%
+ \let\customstruct\customstruct@outarrow%
+ }%
+ \let\CSX@savebox\CSX@savebox@set%
+ \edef\CSX@arrowlength{0}%
+ \CSX@customarrow@widestcaption{\CSXcustomarrow@uppertext}{CSXarrowfont,CSXarrowupper}%
+ \CSX@customarrow@widestcaption{\CSXcustomarrow@lowertext}{CSXarrowfont,CSXarrowlower}%
+ \let\CSX@savebox\CSX@savebox@show%
+ % Set matrix entries
+ \pgfmathsetlength{\CSXarrowlength}{\CSX@arrowlength + \CSXarrowadvance}%
+ \edef\customarrow@temp{%
+ % Reserve space in matrix
+ \noexpand\node(\CSX@nodename)%
+ {\noexpand\hbox to #1{}};%
+ % Add arrow command
+ \noexpand\CSXcommands{%
+ \noexpand\pgfmathsetlength{\noexpand\CSXarrowlength}{#1}%
+ \noexpand\def\noexpand\CSXnodename{\CSX@nodename}%
+ \noexpand\draw [text width=(#1-\CSXarrowadvance),#2]%
+ ([CSXshiftA]\noexpand\CSXnodename .west) to%
+ node (\noexpand\CSXnodename Upper)%
+ [CSXshiftcompensation,CSXarrowfont,CSXarrowupper,auto]%
+ {\expandonce\CSXcustomarrow@uppertext}%
+ node (\noexpand\CSXnodename Lower)%
+ [CSXshiftcompensation,CSXarrowfont,CSXarrowlower,auto,swap]%
+ {\expandonce\CSXcustomarrow@lowertext}%
+ ([CSXshiftB]\noexpand\CSXnodename .east);%
+ }%
+ }%
+ \expandnext{\expandafter\gdef\csname CSX@list@image@\theCSXstruct\endcsname}{%
+ \customarrow@temp%
+ }%
+ \expandafter\gdef\csname CSX@list@caption@\theCSXstruct\endcsname{%
+ \node(Scheme\theCSXscheme Caption\theCSXstruct){};%
+ }%
+ \ifCSX@scheme%
+ % Inside Chemscheme environment
+ \else%
+ % Outside Chemscheme environment
+ \CSX@print%
+ \fi%
+ \ignorespaces%
+}
+\newcommand{\CSXdeclarearrow}[2]{%
+ % #1=macro name
+ % #2=TikZ style
+ \newcommand{#1}[3][\the\CSXarrowlength]{%
+ % ##1=length
+ % ##2=upper caption
+ % ##3=lower caption
+ \customarrow[##1]{#2}{##2}{##3}%
+ }
+}
+\newcommand{\CSXdeclarearrowbundle}[2]{%
+ % #1=macro name
+ % #2=TikZ style
+ % normal
+ \CSX@declarearrowbundle{#1}{#2}%
+ % dashed
+ \CSX@declarearrowbundle{#1Dashed}{#2,dashed}%
+}
+\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}%
+}
+\CSXdeclarearrowbundle{RightArrow}{CSXallarrows,CSXRightArrow}
+\CSXdeclarearrowbundle{LeftArrow}{CSXallarrows,CSXLeftArrow}
+\CSXdeclarearrowbundle{LeftRightArrow}{CSXallarrows,CSXLeftRightArrow}
+\CSXdeclarearrowbundle{DoubleRightArrow}{CSXallarrows,CSXdoublearrows,CSXRightArrow}
+\CSXdeclarearrowbundle{DoubleLeftArrow}{CSXallarrows,CSXdoublearrows,CSXLeftArrow}
+\CSXdeclarearrowbundle{DoubleLeftRightArrow}{CSXallarrows,CSXdoublearrows,CSXLeftRightArrow}
+\CSXdeclarearrowbundle{RightupHarpoon}{CSXallarrows,CSXRightupHarpoon}
+\CSXdeclarearrowbundle{RightdownHarpoon}{CSXallarrows,CSXRightdownHarpoon}
+\CSXdeclarearrowbundle{LeftupHarpoon}{CSXallarrows,CSXLeftupHarpoon}
+\CSXdeclarearrowbundle{LeftdownHarpoon}{CSXallarrows,CSXLeftdownHarpoon}
+\CSXdeclarearrowbundle{LeftupRightupHarpoon}{CSXallarrows,CSXLeftupRightupHarpoon}
+\CSXdeclarearrowbundle{LeftupRightdownHarpoon}{CSXallarrows,CSXLeftupRightdownHarpoon}
+\CSXdeclarearrowbundle{LeftdownRightupHarpoon}{CSXallarrows,CSXLeftdownRightupHarpoon}
+\CSXdeclarearrowbundle{LeftdownRightdownHarpoon}{CSXallarrows,CSXLeftdownRightdownHarpoon}
+\CSXdeclarearrowbundle{Equilibrium}{CSXallarrows,CSXequilibrium,CSXRightupHarpoon}
+\CSXdeclarearrowbundle{RightEquilibrium}{CSXallarrows,CSXRightequilibrium,CSXRightupHarpoon}
+\CSXdeclarearrowbundle{LeftEquilibrium}{CSXallarrows,CSXLeftequilibrium,CSXRightupHarpoon}
+\CSXdeclarearrowbundle{RRightEquilibrium}{CSXallarrows,CSXLeftequilibrium,CSXLeftupHarpoon}
+\CSXdeclarearrowbundle{LLeftEquilibrium}{CSXallarrows,CSXRightequilibrium,CSXLeftupHarpoon}
+\CSXdeclarearrowbundle{TwoRightArrow}{CSXallarrows,CSXslashtwoarrow,CSXRightArrow}
+\CSXdeclarearrowbundle{TTwoRightArrow}{CSXallarrows,CSXbackslashtwoarrow,CSXRightArrow}
+\CSXdeclarearrowbundle{TwoLeftArrow}{CSXallarrows,CSXslashtwoarrow,CSXLeftArrow}
+\CSXdeclarearrowbundle{TTwoLeftArrow}{CSXallarrows,CSXbackslashtwoarrow,CSXLeftArrow}
+\CSXdeclarearrowbundle{ThreeRightArrow}{CSXallarrows,CSXslashthreearrow,CSXRightArrow}
+\CSXdeclarearrowbundle{TThreeRightArrow}{CSXallarrows,CSXbackslashthreearrow,CSXRightArrow}
+\CSXdeclarearrowbundle{ThreeLeftArrow}{CSXallarrows,CSXslashthreearrow,CSXLeftArrow}
+\CSXdeclarearrowbundle{TThreeLeftArrow}{CSXallarrows,CSXbackslashthreearrow,CSXLeftArrow}
+\newcommand{\@struct}[3]{%
+ % #1=caption
+ % #2=family
+ % #3=filename
+ \ifthenelse{\equal{#1}{}}{%
+ \def\@@struct{{{\fancylabel[#2]{#3}},{}}}%
+ }{%
+ \def\@@struct{{{\def\fancylabelShowLabelEvent{\CSXlabelsep}\fancylabel[#2]{#3}},{#1}}}%
+ }%
+}
+\WithSuffix\newcommand\@struct*[3]{%
+ % #1=caption
+ % #2=family
+ % #3=filename
+ \def\@@struct{{{\fancylabel*[#2]{#3}},{#1}}}%
+}
+\newcommand\@Struct[3]{%
+ % #1=family
+ % #2=list of sublabels previously defined with \newstruct
+ % #3=filename
+ % Use the sort-function of the fancylabel package to sort the label-list
+ \def\@@struct{}%
+ \def\fancyref@@@@@sort{fancyref@PrevRun@#1@#3@\fancyref@@sort@value}%
+ \def\fancyref@sort@list{}%
+ \def\fancyref@sort@labellist@unsorted{}%
+ \fancyref@sort{#2}%
+ \expandnext{\fancyref@addtolist}%
+ {\fancyref@sort@labellist@unsorted}%
+ {\fancyref@sort@list}%
+ \edef\CSX@sorted@list{\fancyref@sort@list}%
+ % Generate the caption
+ \def\@Struct@family{#1}%
+ \def\@Struct@filename{#3}%
+ \expandnext{\fancyref@foreach{\@@Struct}{}}{\CSX@sorted@list}%
+}
+\newcommand{\@@Struct}[2]{%
+ % #1=
+ % #2=sublabel
+ \@ifundefined{CSX@newstruct@\@Struct@filename @subcaption@#2}{%
+ \PackageError{chemschemex}{Substructure '#2' not defined as %
+ substructure of '\@Struct@filename '. %
+ Use the \noexpand\newstruct command for %
+ the definition of substructures.}{}%
+ }{%
+ \fancyref@addtolist{%
+ {{\def\fancylabelShowLabelEvent{\CSXlabelsep}\fancysublabel[\@Struct@family]{\@Struct@filename}{#2}},%
+ {\@nameuse{CSX@newstruct@\@Struct@filename @subcaption@#2}}}}%
+ {\@@struct}%
+ }%
+}
+\WithSuffix\newcommand\@Struct*[3]{%
+ % #1=family
+ % #2=list of sublabels previously defined with \newstruct
+ % #3=filename
+ \def\@@struct{{{\fancysublabel[#1]{#3}{#2}},{}}}%
+}
+\newcommandx\customstruct@outarrow[4][1={},2={}]{%
+ % #1=TikZ option for caption
+ % #2=TikZ option for image
+ % #3=caption
+ % #4=image
+ \stepcounter{CSXstruct}%
+ % Set Image
+ \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%
+ }%
+ % Generate caption
+ \CSXgeneratecaption{#3}{#4}{Scheme\theCSXscheme Caption\theCSXstruct}{#1}%
+ % Set caption
+ \edef\customstruct@outarrow@temp{%
+ \noexpand\node(Scheme\theCSXscheme Caption\theCSXstruct){%
+ \noexpand\tikz[CSXcaption,\expandonce{#1}]{%
+ \expandonce\CSXcaption%
+ }%
+ };%
+ }%
+ \expandnext{\expandafter\gdef\csname CSX@list@caption@\theCSXstruct\endcsname}{%
+ \customstruct@outarrow@temp%
+ }%
+ \ifCSX@scheme%
+ % Inside Chemscheme environment
+ \else%
+ % Outside Chemscheme environment
+ \CSX@print%
+ \fi%
+ \ignorespaces%
+}
+\newcommandx\customstruct@inarrow[4][1={},2={}]{%
+ % #1=TikZ option for caption
+ % #2=TikZ option for image
+ % #3=caption
+ % #4=image
+ \stepcounter{CSXstructinarrow}%
+ \CSXgeneratecaption{#3}{#4}{\customstruct@inarrow@nodename Caption\theCSXstructinarrow}{#1}%
+ \ifthenelse{\CSXmaxlabelwidth=0 \AND \CSXmaxtextwidth=0}{%
+ \edef\customstruct@inarrow@temp{%
+ \noexpand\tikz[remember picture,CSXStructInArrow]{%
+ \noexpand\node [\expandonce{#2}]%
+ (\customstruct@inarrow@nodename Image\theCSXstructinarrow)%
+ {\expandonce{#4}};%
+ }%
+ }%
+ }{%
+ \edef\customstruct@inarrow@temp{%
+ \noexpand\tikz[remember picture,CSXStructInArrow,%
+ baseline=(\CSX@generate@caption@captionname Entry\theCSXcaption .base)]{%
+ \noexpand\node [\expandonce{#2}]%
+ (\customstruct@inarrow@nodename Image\theCSXstructinarrow)%
+ {\expandonce{#4}};%
+ \noexpand\node [below=of \customstruct@inarrow@nodename Image\theCSXstructinarrow]%
+ (\customstruct@inarrow@nodename Caption\theCSXstructinarrow)%
+ {\noexpand\tikz[CSXcaption,\expandonce{#1}]{\expandonce\CSXcaption}};%
+ }%
+ }%
+ }%
+ \expandnext{\CSX@savebox{CSX@savebox@\theCSXstructinarrow}}{%
+ \customstruct@inarrow@temp%
+ }%
+ \ignorespaces%
+}
+\newcommand{\CSXgeneratecaption}[4]{%
+ % #1=list of labels and text: {{label1},{text1}},{{label2},{text2}},...
+ % #2=Image
+ % #3=caption name
+ % #4=caption style
+ \setcounter{CSXcaption}{0}%
+ \setlength{\CSXmaxlabelwidth}{0pt}%
+ \setlength{\CSXmaxtextwidth}{0pt}%
+ \def\CSXcaption{}%
+ \def\CSX@generate@caption@image{#2}%
+ \def\CSX@generate@caption@captionname{#3}%
+ \def\CSX@generate@caption@captionstyle{CSXcaption,#4}%
+ \CSX@generate@@@caption@true%
+ \ifthenelse{\equal{#1}{}}{}{%
+ \expandnext\expandnext\expandnext{%
+ \fancyref@foreach{\CSX@generate@@caption}{}%
+ }{#1}%
+ }%
+}
+\newcommand{\CSX@generate@@caption}[2]{%
+ % #1=
+ % #2=label and text: {label1},{text1}
+ \edef\CSX@generate@@@caption@lastCSXcaption{\theCSXcaption}%
+ \stepcounter{CSXcaption}%
+ \fancyref@foreach{\CSX@generate@@@caption}{}{#2}%
+ % Execute text-only event
+ \ifCSX@generate@@@caption@\else%
+ \CSX@generate@@@caption@TextOnly%
+ {\CSX@generate@caption@image}%
+ {\CSX@generate@caption@captionname Entry\theCSXcaption}%
+ {\CSX@generate@caption@captionname Entry\CSX@generate@@@caption@lastCSXcaption}%
+ {\CSX@generate@@@caption@label}%
+ \CSX@generate@@@caption@true%
+ \fi%
+}
+\newcommand{\CSX@generate@@@caption}[2]{%
+ % #1=
+ % #2=label or text: label1 or text1
+ \ifCSX@generate@@@caption@%
+ % Label
+ \def\CSX@generate@@@caption@label{#2}%
+ \CSX@generate@@@caption@false%
+ \else%
+ % Text and execute label-and-text event
+ \def\CSX@generate@@@caption@text{#2}%
+ \CSX@generate@@@caption@LabelAndText%
+ {\CSX@generate@caption@image}%
+ {\CSX@generate@caption@captionname Entry\theCSXcaption}%
+ {\CSX@generate@caption@captionname Entry\CSX@generate@@@caption@lastCSXcaption}%
+ {\CSX@generate@@@caption@label}%
+ {\CSX@generate@@@caption@text}%
+ \CSX@generate@@@caption@true%
+ \def\CSX@generate@@@caption@label{}%
+ \def\CSX@generate@@@caption@text{}%
+ \fi%
+}
+\newcommand{\CSX@setimagewidth}[1]{%
+ % #1=image
+ \pgfmathwidth{"%
+ \noexpand\tikz[minimum width=0pt,inner sep=0pt,outer sep=0pt]{%
+ \noexpand\node{\noexpand#1};%
+ }%
+ "}%
+ \edef\CSX@imagewidth{\pgfmathresult}%
+}
+\newcommand{\CSX@setmaxlabelwidth}[1]{%
+ % #1=label
+ \pgfmathwidth{"%
+ \noexpand\tikz[\expandonce\CSX@generate@caption@captionstyle ,minimum width=0pt,inner sep=0pt,outer sep=0pt]{%
+ \noexpand\node[CSXlabelfont]{\noexpand#1};%
+ }%
+ "}%
+ \pgfmathsetlength{\CSXlabelwidth}{\pgfmathresult}%
+ \edef\CSX@labelwidth{\pgfmathresult}%
+ \ifnum\CSXlabelwidth<\CSXmaxlabelwidth%
+ \else%
+ \pgfmathsetlength{\CSXmaxlabelwidth}{\pgfmathresult}%
+ \edef\CSX@maxlabelwidth{\pgfmathresult}%
+ \fi%
+}
+\newcommand{\CSX@settextwidth}[1]{%
+ % #1=text
+ \pgfmathwidth{"%
+ \noexpand\tikz[\expandonce\CSX@generate@caption@captionstyle ,minimum width=0pt,inner sep=0pt,outer sep=0pt]{%
+ \noexpand\node[CSXtextfont]{\noexpand#1};%
+ }%
+ "}%
+ \pgfmathsetlength{\CSXtextwidth}{\pgfmathresult}%
+ \edef\CSX@textwidth{\pgfmathresult}%
+ \ifnum\CSXtextwidth<\CSXmaxtextwidth%
+ \else%
+ \pgfmathsetlength{\CSXmaxtextwidth}{\pgfmathresult}%
+ \edef\CSX@maxtextwidth{\pgfmathresult}%
+ \fi%
+}
+\newcommand{\CSX@setvphantom}{%
+ \ifdim\CSXlabelwidth=0pt%
+ \ifdim\CSXtextwidth=0pt%
+ \def\CSX@vphantom{}%
+ \else%
+ \def\CSX@vphantom{font/.expand once={\tikz@textfont\vphantom{Ag}}}%
+ \fi%
+ \else%
+ \def\CSX@vphantom{font/.expand once={\tikz@textfont\vphantom{Ag}}}%
+ \fi%
+}
+\newcommand{\CSX@generate@@@caption@LabelAndText}[5]{%
+ % #1=image command
+ % #2=node name
+ % #3=last node name
+ % #4=label
+ % #5=text
+ % Get the image width
+ \CSX@setimagewidth{#1}%
+ % Get the widest label
+ \CSX@setmaxlabelwidth{#4}%
+ % Measure the text width
+ \def\CSX@textwidth{0}%
+ \CSX@settextwidth{#5}%
+ \CSX@setvphantom%
+ % Typeset caption
+ \edef\CSX@generate@@@caption@tempentry{%
+ \noexpand\gappto\noexpand\CSXcaption{%
+ % Set \CSXimagewidth
+ \noexpand\pgfmathsetlength{\noexpand\CSXimagewidth}%
+ {\CSX@imagewidth}%
+ % Set \CSXlabelwidth
+ \noexpand\pgfmathsetlength{\noexpand\CSXlabelwidth}%
+ {\CSX@labelwidth}%
+ % Set \CSXmaxlabelwidth
+ \noexpand\pgfmathsetlength{\noexpand\CSXmaxlabelwidth}%
+ {\CSX@maxlabelwidth}%
+ % Set \CSXtextwidth
+ \noexpand\pgfmathsetlength{\noexpand\CSXtextwidth}%
+ {\CSX@textwidth}%
+ % Set \CSXmaxtextwidth
+ \noexpand\pgfmathsetlength{\noexpand\CSXmaxtextwidth}%
+ {\CSX@maxtextwidth}%
+ % Print node
+ \noexpand\node(#2)[%
+ CSXlabelfont,%
+ \expandonce\CSX@vphantom,%
+ CSXsetlabelwidth,%
+ CSXcaptionLabelandText,%
+ rectangle split,%
+ rectangle split horizontal,%
+ rectangle split parts=2,%
+ rectangle split part align=base,%
+ every two node part/.append style={%
+ CSXtextfont,%
+ CSXsettextwidth,%
+ },%
+ \ifCSX@generate@@@caption@LastEntryWasTextOnly%
+ \ifnum\theCSXcaption>1%
+ below=of #3.south,%
+ \fi%
+ \else%
+ \ifnum\theCSXcaption>1%
+ below left=of #3.one split south,%
+ \fi%
+ anchor=one split north%
+ \fi%
+ ]{%
+ \expandonce#4%
+ \noexpand\nodepart{two}%
+ \expandonce#5%
+ };%
+ }%
+ }\CSX@generate@@@caption@tempentry%
+ \CSX@generate@@@caption@LastEntryWasTextOnlyfalse%
+}
+\newcommand{\CSX@generate@@@caption@TextOnly}[4]{%
+ % #1=image command
+ % #2=node name
+ % #3=last node name
+ % #4=label
+ % Get the image width
+ \CSX@setimagewidth{#1}%
+ % Get the widest label
+ \CSX@setmaxlabelwidth{}%
+ % Measure the text width
+ \def\CSX@textwidth{0}%
+ \CSX@settextwidth{#4}%
+ \CSX@setvphantom%
+ % Typeset caption
+ \edef\CSX@generate@@@caption@tempentry{%
+ \noexpand\gappto\noexpand\CSXcaption{%
+ % Set \CSXimagewidth
+ \noexpand\pgfmathsetlength{\noexpand\CSXimagewidth}%
+ {\CSX@imagewidth}%
+ % Set \CSXmaxlabelwidth
+ \noexpand\pgfmathsetlength{\noexpand\CSXmaxlabelwidth}%
+ {\CSX@maxlabelwidth}%
+ % Set \CSXtextwidth
+ \noexpand\pgfmathsetlength{\noexpand\CSXtextwidth}%
+ {\CSX@textwidth}%
+ % Set \CSXmaxtextwidth
+ \noexpand\pgfmathsetlength{\noexpand\CSXmaxtextwidth}%
+ {\CSX@maxtextwidth}%
+ % Print node
+ \noexpand\node(#2)[%
+ CSXtextfont,%
+ \expandonce\CSX@vphantom,%
+ CSXsettextwidth,%
+ CSXcaptionTextOnly,%
+ \ifnum\theCSXcaption>1%
+ below=of #3.south,%
+ \fi%
+ ]{%
+ \expandonce#4%
+ };%
+ }%
+ }\CSX@generate@@@caption@tempentry%
+ \CSX@generate@@@caption@LastEntryWasTextOnlytrue%
+}
+\newcommand{\CSX@print}{%
+ \ifnum\theCSXstruct=0%
+ \PackageWarning{chemschemex}{Empty Chemscheme environment detected.}
+ \else%
+ \let\CSX@printlist\empty%
+ \CSX@@print%
+ \fi%
+ \setcounter{CSXstructinarrow}{0}%
+ % Print scheme
+ \begin{tikzpicture}[CSX]%
+ \matrix [CSXmatrix]{%
+ \CSX@printlist%
+ };%
+ \CSX@commands%
+ \end{tikzpicture}%
+ \stepcounter{CSXscheme}%
+ \setcounter{CSXstruct}{0}%
+ \setcounter{CSXstructinarrow}{0}%
+ \gdef\CSX@printlist{}%
+ \gdef\CSX@commands{}%
+ \gdef\ChemschemeNextRow@list{}%
+}
+\newcommand{\CSX@@print}{%
+ % #1=
+ % #2=row (integer)
+ \def\lastx{1}%
+ \ChemschemeNextRow%
+ \foreach \x [remember=\xplus as \lastx,%
+ evaluate=\x as \xplus using int(\x+1)]%
+ in \ChemschemeNextRow@list {%
+ \ifthenelse{\x < \lastx}{}{%
+ % Create Image row
+ \foreach \y in {\lastx,...,\x}{%
+ \CSX@@@print{\csname CSX@list@image@\y\endcsname}%
+ }%
+ \gappto\CSX@printlist{\pgfmatrixendrow}%
+ % Create Caption row
+ \foreach \y in {\lastx,...,\x}{%
+ \CSX@@@print{\csname CSX@list@caption@\y\endcsname}%
+ }%
+ \edef\CSX@print@tempentry{%
+ \noexpand\gappto\noexpand\CSX@printlist{%
+ \noexpand\pgfmatrixendrow[\csname ChemschemeNextRow@\x\endcsname]%
+ }%
+ }\CSX@print@tempentry%
+ }%
+ }%
+}
+\newcommand{\CSX@@@print}[2]{%
+ % #1=image
+ \ifnum\y<\x%
+ \def\CSX@@@print@nextcell{\pgfmatrixnextcell}%
+ \else%
+ \def\CSX@@@print@nextcell{}%
+ \fi%
+ \edef\CSX@print@tempentry{%
+ \noexpand\gappto\noexpand\CSX@printlist{%
+ \noexpand#1%
+ \expandonce\CSX@@@print@nextcell%
+ }%
+ }\CSX@print@tempentry%
+}
+\endinput
+%%
+%% End of file `chemschemex.sty'.
diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check
index 0af4e7454ee..dab3d446f4c 100755
--- a/Master/tlpkg/bin/tlpkg-ctan-check
+++ b/Master/tlpkg/bin/tlpkg-ctan-check
@@ -114,7 +114,7 @@ my @TLP_working = qw(
changebar changelayout changepage changes chappg chapterfolder
chbibref checkcites chem-journal
chemarrow chembst chemcompounds chemcono chemexec chemfig chemmacros
- chemnum chemstyle cherokee
+ chemnum chemschemex chemstyle cherokee
chess chess-problem-diagrams chessboard chessfss chet chextras
chicago chicago-annote chickenize chkfloat chletter chngcntr chronology
chronosys chscite
diff --git a/Master/tlpkg/tlpsrc/chemschemex.tlpsrc b/Master/tlpkg/tlpsrc/chemschemex.tlpsrc
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/Master/tlpkg/tlpsrc/chemschemex.tlpsrc
diff --git a/Master/tlpkg/tlpsrc/collection-science.tlpsrc b/Master/tlpkg/tlpsrc/collection-science.tlpsrc
index d1136748997..fd71435aa5a 100644
--- a/Master/tlpkg/tlpsrc/collection-science.tlpsrc
+++ b/Master/tlpkg/tlpsrc/collection-science.tlpsrc
@@ -19,6 +19,7 @@ depend chemcono
depend chemexec
depend chemmacros
depend chemnum
+depend chemschemex
depend chemstyle
depend clrscode
depend complexity