diff options
author | Karl Berry <karl@freefriends.org> | 2015-02-15 21:22:35 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-02-15 21:22:35 +0000 |
commit | d42d754b7221848c99e2b317971befc5b99e3f01 (patch) | |
tree | bee5777a70b20cb87c41597c498f4d0c3893bb49 /Master/texmf-dist/tex/generic | |
parent | 0d7717ecf698ce267020b7f955fecfdf936d6fb3 (diff) |
chemfig (15feb15)
git-svn-id: svn://tug.org/texlive/trunk@36283 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic')
-rw-r--r-- | Master/texmf-dist/tex/generic/chemfig/chemfig.sty | 8 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/chemfig/chemfig.tex | 338 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/chemfig/t-chemfig.tex | 8 |
3 files changed, 243 insertions, 111 deletions
diff --git a/Master/texmf-dist/tex/generic/chemfig/chemfig.sty b/Master/texmf-dist/tex/generic/chemfig/chemfig.sty index 7fa40b6993a..8afac04a939 100644 --- a/Master/texmf-dist/tex/generic/chemfig/chemfig.sty +++ b/Master/texmf-dist/tex/generic/chemfig/chemfig.sty @@ -1,20 +1,20 @@ % __________________________________________________________________ % | | % | | -% | chemfig v1.0h | +% | chemfig v1.1 | % | | -% | November 28, 2013 | +% | 15 february 2015 | % | | % |__________________________________________________________________| % % This is t-chemfig.tex, the package file for conTeXt. % % Maintainer: Christian Tellechea -% E-mail : unbonpetit@gmail.com +% E-mail : unbonpetit@openmailbox.org % Comments, bug reports and suggestions are welcome. % Licence : Released under the LaTeX Project Public License v1.3c or % later, see http://www.latex-project.org/lppl.txt -% Copyright : Christian Tellechea 2010-2012 +% Copyright : Christian Tellechea 2010-2015 % % The "chemfig" package consists of the 8 following files: % chemfig.tex (the code of the package) diff --git a/Master/texmf-dist/tex/generic/chemfig/chemfig.tex b/Master/texmf-dist/tex/generic/chemfig/chemfig.tex index 4612414d9b9..a97657cdc9e 100644 --- a/Master/texmf-dist/tex/generic/chemfig/chemfig.tex +++ b/Master/texmf-dist/tex/generic/chemfig/chemfig.tex @@ -1,28 +1,28 @@ % __________________________________________________________________ % | | % | | -% | chemfig v1.0h | +% | chemfig v1.1 | % | | -% | November 28, 2013 | +% | 15 february 2015 | % | | % |__________________________________________________________________| % % This is chemfig.tex, the code of the "chemfig" package. % % Maintainer: Christian Tellechea -% E-mail : unbonpetit@gmail.com +% E-mail : unbonpetit@openmailbox.org % Comments, bug reports and suggestions are welcome. % Licence : Released under the LaTeX Project Public License v1.3c or % later, see http://www.latex-project.org/lppl.txt -% Copyright : Christian Tellechea 2010-2013 +% Copyright : Christian Tellechea 2010-2015 % % The "chemfig" package consists of the 8 following files: -% chemfig.tex (this file) -% chemfig.sty (the package file for LaTeX) -% t-chemfig.tex (the package file for conTeXt) -% README -% chemfig_doc_en.tex, chemfig_doc_en.pdf (english manual) -% chemfig_doc_fr.tex, chemfig_doc_fr.pdf (manual in french) +% - chemfig.tex (this file) +% - chemfig.sty (the package file for LaTeX) +% - t-chemfig.tex (the package file for conTeXt) +% - README +% - chemfig_doc_en.tex, chemfig_doc_en.pdf (english manual) +% - chemfig_doc_fr.tex, chemfig_doc_fr.pdf (manual in french) % % -------------------------------------------------------------------- % This work may be distributed and/or modified under the @@ -40,32 +40,34 @@ % The Current Maintainer of this work is Christian Tellechea % -------------------------------------------------------------------- -% Sauvegarde tous les catcodes des caract\`eres sp\'eciaux sauf # -\begingroup - \def\X#1{\catcode\number`#1=\number\catcode`#1\relax} - \expandafter\xdef\csname CF@savedcatcode\endcsname{% - \X\[\X\]\X\:\X\(\X\)\X\,\X\-\X\=\X\~\X\!\X\?\X\<\X\>\X\;\X\*\X\|\X\@\X\ % - } -\endgroup +\def\usechemfigcatcode{% + \begingroup + \def\X##1{\catcode\number`##1=\number\catcode`##1\relax} + \xdef\chemfigrestorecatcode{% + \X\[\X\]\X\:\X\(\X\)\X\,\X\-\X\=\X\~\X\!\X\?\X\<\X\>\X\;\X\*\X\|\X\@\X\ + \let\noexpand\chemfigrestorecatcode\relax + }% + \endgroup + \catcode`\[12 \catcode`\]12 \catcode`\:12 \catcode`\(12 + \catcode`\)12 \catcode`\,12 \catcode`\-12 \catcode`\=12 + \catcode`\~12 \catcode`\!12 \catcode`\?12 \catcode`\<12 + \catcode`\>12 \catcode`\;12 \catcode`\*12 \catcode`\|12 + \catcode`\@11 \catcode`\#6 \catcode`\ 10 +} -% Pour la dur\'ee de lecture du package, changer les catcodes : -\catcode`\[12 \catcode`\]12 \catcode`\:12 \catcode`\(12 -\catcode`\)12 \catcode`\,12 \catcode`\-12 \catcode`\=12 -\catcode`\~12 \catcode`\!12 \catcode`\?12 \catcode`\<12 -\catcode`\>12 \catcode`\;12 \catcode`\*12 \catcode`\|12 -\catcode`\@11 \catcode`\#6 \catcode`\ 10 +\usechemfigcatcode % V\'erifie que eTeX est le moteur utilis\'e \begingroup -\edef\CF@ver{\meaning\eTeXversion} -\edef\CF@date{\string\eTeXversion} -\ifx\CF@ver\CF@date - \endgroup -\else - \endgroup - \errmessage{Package chemfig Error: you are not using the eTeX engine, chemfig cannot work and is not loaded.}% - \expandafter\endinput -\fi + \edef\CF@ver{\meaning\eTeXversion} + \edef\CF@date{\string\eTeXversion} + \ifx\CF@ver\CF@date + \endgroup + \else + \endgroup + \errmessage{Package chemfig Error: you are not using the eTeX engine, chemfig cannot work and is not loaded.}% + \expandafter\endinput + \fi \def\CF@def#1{% \ifdefined#1% @@ -74,10 +76,10 @@ \def#1% } -\CF@def\CF@ver {1.0h} -\CF@def\CF@date {2013/11/28} -\CF@def\CF@fr@date {28 novembre 2013} -\CF@def\CF@en@date {November 28, 2013} +\CF@def\CF@ver {1.1} +\CF@def\CF@date {2015/02/15} +\CF@def\CF@fr@date {15 f\'evrier 2015} +\CF@def\CF@en@date {15 february 2015} \CF@def\CF@package@name{chemfig} \expandafter\ifx\csname @latexerr\endcsname\relax% on n'utilise pas LaTeX ? @@ -120,6 +122,8 @@ \CF@def\printatom#1{\ensuremath{\mathrm{#1}}}% \printatom pour LaTeX. \fi +\CF@def\CF@ifx#1#2{\ifx#1#2\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi} + \newcount\CF@cnt@atomingroup \newcount\CF@cnt@groupnumber \newcount\CF@cnt@atomnumber @@ -129,6 +133,11 @@ \newif\ifCF@cyclearc \newif\ifCF@definesubmol \newif\ifCF@name@dp@adjust +\newif\ifCF@macrofixedbondlength +\newif\ifCF@globalfixedbondlength +\def\enablefixedbondlength{\global\CF@globalfixedbondlengthtrue} +\def\disablefixedbondlength{\global\CF@globalfixedbondlengthfalse} +\disablefixedbondlength \newdimen\CF@dim @@ -265,7 +274,7 @@ \CF@def\CF@after@integer#1\relax{% \endgroup - \ifx\@empty#1\@empty\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi + \CF@ifx{\@empty#1}\@empty } \CF@def\CF@swap@fi#1\fi{\fi#1} @@ -311,7 +320,7 @@ \CF@def\CF@if@firsttokmatch#1#2{% est ce que #1 et #2 commencent par les m\^emes tokens ? \futurelet\CF@toks@a\CF@gobble@tonil#1\relax\@nil \futurelet\CF@toks@b\CF@gobble@tonil#2\relax\@nil - \ifx\CF@toks@a\CF@toks@b\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi + \CF@ifx\CF@toks@a\CF@toks@b } \CF@def\CF@if@firsttokin#1{% teste si le token qui commence #1 appartient aux tokens mis dans #2 @@ -353,11 +362,11 @@ \let#3\@empty \else \futurelet\CF@toks@a\CF@gobble@tonil#1\relax\@nil - \ifx\CF@toks@a\@sptoken\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi + \CF@ifx\CF@toks@a\@sptoken {\CF@add@tocs#2{ }% \CF@swap@fi\expandafter\CF@seek@node@i\expandafter{\CF@after@space#1\@nil}#2#3% }% - {\ifx\CF@toks@a\bgroup\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi + {\CF@ifx\CF@toks@a\bgroup {\CF@expadd@tocs#2{\expandafter{\@car#1\@nil}}% \CF@swap@fi\expandafter\CF@seek@node@i\expandafter{\@gobble#1}#2#3% }% @@ -373,7 +382,7 @@ % on sait que #1 commence par -,=,~,<,>. On analyse cette liaison % #2 reçoit le type de liaisons (1 pour -, 2 pour =, 3 pour ~) -\CF@def\CF@bond@findnum#1#2{% +\CF@def\CF@bond@findcode#1#2{% \futurelet\CF@toks@a\CF@gobble@tonil#1\@nil \edef#2{% \ifx-\CF@toks@a1% @@ -418,7 +427,7 @@ } \CF@def\CF@analyse@bond#1#2{% - \CF@bond@findnum{#1}#2% + \CF@bond@findcode{#1}#2% \expandafter\def\expandafter\CF@remain@afterbond\expandafter{\@gobble#1}%mange le premier signe de la liaison \let\CF@doublebond@type\z@ \ifnum#2=\tw@% si c'est une double liaison, regarde s'il y a un + ou - derri\`ere @@ -454,6 +463,7 @@ }% \ifCF@incycle \pgfmathparse{360/\CF@cycle@num+\CF@initcycle@angle}% + \let\CF@cycle@increment@angle\pgfmathresult \edef\CF@current@stringangle{::+\pgfmathresult}% \def\CF@initcycle@angle{0}% \let\CF@current@length\CF@default@length% et on ignore la longueur de liaison sp\'ecifi\'ee @@ -534,6 +544,7 @@ } \CF@def\CF@seek@submol{% + \expandafter\def\expandafter\CF@remain@molecule\expandafter{\romannumeral-`\.\expandafter\noexpand\CF@remain@molecule}% \expandafter\CF@if@firsttokmatch\expandafter{\CF@remain@molecule}!% {\expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter \CF@remain@molecule\expandafter\expandafter\expandafter{\expandafter\@gobble\CF@remain@molecule}% enl\`eve le ``!'' @@ -553,11 +564,13 @@ \expandafter\def\expandafter#1\expandafter{\expandafter{\expandafter}#1}% } -\CF@def\chemfig{\@testopt\CF@chemfig@i{}} +\CF@def\chemfig{\@ifstar{\CF@macrofixedbondlengthtrue\chemfig@i}{\CF@macrofixedbondlengthfalse\chemfig@i}} -\CF@def\CF@chemfig@i[#1]{\@testopt{\CF@chemfig@ii[#1]}{}} +\CF@def\chemfig@i{\ifCF@globalfixedbondlength\CF@macrofixedbondlengthtrue\fi\@testopt\CF@chemfig@ii{}} -\CF@def\CF@chemfig@ii[#1][#2]{% +\CF@def\CF@chemfig@ii[#1]{\@testopt{\CF@chemfig@iii[#1]}{}} + +\CF@def\CF@chemfig@iii[#1][#2]{% \edef\CF@tmp@str{[remember picture,every node/.style={anchor=base,inner sep=\z@,outer sep=\z@,minimum size=\z@\ifx\@empty#2\@empty\else,#2\fi},baseline\ifx\@empty#1\@empty\else,#1\fi]}% \expandafter\tikzpicture\CF@tmp@str \begingroup @@ -577,19 +590,22 @@ \let\CF@default@fromatom\@empty% numero de l'atome d'o\`u partent les liaisons par d\'efaut \let\CF@default@toatom\@empty% num\'ero de l'atome o\`u arrivent les laisons par d\'efaut \let\CF@default@tikz\@empty + \let\CF@previous@bondangle\empty + \let\CF@joinbond\z@ + \let\CF@previous@tikz\empty \everyeof{\@nil}\endlinechar\m@ne \CF@sanitize@catcode - \CF@chemfig@iii + \CF@chemfig@iv } -\CF@def\CF@chemfig@iii#1{% +\CF@def\CF@chemfig@iv#1{% \expandafter\assign@tonil\expandafter\CF@remain@molecule\scantokens{#1}% - \expandafter\CF@chemfig@iv\expandafter{\CF@remain@molecule}% + \expandafter\CF@chemfig@v\expandafter{\CF@remain@molecule}% \endtikzpicture \let\CF@split@state\z@ } -\CF@def\CF@chemfig@iv#1{% #1 est le code de la mol\'ecule +\CF@def\CF@chemfig@v#1{% #1 est le code de la mol\'ecule \ifnum\CF@last@action=\thr@@ \ifCF@incycle \def\CF@default@angle{0}% @@ -645,11 +661,11 @@ {\CF@insert@emptygroup\CF@remain@molecule}% \relax \fi - \CF@chemfig@v + \CF@chemfig@vi } -\CF@def\CF@chemfig@v{% - \let\CF@next@action\CF@chemfig@v% \`a priori, on reboucle +\CF@def\CF@chemfig@vi{% + \let\CF@next@action\CF@chemfig@vi% \`a priori, on reboucle \ifx\CF@remain@molecule\@empty \let\CF@next@action\endgroup \else @@ -677,6 +693,10 @@ \ifnum\CF@cnt@cycle=\CF@cycle@num\relax \expandafter\expandafter\expandafter\@firstoftwo \else + \ifnum\CF@cnt@cycle=\@ne + \let\CF@cycle@firsttikz\CF@current@tikz + \unless\ifx\CF@start@offset\@empty\let\CF@cycle@joinlast\z@\fi + \fi \expandafter\expandafter\expandafter\@secondoftwo \fi \else @@ -685,7 +705,7 @@ {\let\CF@next@action\endgroup \CF@draw@bond\CF@bond@type{\CF@bond@outnode}{\CF@hook@cycle}\CF@previous@atomgroup\CF@hook@atomgroup }% - {\node[at=(\CF@bond@outnode),shift=(\ifcase\CF@split@state\or180-\or-\fi\CF@current@angle:\CF@current@length*\CF@atom@sep)](CF@node){}; + {\node[at=(\CF@bond@outnode\ifCF@incycle\else\ifCF@macrofixedbondlength.\CF@current@angle\fi\fi),shift=(\ifcase\CF@split@state\or180-\or-\fi\CF@current@angle:\CF@current@length*\CF@atom@sep)](CF@node){}; \let\CF@previous@angle\CF@current@angle \let\CF@last@action\tw@ }% @@ -696,7 +716,7 @@ \fi }% {\edef\CF@bond@outnode{\CF@bond@outnode}% \'evalue le l'atome de d\'epart de liaison - \ifx(\CF@toks@a\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi% une parenth\`ese pour commencer ? + \CF@ifx(\CF@toks@a% une parenth\`ese pour commencer ? {\ifnum\CF@last@action=\tw@% il y avait une liaison juste avant ? \CF@insert@emptygroup\CF@remain@molecule \else @@ -704,14 +724,14 @@ \begingroup \ifCF@incycle\let\CF@last@action\thr@@\fi% on \'etait dans un cycle \CF@incyclefalse - \aftergroup\CF@chemfig@v - \def\CF@next@action{\expandafter\CF@chemfig@iv\expandafter{\CF@sub@mol}}% + \aftergroup\CF@chemfig@vi + \def\CF@next@action{\expandafter\CF@chemfig@v\expandafter{\CF@sub@mol}}% \fi }% {\ifx\CF@remain@molecule\@empty \let\CF@next@action\endgroup \else% ce qui reste apr\`es le noeud courant n'est pas vide, ne commence pas par "-=~", ni par une parenth\`ese - \ifx*\CF@toks@a\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi% un cycle ? + \CF@ifx*\CF@toks@a% un cycle ? {\ifnum\CF@last@action=\tw@ \CF@insert@emptygroup\CF@remain@molecule% ins\`ere un groupe vide \else @@ -734,6 +754,11 @@ \CF@cnt@cycle\z@ \edef\CF@hook@cycle{\CF@bond@outnode}% \let\CF@hook@atomgroup\CF@previous@atomgroup + \ifx\CF@hook@atomgroup\CF@empty@node + \let\CF@cycle@joinlast\@ne% joindre le dernier + \else + \let\CF@cycle@joinlast\z@ + \fi \CF@incycletrue \ifnum\CF@last@action=\thr@@ \pgfmathparse{360/\CF@lastcycle@num-180}% c'est un cycle dans un cycle @@ -741,8 +766,8 @@ \pgfmathparse{-180/\CF@cycle@num-90+\CF@cycle@anglecorrection}% \fi \let\CF@initcycle@angle\pgfmathresult - \aftergroup\CF@chemfig@v - \def\CF@next@action{\expandafter\CF@chemfig@iv\expandafter{\CF@sub@mol}}% + \aftergroup\CF@chemfig@vi + \def\CF@next@action{\expandafter\CF@chemfig@v\expandafter{\CF@sub@mol}}% \fi }% {\errmessage{Package \CF@package@name\space Error: something went wrong here: \detokenize\expandafter{\CF@remain@molecule}^^JIf you think it's a bug, please, send a Minimal Example to the author.}}% @@ -847,14 +872,14 @@ \pgfmathparse{\CF@start@offset/\CF@len@vector}\let\CF@start@coeff\pgfmathresult \pgfmathparse{1-\CF@end@offset/\CF@len@vector}\let\CF@end@coeff\pgfmathresult \path(#2@)--(#3@)coordinate[pos=\CF@start@coeff](#2@@)coordinate[pos=\CF@end@coeff](#3@@);% - \unless\ifx\CF@movebond@name\@empty% on doit poser un nœud sur la liaison + \unless\ifx\CF@movebond@name\@empty% on doit poser un noeud sur la liaison \path(#2@@)--(#3@@)coordinate[overlay,pos=\CF@movebond@coeff](\CF@movebond@name); \let\CF@movebond@name\@empty \fi \ifcase#1\relax \errmessage{Package \CF@package@name\space Error: unknown bond type, this error should not occur^^JIf you think it's a bug, send a Minimal Example to the author}% \or% 1 = liaison simple - \CF@draw@bond@i(#2@@)--(#3@@); + \CF@draw@axisbond{#2}{#3}% trace la liaison simple dans l'axe \or% 2 = liaison double \ifCF@incycle \ifnum\CF@doublebond@type=\z@ @@ -870,9 +895,10 @@ \CF@create@normnodes{#2@@}{#3@@}{\CF@double@sep/2}{\CF@double@sep/2}% \CF@draw@bond@i(#2@@1)--(#3@@1); \CF@draw@bond@i(#2@@2)--(#3@@2); + \let\CF@joinbond\z@ \or \CF@create@normnodes{#2@@}{#3@@}\CF@double@sep\CF@double@sep - \CF@draw@bond@i(#2@@)--(#3@@); + \CF@draw@axisbond{#2}{#3}% trace la liaison simple dans l'axe\CF@draw@bond@i(#2@@)--(#3@@); \begingroup% ajuste \'eventuellement les longueurs des liaisons doubles \ifCF@incycle \ifdim\CF@start@offset=\z@ @@ -886,7 +912,7 @@ \endgroup \or \CF@create@normnodes{#2@@}{#3@@}\CF@double@sep\CF@double@sep - \CF@draw@bond@i(#2@@)--(#3@@); + \CF@draw@axisbond{#2}{#3}% trace la liaison simple dans l'axe\CF@draw@bond@i(#2@@)--(#3@@); \begingroup% ajuste \'eventuellement les longueurs des liaisons doubles \ifCF@incycle \ifdim\CF@start@offset=\z@ @@ -901,40 +927,131 @@ \fi \or% 3 = liaison triple \CF@create@normnodes{#2@@}{#3@@}\CF@double@sep\CF@double@sep - \CF@draw@bond@i(#2@@)--(#3@@); + \CF@draw@axisbond{#2}{#3}% trace la liaison simple dans l'axe\CF@draw@bond@i(#2@@)--(#3@@); \CF@draw@bond@i(#2@@1)--(#3@@1); \CF@draw@bond@i(#2@@2)--(#3@@2); \or% 4 = liaison Cram pleine de #2 vers #3 \CF@create@normnodes{#2@@}{#3@@}{\CF@cram@basewidth/2}{}% \expandafter\filldraw\expandafter[\CF@current@bondstyle,line join=bevel](#2@@1)--(#2@@2)--(#3@@)--(#2@@1); + \let\CF@joinbond\z@ \or% 5 = liaison Cram creuse de #3 vers #2 \CF@create@normnodes{#3@@}{#2@@}{\CF@cram@basewidth/2}{}% \expandafter\filldraw\expandafter[\CF@current@bondstyle,line join=bevel](#3@@1)--(#3@@2)--(#2@@)--(#3@@1); + \let\CF@joinbond\z@ \or% 6 = liaison Cram pointill\'ee de #2 vers #3 \scope \CF@create@normnodes{#2@@}{#3@@}{\CF@cram@basewidth/2}{}% \clip(#2@@1)--(#2@@2)--(#3@@)--(#2@@1); \expandafter\draw\expandafter[\CF@current@bondstyle,dash pattern=on \CF@cram@dashlength off \CF@cram@dashsep,line width=\CF@cram@basewidth](#2@@)--(#3@@); \endscope + \let\CF@joinbond\z@ \or% 7 = liaison Cram pointill\'ee de #3 vers #2 \scope \CF@create@normnodes{#3@@}{#2@@}{\CF@cram@basewidth/2}{}% \clip(#3@@1)--(#3@@2)--(#2@@)--(#3@@1); \expandafter\draw\expandafter[\CF@current@bondstyle,dash pattern=on \CF@cram@dashlength off \CF@cram@dashsep,line width=\CF@cram@basewidth](#3@@)--(#2@@); \endscope + \let\CF@joinbond\z@ \or% 8 = liaison Cram triangle \'evid\'e de #2 vers #3 \CF@create@normnodes{#2@@}{#3@@}{\CF@cram@basewidth/2}{}% \expandafter\draw\expandafter[\CF@current@bondstyle,line join=bevel](#2@@1)--(#2@@2)--(#3@@)--(#2@@1); + \let\CF@joinbond\z@ \or% 9 = liaison Cram triangle \'evid\'e de #3 vers #1 \CF@create@normnodes{#3@@}{#2@@}{\CF@cram@basewidth/2}{}% \expandafter\draw\expandafter[\CF@current@bondstyle,line join=bevel](#3@@1)--(#3@@2)--(#2@@)--(#3@@1); + \let\CF@joinbond\z@ \else \errmessage{Package \CF@package@name\space Error: unknown bond type, this error should not occur^^JIf you think it's a bug, send a Minimal Example to the author}% \fi \let\CF@start@offset\@empty \let\CF@end@offset\@empty + \let\CF@previous@tikz\CF@current@tikz + \let\CF@previous@bondangle\CF@previous@angle + \def\CF@previous@bond{#1}% +} + + +\CF@def\CF@draw@axisbond@nojoin#1#2{\CF@draw@bond@i(#1@@)--(#2@@);} + +\CF@def\CF@draw@axisbond@join#1#2{% dessine une liaison simple dans l'axe avec raccord rétrograde + \ifCF@incycle\ifnum\CF@cnt@cycle=\CF@cycle@num\relax\let\CF@next@tikz\CF@cycle@firsttikz\fi\fi + \ifnum\CF@joinbond=\z@ + \ifCF@incycle + \ifnum\CF@cnt@cycle=\CF@cycle@num\relax + \ifnum\CF@cycle@joinlast=\@ne + \CF@draw@bond@i(#1@@)--(#2@@)--% + ([shift=(\CF@previous@bondangle+2*\CF@cycle@increment@angle:.5\pgflinewidth)]#2@@); + \else + \CF@draw@bond@i(#1@@)--(#2@@); + \fi + \else + \CF@draw@bond@i(#1@@)--(#2@@); + \fi + \else + \CF@draw@bond@i(#1@@)--(#2@@); + \fi + \let\CF@joinbond\@ne + \else + \ifx\CF@previous@tikz\CF@current@tikz + \let\CF@joinbond\@ne + \ifx\CF@previous@atomgroup\CF@empty@node + \ifx\CF@previous@bondangle\empty% si d\'ebut mol\'ecule + \CF@draw@bond@i(#1@@)--(#2@@); + \else + \ifdim\CF@start@offset=\z@ + \ifCF@incycle + \ifnum\CF@cnt@cycle=\CF@cycle@num\relax + \ifnum\CF@cycle@joinlast=\@ne + \ifx\CF@cycle@firsttikz\CF@current@tikz + \CF@draw@bond@i([shift=(\CF@previous@bondangle:-.5\pgflinewidth)]#1@@)--(#1@@)--(#2@@)--% + ([shift=(\CF@previous@bondangle+2*\CF@cycle@increment@angle:.5\pgflinewidth)]#2@@); + \else + \CF@draw@bond@i([shift=(\CF@previous@bondangle:-.5\pgflinewidth)]#1@@)--(#1@@)--(#2@@); + \fi + \else + \CF@draw@bond@i([shift=(\CF@previous@bondangle:-.5\pgflinewidth)]#1@@)--(#1@@)--(#2@@); + \fi + \else + \CF@draw@bond@i([shift=(\CF@previous@bondangle:-.5\pgflinewidth)]#1@@)--(#1@@)--(#2@@); + \fi + \else + \CF@draw@bond@i([shift=(\CF@previous@bondangle:-.5\pgflinewidth)]#1@@)--(#1@@)--(#2@@); + \fi + \else + \CF@draw@bond@i(#1@@)--(#2@@); + \fi + \fi + \else + \CF@draw@bond@i(#1@@)--(#2@@); + \fi + \else + \ifCF@incycle + \ifnum\CF@cnt@cycle=\CF@cycle@num\relax + \ifnum\CF@cycle@joinlast=\@ne + \ifx\CF@next@tikz\CF@current@tikz + \CF@draw@bond@i(#1@@)--(#2@@)--% + ([shift=(\CF@previous@bondangle+2*\CF@cycle@increment@angle:.5\pgflinewidth)]#2@@); + \else + \CF@draw@bond@i(#1@@)--(#2@@); + \fi + \else + \CF@draw@bond@i(#1@@)--(#2@@); + \fi + \else + \CF@draw@bond@i(#1@@)--(#2@@); + \fi + \else + \CF@draw@bond@i(#1@@)--(#2@@); + \fi + \fi + \fi + \ifdim\CF@end@offset=\z@\else\let\CF@joinbond\z@\fi } +\CF@def\enablebondjoin {\global\let\CF@draw@axisbond\CF@draw@axisbond@join} +\CF@def\disablebondjoin{\global\let\CF@draw@axisbond\CF@draw@axisbond@nojoin} +\disablebondjoin% par d\'efaut, d\'esactiver la jointure entre liaisons + \CF@def\CF@draw@bond@i{\expandafter\draw\expandafter[\CF@current@bondstyle]} \CF@def\CF@hook@drawall{% dessine tous les crochets contenus dans la sc \CF@hook@draw @@ -947,11 +1064,12 @@ \CF@def\CF@hook@drawfirst[#1,#2,#3]#4#5#6#7#8\@nil{% \def\CF@hook@drawlist{#8}% \begingroup + \let\CF@joinbond\z@ \def\CF@current@tikz{#3}% \def\CF@hook@startcontent{#6}\def\CF@hook@endcontent{#7}% \CF@if@integer{#2}% {\CF@draw@bond{#2}{#4}{#5}\CF@hook@startcontent\CF@hook@endcontent}% - {\CF@bond@findnum{#2}\CF@bond@currentnum + {\CF@bond@findcode{#2}\CF@bond@currentnum \CF@draw@bond\CF@bond@currentnum{#4}{#5}\CF@hook@startcontent\CF@hook@endcontent }% \endgroup @@ -965,8 +1083,7 @@ \CF@def\setbondstyle{\def\CF@bond@style} \setbondstyle{} -\expandafter\CF@def\expandafter\CF@gobble@movearg\string @#1#2\@nil#3% -{% +\expandafter\CF@def\expandafter\CF@gobble@movearg\string @#1#2\@nil#3{% \expandafter\def\csname atom@\number\CF@cnt@atomnumber\endcsname{#2}% \CF@if@instr{#1},% {\CF@analyse@movearg#1\@nil#3\let\CF@movebond@coeff\@empty}% @@ -1030,7 +1147,7 @@ \def\CF@node@strut{\vphantom\CF@bond@outcontentsaved}% \fi \fi - \edef\CF@opt@string{anchor=\ifnum\CF@last@action=\z@ base\else center\fi,at=(CF@node),\CF@node@style}% premier atome de la mol\'ecule affich\'e + \edef\CF@opt@string{anchor=\ifnum\CF@last@action=\z@ base\else\ifCF@incycle center\else\ifCF@macrofixedbondlength 180+#1\else center\fi\fi\fi,at=(CF@node),\CF@node@style}% premier atome de la mol\'ecule affich\'e \loop \unless\ifnum\CF@cnt@atomnumber>\CF@cnt@atomingroup \expandafter\expandafter\expandafter\futurelet\expandafter\expandafter\expandafter\CF@toks@a\expandafter\expandafter\expandafter @@ -1077,7 +1194,7 @@ \else \advance\CF@cnt@atomingroup\@ne \futurelet\CF@toks@a\CF@gobble@tonil#1\@nil - \expandafter\ifx\string @\CF@toks@a\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi + \expandafter\CF@ifx\string @\CF@toks@a {\CF@keep@movearg#1\@nil \CF@swap@fi \CF@remove@movearg@i#1\@nil\CF@after@movearg @@ -1095,11 +1212,11 @@ \expandafter\let\csname atom@\number\CF@cnt@atomingroup\endcsname\CF@current@atom \else \futurelet\CF@toks@a\CF@gobble@tonil#1\@nil - \ifx\bgroup\CF@toks@a\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi + \CF@ifx\bgroup\CF@toks@a {\CF@expadd@tocs\CF@current@atom{\expandafter{\@car#1\@nil}}% \expandafter\CF@draw@atomgroup@iii\expandafter{\@gobble#1}% }% - {\ifx\@sptoken\CF@toks@a\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi + {\CF@ifx\@sptoken\CF@toks@a {\CF@add@tocs\CF@current@atom{ }% \expandafter\CF@draw@atomgroup@iii\expandafter{\CF@after@space#1\@nil}% }% @@ -1134,21 +1251,21 @@ \let\CF@current@atom\@empty \else \futurelet\CF@toks@a\CF@gobble@tonil#1\@nil - \expandafter\ifx\string @\CF@toks@a\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi + \expandafter\CF@ifx\string @\CF@toks@a {\expandafter\let\csname atom@\number\CF@cnt@atomingroup\endcsname\CF@current@atom \let\CF@current@atom\@empty \CF@swap@fi\CF@draw@atomgroup@i{#1}% }% - {\ifx|\CF@toks@a\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi + {\CF@ifx|\CF@toks@a {\expandafter\let\csname atom@\number\CF@cnt@atomingroup\endcsname\CF@current@atom \let\CF@current@atom\@empty \CF@swap@fi\expandafter\CF@draw@atomgroup@i\expandafter{\@gobble#1}% }% - {\ifx\@sptoken\CF@toks@a\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi + {\CF@ifx\@sptoken\CF@toks@a {\CF@add@tocs\CF@current@atom{ }% \CF@swap@fi\expandafter\CF@draw@atomgroup@iii\expandafter{\CF@after@space#1\@nil}% }% - {\ifx\bgroup\CF@toks@a\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi + {\CF@ifx\bgroup\CF@toks@a {\CF@expadd@tocs\CF@current@atom{\expandafter{\@car#1\@nil}}% \CF@swap@fi\expandafter\CF@draw@atomgroup@iii\expandafter{\@gobble#1}% }% @@ -1157,7 +1274,7 @@ \let\CF@current@atom\@empty \CF@swap@fi\CF@draw@atomgroup@i{#1}% }% - {\ifx?\CF@toks@a\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi + {\CF@ifx?\CF@toks@a {\expandafter\CF@if@firsttokmatch\expandafter{\@gobble#1}[% un crochet apr\`es le "?" {\expandafter\CF@grab@optarg\@gobble#1\@nil\CF@after@hook}% {\expandafter\CF@grab@optarg\expandafter[\expandafter]\@gobble#1\@nil\CF@after@hook}% @@ -1202,9 +1319,7 @@ } \CF@def\CF@hook@parselist#1{% #1 est le nom du noeud \`a retrouver - \def\CF@hook@parselist@i##1(#1)|##2|##3|##4\@nil{% - \def\CF@hook@savedcoord{##2}\def\CF@hook@savedcontent{##3}% - }% + \def\CF@hook@parselist@i##1(#1)|##2|##3|##4\@nil{\def\CF@hook@savedcoord{##2}\def\CF@hook@savedcontent{##3}}% \expandafter\CF@hook@parselist@i\CF@hook@list\@nil } @@ -1246,7 +1361,8 @@ \CF@def\CF@lewis@i#1[#2]{% \def\CF@lewis@diagcoeff{#2}% \ifx\@empty\CF@lewis@diagcoeff\def\CF@lewis@diagcoeff{1}\fi - \CF@lewis@ii{#1}} + \CF@lewis@ii{#1}% +} \CF@def\CF@lewis@ii#1#2{\CF@lewis@iii#2\@nil{#1}} @@ -1360,7 +1476,10 @@ \setchemrel{}{}{} -\CF@def\chemrel{\@testopt\CF@chemchemrel@i{}} +\CF@def\chemrel{% + \immediate\write\CF@unused{Package \CF@package@name\space Warning: the macro \string\chemrel\space is deprecated. Please, build schemes with \string\schemestart\space and inside, use \string\arrow.}% + \@testopt\CF@chemchemrel@i{}% +} \CF@def\CF@chemchemrel@i[#1]{\@testopt{\CF@chemchemrel@ii[#1]}{}} @@ -1393,9 +1512,7 @@ \CF@def\CF@remove@equichars#1<>#2\@nil{#1#2} -\CF@def\chemmove{% - \@testopt\CF@chemmove{}% -} +\CF@def\chemmove{\@testopt\CF@chemmove{}} \CF@def\CF@chemmove[#1]#2{% \ifx\@empty#2\@empty @@ -1403,7 +1520,7 @@ \else \expandafter\@firstofone \fi - {\expandafter\tikzpicture\romannumeral\ifx\@empty#1\@empty\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi + {\expandafter\tikzpicture\romannumeral\CF@ifx{\@empty#1}\@empty {\z@[remember picture,overlay]}{\z@[remember picture,overlay,#1]}#2 \endtikzpicture }% @@ -1430,9 +1547,7 @@ {\CF@name@dp@adjusttrue\CF@chemnam@i}% } -\CF@def\CF@chemnam@i{% - \@testopt\CF@chemname@ii{1.5ex}% -} +\CF@def\CF@chemnam@i{\@testopt\CF@chemname@ii{1.5ex}} \CF@def\CF@chemname@ii[#1]#2#3{% \setbox\CF@stuff@box\hbox{#2}% @@ -1465,9 +1580,7 @@ \CF@def\CF@subscheme@i[#1]{\@testopt{\CF@subscheme@ii[#1]}{text}} \CF@def\CF@subscheme@ii[#1][#2]#3{\schemestart[#1][#2]#3\schemestop} -\CF@def\schemedebug#1{% #1=true ou false - \ifcsname CF@reac@debug#1\endcsname\csname CF@reac@debug#1\endcsname\else\CF@reac@debugfalse\fi -} +\CF@def\schemedebug#1{\ifcsname CF@reac@debug#1\endcsname\csname CF@reac@debug#1\endcsname\else\CF@reac@debugfalse\fi} \schemedebug{false} \CF@def\setcompoundstyle{\def\CF@default@compound@style} @@ -1749,15 +1862,14 @@ \fi } -{\def\:{\CF@arrow@gobspaces@ii}\expandafter}\expandafter -\def\: {\futurelet\CF@toks@a\CF@arrow@gobspaces@i} +{\def\:{\CF@arrow@gobspaces@ii}\expandafter}\expandafter\def\: {\futurelet\CF@toks@a\CF@arrow@gobspaces@i} \CF@def\CF@arrow@vi#1#2#3#4{% #1=angle #2=longueur #3=ancre d\'epart #4=ancre arriv\'ee \def\CF@next@action{\let\CF@compound\@empty\CF@schemestart@iii}% \def\CF@arrow@current@angle{#1}\ifx\@empty\CF@arrow@current@angle\let\CF@arrow@current@angle\CF@arrow@angle\fi \def\CF@current@arrow@length{#2}\ifx\@empty\CF@current@arrow@length\let\CF@current@arrow@length\CF@arrow@length\fi - \node[at=(\CF@current@nodename.\ifx\@empty#3\@empty\CF@arrow@current@angle\else#3\fi),shift=(\CF@arrow@current@angle:\CF@current@arrow@length*\CF@compound@sep),cyan,fill](end@arrow@i){};% - \edef\CF@arrow@end@name{end@arrow@i\ifx\@empty#4\@empty\else.4\fi}% + \node[at=(\CF@current@nodename.\ifx\@empty#3\@empty\CF@arrow@current@angle\else#3\fi),shift=(\CF@arrow@current@angle:\CF@current@arrow@length*\CF@compound@sep),cyan,fill](end@arrow@i@\number\CF@scheme@nest){};% + \edef\CF@arrow@end@name{end@arrow@i@\number\CF@scheme@nest\ifx\@empty#4\@empty\else.4\fi}% \ifCF@reac@debug \node[at=(\CF@current@nodename.\ifx\@empty#3\@empty\CF@arrow@current@angle\else#3\fi),shift=(\CF@arrow@current@angle:\CF@arrow@offset),red,fill](start@arrow){};% \node[at=(\CF@current@nodename.\ifx\@empty#3\@empty\CF@arrow@current@angle\else#3\fi),shift=(\CF@arrow@current@angle:\CF@current@arrow@length*\CF@compound@sep-\CF@arrow@offset),red,fill](end@arrow){};% @@ -1768,13 +1880,13 @@ \def\CF@arrow@start@node{start@arrow}\def\CF@arrow@end@node{end@arrow}% \csname\expandafter\CF@grab@arrow@name\CF@current@arrowtype[\@nil\expandafter\expandafter\expandafter\endcsname \expandafter\CF@grab@arrow@args\CF@current@arrowtype[]\@nil[][][][][][][][]\@nil - \def\CF@current@nodename{end@arrow@i}% + \def\CF@current@nodename{end@arrow@i@\number\CF@scheme@nest}% \edef\CF@next@nodeanchor{\ifx\@empty#4\@empty180+\CF@arrow@current@angle\else#4\fi}% } % trace un fl\`eche initi\'ee par (@nom--@nom) % #1=type de fl\`eche #2=nom depart #3=ancre d\'epart #4=nom arriv\'ee #5=ancre arriv\'ee #6=style fl\`eche -\def\CF@direct@arrow#1#2#3#4#5#6{% +\CF@def\CF@direct@arrow#1#2#3#4#5#6{% \expandafter\def\expandafter\CF@arrow@start@name\expandafter{\@gobble#2}% \expandafter\def\expandafter\CF@arrow@end@name\expandafter{\@gobble#4}% \path[sloped,allow upside down](\@gobble#2\ifx\@empty#3\@empty\else.#3\fi)--(\@gobble#4\ifx\@empty#5\@empty\else.#5\fi)% @@ -1802,7 +1914,8 @@ \CF@def\CF@merge#1({% \CF@merge@grab@chardir#1[][]\@nil - \CF@merge@i(} + \CF@merge@i(% +} \CF@def\CF@merge@i#1--(#2){\@testopt{\CF@merge@ii#1--(#2)}{}} @@ -2071,7 +2184,7 @@ \pgfpathlineto{\pgfpoint\z@\z@}% \pgfusepathqfillstroke} -\CF@savedcatcode +\chemfigrestorecatcode \endinput @@ -2203,7 +2316,7 @@ v1.0g 2012/11/16 compos\'ee en dehors de l'environnement tikzpicture pour \'eviter nullfont si jamais \printatom ne passe pas en mode math. - - correction d'un bug dans \CF@chemfig@iv : si une longueur par + - correction d'un bug dans \CF@chemfig@v : si une longueur par d\'efaut est modifi\'ee par [,<l>] au d\'ebut d'une mol\'ecule et si des cycles \'etaient emboit\'es, cette longueur n'\'etait pas appliqu\'ee aux sous-cycles. @@ -2216,7 +2329,26 @@ v1.0h 2013/11/28 - \chemname admet maintenant une version \'etoil\'e qui ne tient pas compte des profondeurs pr\'ec\'edentes. - \CF@dp@max est g\'er\'e globalement. - - correction d'un bug dans "-U>" : le style de la flèche n'était - pris en compte pour l'arc. + - correction d'un bug dans "-U>" : le style de la fl\`eche + n'\'etait pris en compte pour l'arc. - correction d'un bug dans \CF@direct@arrow : l'angle de la - fl\`eche n'\'etait pas calcul\'e
\ No newline at end of file + fl\`eche n'\'etait pas calcul\'e +---------------------------------------------------------------------- +v1.1 2015/02/13 + - correction d'un bug dans \CF@seek@submol : la macro + \CF@remain@molecule est d\'epouill\'e de son \'eventuel espace + en premi\`ere position. + - correction d'un bug dans \CF@arrow@vi : le nom du prochain + noeud courant "end@arrow@i" \'etait erron\'e dans le cas o\`u une + fl\`eche contenait un sous sch\'ema. Ce nom doit d\'ependre de + \CF@scheme@nest. + - la jonction entre deux liaisons cons\'ecutives dans l'axe peut + \^etre activ\'e avec \enablebondjoin et d\'esactiv\'e avec + \disablebondjoin (pr\'ef\'erable, \'etat par d\'efaut). + - \chemfig suivi d'une "*" demande \`a ce que les liaisons aient + une longueur invariable : la distance inter-atome devient donc + variable. Cette fonctionnalit\'e est d\'esavctiv\'e dans les + cycles afin que les polygones soient r\'eguliers. + \enablefixedbondlength permet cette fonctionnalit\'e pour + toutes les macros \chemfig (m\^eme non \'etoil\'ee) tandis que + \disablefixedbondlength le d\'esactive.
\ No newline at end of file diff --git a/Master/texmf-dist/tex/generic/chemfig/t-chemfig.tex b/Master/texmf-dist/tex/generic/chemfig/t-chemfig.tex index bdcf9ab5ecc..84c6b51d39a 100644 --- a/Master/texmf-dist/tex/generic/chemfig/t-chemfig.tex +++ b/Master/texmf-dist/tex/generic/chemfig/t-chemfig.tex @@ -1,20 +1,20 @@ % __________________________________________________________________ % | | % | | -% | chemfig v1.0h | +% | chemfig v1.1 | % | | -% | November 28, 2013 | +% | 15 february 2015 | % | | % |__________________________________________________________________| % % This is t-chemfig.tex, the package file for conTeXt. % % Maintainer: Christian Tellechea -% E-mail : unbonpetit@gmail.com +% E-mail : unbonpetit@openmailbox.org % Comments, bug reports and suggestions are welcome. % Licence : Released under the LaTeX Project Public License v1.3c or % later, see http://www.latex-project.org/lppl.txt -% Copyright : Christian Tellechea 2010-2012 +% Copyright : Christian Tellechea 2010-2015 % % The "chemfig" package consists of the 8 following files: % chemfig.tex (the code of the package) |