summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/chemfig
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-03-08 22:54:10 +0000
committerKarl Berry <karl@freefriends.org>2018-03-08 22:54:10 +0000
commit0196ffc747bdb1ceb5480007922d91f59deda3d4 (patch)
treeb9482e4a63edc1e15842caee916a017930399168 /Master/texmf-dist/tex/generic/chemfig
parent56904e44da409d0b8e5e06941c6052e8670b709e (diff)
chemfig (8mar18)
git-svn-id: svn://tug.org/texlive/trunk@46890 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/chemfig')
-rw-r--r--Master/texmf-dist/tex/generic/chemfig/chemfig.sty45
-rw-r--r--Master/texmf-dist/tex/generic/chemfig/chemfig.tex1926
-rw-r--r--Master/texmf-dist/tex/generic/chemfig/t-chemfig.tex38
3 files changed, 1021 insertions, 988 deletions
diff --git a/Master/texmf-dist/tex/generic/chemfig/chemfig.sty b/Master/texmf-dist/tex/generic/chemfig/chemfig.sty
index 03b13b44561..d1920b6c641 100644
--- a/Master/texmf-dist/tex/generic/chemfig/chemfig.sty
+++ b/Master/texmf-dist/tex/generic/chemfig/chemfig.sty
@@ -1,42 +1,7 @@
-% __________________________________________________________________
-% | |
-% | chemfig v1.2e |
-% |__________________________________________________________________|
-%
-% This is chemfig.sty, the package file for LaTeX.
-%
-% Maintainer : Christian Tellechea
-% 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
-% Package URL: http://ctan.org/pkg/chemfig
-% 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)
-%
-% --------------------------------------------------------------------
-% This work may be distributed and/or modified under the
-% conditions of the LaTeX Project Public License, either version 1.3
-% 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.3 or later is part of all distributions of LaTeX
-% version 2005/12/01 or later.
-% --------------------------------------------------------------------
-% This work has the LPPL maintenance status `maintained'.
-%
-% The Current Maintainer of this work is Christian Tellechea
-% --------------------------------------------------------------------
\RequirePackage{tikz}
\input chemfig.tex
-\ProvidesPackage\CF@package@name[\CF@date\space v\CF@ver\space Draw molecule with an easy syntax]
-\endinput
+\ProvidesPackage\CFname[\CFdate\space v\CFver\space Draw molecule with an easy syntax (CT)]
+\def\printatom#1{\ensuremath{\mathrm{#1}}}% \printatom pour LaTeX.
+\def\CF@begin@tikzpicture{\begin{tikzpicture}}%
+\def\CF@end@tikzpicture{\end{tikzpicture}}%
+\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/tex/generic/chemfig/chemfig.tex b/Master/texmf-dist/tex/generic/chemfig/chemfig.tex
index 6c4530c9317..71bdffd9225 100644
--- a/Master/texmf-dist/tex/generic/chemfig/chemfig.tex
+++ b/Master/texmf-dist/tex/generic/chemfig/chemfig.tex
@@ -1,396 +1,462 @@
-% __________________________________________________________________
-% | |
-% | chemfig v1.2e |
-% |__________________________________________________________________|
+% !TeX encoding = ISO-8859-1
+% Ce fichier contient le code de l'extension "chemfig"
%
-% This is chemfig.tex, the code of the "chemfig" package.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+\def\CFname {chemfig} %
+\def\CFver {1.3} %
+% %
+\def\CFdate {2018/03/08} %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% Maintainer : Christian Tellechea
-% 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
-% Package URL: http://ctan.org/pkg/chemfig
-% 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)
-%
-% --------------------------------------------------------------------
-% This work may be distributed and/or modified under the
-% conditions of the LaTeX Project Public License, either version 1.3
-% 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.3 or later is part of all distributions of LaTeX
-% version 2005/12/01 or later.
-% --------------------------------------------------------------------
-% This work has the LPPL maintenance status `maintained'.
-%
-% The Current Maintainer of this work is Christian Tellechea
-% --------------------------------------------------------------------
-
-\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
-}
-
-\usechemfigcatcode
-
-\def\CF@def#1{%
- \ifdefined#1%
- \errmessage{Package \CF@package@name\space Error: the macro \string#1\space is already defined. Please, email the author.}%
- \fi
- \def#1%
-}
-
-\CF@def\CF@ver {1.2e}
-\CF@def\CF@date {2017/05/20}
-\CF@def\CF@fr@date {20 mai 2017}
-\CF@def\CF@en@date {20 may 2017}
-\CF@def\CF@package@name{chemfig}
-
-\CF@def\CF@error#1{\errmessage{Package \CF@package@name\space Error: #1.}}
-\CF@def\CF@warning#1{\immediate\write\CF@unused{Package \CF@package@name\space Warning: #1^^J}}
-
-% V\'erifie que eTeX est le moteur utilis\'e
+%____________________________________________________________________
+% Author : Christian Tellechea |
+% Status : Maintained |
+% Email : unbonpetit@netc.fr |
+% Package URL: https://www.ctan.org/pkg/chemfig |
+% Bug tracker: https://framagit.org/unbonpetit/chemfig/issues |
+% Repository : https://framagit.org/unbonpetit/chemfig/tree/master |
+% Copyright : Christian Tellechea 2010-2018 |
+% Licence : Released under the LaTeX Project Public License v1.3c |
+% or later, see http://www.latex-project.org/lppl.txt |
+% Files : 1) chemfig.tex |
+% 2) chemfig.sty |
+% 3) t-chemfig.tex |
+% 4) README |
+% 5) chemfig_doc_fr.tex |
+% 6) chemfig_doc_fr.pdf |
+% 7) chemfig_doc_en.tex |
+% 8) chemfig_doc_fr.pdf |
+%--------------------------------------------------------------------
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% P R É A L A B L E %%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%-------------------------- Annonce package --------------------------
+\ifdefined\ProvidesPackage\else
+ \immediate\write -1 {%
+ Package: \CFname\space\CFdate\space\space v\CFver\space\space
+ Draw molecule with an easy syntax (CT)}%
+\fi
+%------------------------- Vérification etex -------------------------
\begingroup
- \edef\CF@ver{\meaning\eTeXversion}
- \edef\CF@date{\string\eTeXversion}
- \ifx\CF@ver\CF@date
- \endgroup
- \else
- \endgroup
- \errmessage{Package \CF@package@name\space Error: you are not using an eTeX engine, chemfig cannot work.}%
- \expandafter\endinput
+ \edef\CFtempa{\meaning\eTeXversion}
+ \edef\CFtempb{\string\eTeXversion}
+ \let\CFtemp\endgroup
+ \unless\ifx\CFtempa\CFtempb
+ \errmessage{Package \CFname\space Error: you are not using an eTeX engine, chemfig cannot work.}%
+ \def\CFtemp{\endgroup\endinput}%
\fi
+\CFtemp
-\expandafter\ifx\csname @latexerr\endcsname\relax% on n'utilise pas LaTeX ?
- \ifdefined\tikzpicture\else
- \def\CF@next@action{\input tikz.tex}%
- \expandafter\CF@next@action
- \fi
- \immediate\write\m@ne{Package: \CF@package@name\space\CF@date\space\space v\CF@ver\space\space Draw molecule with an easy syntax}%
- \long\def\@firstoftwo#1#2{#1}
- \long\def\@secondoftwo#1#2{#2}
- \long\def\@firstofone#1{#1}
- \long\def\@gobble#1{}
- \long\def\@gobbletwo#1#2{}
- \def\@car#1#2\@nil{#1}
- \def\@makeother#1{\catcode`#1=12\relax}
- \long\def\@ifnextchar#1#2#3{%
- \let\reserved@d=#1%
- \def\reserved@a{#2}%
- \def\reserved@b{#3}%
- \futurelet\@let@arg\@ifnch}
- \def\@ifnch{%
- \ifx\@let@arg\@sptoken
- \let\reserved@c\@xifnch
- \else
- \ifx\@let@arg\reserved@d
- \let\reserved@c\reserved@a
- \else
- \let\reserved@c\reserved@b
- \fi
- \fi
- \reserved@c}
- \def\:{\let\@sptoken= } \:
- \def\:{\@xifnch} \expandafter\def\: {\futurelet\@let@arg\@ifnch}
- \def\@ifstar#1{\@ifnextchar *{\@firstoftwo{#1}}}
- \long\def\@testopt#1#2{\@ifnextchar[{#1}{#1[{#2}]}}
- \def\@empty{}
- \def\space{ }
- \CF@def\printatom#1{\ifmmode\rm#1\else$\rm#1$\fi}% \printatom pour TeX et ConTeXt
- \def\CF@begin@tikzpicture{\tikzpicture}%
- \def\CF@end@tikzpicture{\endtikzpicture}%
-\else% fin des d\'efinitions LaTeX
- \CF@def\printatom#1{\ensuremath{\mathrm{#1}}}% \printatom pour LaTeX.
- \def\CF@begin@tikzpicture{\begin{tikzpicture}}%
- \def\CF@end@tikzpicture{\end{tikzpicture}}%
+%------------------------ Chargement simplekv ------------------------
+\unless\ifdefined\skvname
+ \begingroup\def\CFtemp{\endgroup\input simplekv.tex\relax}%
+ \expandafter\CFtemp
\fi
+%-------------------------- Chargement tikz --------------------------
+\unless\ifdefined\tikzpicture
+ \begingroup\def\CFtemp{\endgroup\input tikz.tex\relax}%
+ \expandafter\CFtemp
+\fi
\usetikzlibrary{arrows.meta}
+%-------------------------- Régime catcodes --------------------------
+\begingroup
+ \def\X#1{\catcode\number`#1=\number\catcode`#1\relax}
+ \xdef\CFrestorecatcode{\X\[\X\]\X\:\X\(\X\)\X\,\X\-\X\=\X\~\X\!\X\?\X\<\X\>\X\;\X\*\X\|\X\@\X\ }%
+\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
+
+%--------------------------- Allocations -----------------------------
\newcount\CF@cnt@atomingroup
\newcount\CF@cnt@groupnumber
\newcount\CF@cnt@atomnumber
\newcount\CF@cnt@cycle
+\newcount\CF@compound@cnt
\newif\ifCF@incycle
\newif\ifCF@cyclearc
\newif\ifCF@definesubmol
\newif\ifCF@name@dp@adjust
\newif\ifCF@macrofixedbondlength
-\newif\ifCF@globalfixedbondlength
+\newif\ifCF@name@start
+\newif\ifCF@name@end
\newdimen\CF@dim
+\newdimen\CF@arrow@size
\newbox\CF@lewis@box
\newbox\CF@box@boxa
-\newbox\CF@box@boxb
\newbox\CF@stuff@box
-\def\enablefixedbondlength{\global\CF@globalfixedbondlengthtrue}
-\def\disablefixedbondlength{\global\CF@globalfixedbondlengthfalse}
-\disablefixedbondlength
-
-\newwrite\CF@unused
-
-\CF@def\CF@sanitize@catcode{%
- \@makeother\[\@makeother\]\@makeother\:\@makeother\(\@makeother\)%
- \@makeother\,\@makeother\-\@makeother\=\@makeother\~\@makeother\!%
- \@makeother\?\@makeother\<\@makeother\>\@makeother\;\@makeother\*%
- \@makeother\|\@makeother\#\@makeother\@%
+%-------------------------- Petites macros ---------------------------
+\def\CF@quark{\CF@quark}
+\long\def\CF@execfirst#1#2{#1}
+\long\def\CF@execsecond#1#2{#2}
+\long\def\CF@id#1{#1}
+\long\def\CF@gobarg#1{}
+\long\def\CF@gobtwoargs#1#2{}
+\def\CF@firsttonil#1#2\@nil{#1}
+\def\CF@sanitize@lastitem#1,\empty#2\@nil{#1}
+\def\CF@gobtikzinstruction#1;{}
+\def\CF@makeother#1{\catcode`#1=12\relax}
+\def\CF@lettoken#1#2{\let#1= #2}\CF@lettoken\CF@sptoken{ }
+\def\CF@ifx#1#2{\ifx#1#2\expandafter\CF@execfirst\else\expandafter\CF@execsecond\fi}
+\def\CF@ifempty#1{\ifx\empty#1\empty\expandafter\CF@execfirst\else\expandafter\CF@execsecond\fi}
+\def\CF@doifempty#1{\ifx\empty#1\empty\expandafter\CF@id\else\expandafter\CF@gobarg\fi}
+\def\CF@doifnotempty#1{\ifx\empty#1\empty\expandafter\CF@gobarg\else\expandafter\CF@id\fi}
+\def\CF@gobtonil#1\@nil{}
+\edef\CF@hash{\string#}
+\edef\CF@arobas{\string @}
+\def\CF@three@ea{\expandafter\expandafter\expandafter}
+\def\CF@exp@macroarg#1#2{\expandafter#1\expandafter{#2}}
+\def\CF@eexp@macroarg#1#2{\expandafter\expandafter\expandafter#1\expandafter\expandafter\expandafter{#2}}
+\def\CF@exp@twomacroargs#1#2#3{\CF@exp@second{\CF@exp@macroarg#1{#2}}{#3}}
+\def\CF@exp@threemacroargs#1#2#3#4{\CF@exp@second{\CF@exp@twomacroargs#1{#2}{#3}}{#4}}
+\def\CF@swap@arg#1#2{#2{#1}}
+\def\CF@exp@second#1#2{\CF@exp@macroarg\CF@swap@arg{#2}{#1}}% \CF@exp@second<{arg1>}{<arg2>} donne "<arg1>{*<arg2>}"
+\def\CF@eexp@second#1#2{\CF@eexp@macroarg\CF@swap@arg{#2}{#1}}% \CF@eexp@second{<arg1>}{<arg2>} donne "<arg1>{**<arg2>}"
+\def\CF@swap@unarg#1#2{#2#1}
+\def\CF@exp@after#1#2{\CF@exp@macroarg\CF@swap@unarg{#2}{#1}}% \CF@exp@after{<arg1>}{<arg2>} donne "<arg1>*<arg2>"
+\def\CF@eexp@after#1#2{\CF@eexp@macroarg\CF@swap@unarg{#2}{#1}}% \CF@eexp@after{<arg1>}{<arg2>} donne "<arg1>**<arg2>"
+\def\CF@add@tocs#1#2{\CF@exp@second{\def#1}{#1#2}}
+\def\CF@eadd@tocs#1#2{\CF@exp@second{\CF@add@tocs#1}{#2}}\let\CF@expadd@tocs\CF@eadd@tocs
+\def\CF@preadd@tocs#1#2{\CF@exp@second{\CF@preadd@tocs@a#1{#2}}#1}
+\def\CF@preadd@tocs@a#1#2#3{\def#1{#2#3}}
+\def\CF@edefadd@tocs#1#2{%
+ \edef\CF@tmp@str{#2}%
+ \CF@exp@second{\CF@add@tocs#1}{\CF@tmp@str}%
}
-
-\CF@def\CF@if@integer#1{%
+\long\def\CF@ifnextchar#1#2#3{%
+ \let\CF@ifnextchar@tok=#1
+ \def\CF@ifnextchar@codetrue{#2}%
+ \def\CF@ifnextchar@codefalse{#3}%
+ \futurelet\CF@temptok\CF@ifnextchar@i}
+\def\CF@ifnextchar@i{%
+ \CF@ifx\CF@temptok\CF@sptoken
+ \CF@ifnextchar@ii
+ {\CF@ifx\CF@temptok\CF@ifnextchar@tok\CF@ifnextchar@codetrue\CF@ifnextchar@codefalse}%
+}
+\expandafter\def\expandafter\CF@ifnextchar@ii\space{\futurelet\CF@temptok\CF@ifnextchar@i}
+\def\CF@ifstar#1{\CF@ifnextchar*{\CF@execfirst{#1}}}
+\long\def\CF@testopt#1#2{\CF@ifnextchar[{#1}{#1[{#2}]}}
+\def\CF@error#1{\errmessage{Package \CFname\space Error: #1.}}
+\def\CF@warning#1{\immediate\write-1{Package \CFname\space Warning: #1^^J}}
+\def\CF@if@integer#1{%
\begingroup
\afterassignment\CF@after@integer
\CF@cnt@cycle0#1\relax
}
-
-\CF@def\CF@after@integer#1\relax{%
+\def\CF@after@integer#1\relax{%
\endgroup
\CF@ifempty{#1}%
}
-
-\CF@def\CF@ifx#1#2{\ifx#1#2\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
-
-\CF@def\CF@ifempty#1{\ifx\@empty#1\@empty\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
-
-\CF@def\CF@doifempty#1{\ifx\@empty#1\@empty\expandafter\@firstofone\else\expandafter\@gobble\fi}
-
-\CF@def\CF@doifnotempty#1{\ifx\@empty#1\@empty\expandafter\@gobble\else\expandafter\@firstofone\fi}
-
-\CF@def\CF@gobtonil#1\@nil{}
-
-\edef\CF@hash{\string#}
-
-\edef\CF@arobas{\string @}
-
-\CF@def\CF@three@ea{\expandafter\expandafter\expandafter}
-
-\CF@def\CF@exp@macroarg#1#2{\expandafter#1\expandafter{#2}}
-
-\CF@def\CF@twoexp@macroarg#1#2{\expandafter\expandafter\expandafter#1\expandafter\expandafter\expandafter{#2}}
-
-\CF@def\CF@exp@twomacroargs#1#2#3{\CF@exp@second{\CF@exp@macroarg#1{#2}}{#3}}
-
-\CF@def\CF@exp@threemacroargs#1#2#3#4{\CF@exp@second{\CF@exp@twomacroargs#1{#2}{#3}}{#4}}
-
-\CF@def\CF@swap@arg#1#2{#2{#1}}
-
-\CF@def\CF@exp@second#1#2{\CF@exp@macroarg\CF@swap@arg{#2}{#1}}% \CF@exp@second<{arg1>}{<arg2>} donne "<arg1>{*<arg2>}"
-
-\CF@def\CF@twoexp@second#1#2{\CF@twoexp@macroarg\CF@swap@arg{#2}{#1}}% \CF@twoexp@second{<arg1>}{<arg2>} donne "<arg1>{**<arg2>}"
-
-\CF@def\CF@swap@unarg#1#2{#2#1}
-
-\CF@def\CF@exp@after#1#2{\CF@exp@macroarg\CF@swap@unarg{#2}{#1}}% \CF@exp@after{<arg1>}{<arg2>} donne "<arg1>*<arg2>"
-
-\CF@def\CF@twoexp@after#1#2{\CF@twoexp@macroarg\CF@swap@unarg{#2}{#1}}% \CF@twoexp@after{<arg1>}{<arg2>} donne "<arg1>**<arg2>"
-
-\CF@def\CF@edef@second#1#2{%
- \edef\CF@tmp@str{#2}%
- \CF@exp@macroarg\CF@swap@unarg{\CF@tmp@str}{#1}%
-}
-
-\CF@def\CF@add@tocs#1#2{\CF@exp@second{\def#1}{#1#2}}
-
-\CF@def\CF@expadd@tocs#1#2{\CF@exp@second{\CF@add@tocs#1}{#2}}
-
-\CF@def\CF@edefadd@tocs#1#2{%
- \edef\CF@tmp@str{#2}%
- \CF@exp@second{\CF@add@tocs#1}{\CF@tmp@str}%
-}
-
-\CF@def\CF@if@firsttokmatch#1#2{% est ce que #1 et #2 commencent par les m\^emes tokens ?
+\def\CF@if@firsttokmatch#1#2{% est ce que #1 et #2 commencent par les mêmes tokens ?
\futurelet\CF@toks@a\CF@gobtonil#1\relax\@nil
\futurelet\CF@toks@b\CF@gobtonil#2\relax\@nil
\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
+\def\CF@if@firsttokin#1{% teste si le token qui commence #1 appartient aux tokens mis dans #2
\futurelet\CF@toks@a\CF@gobtonil#1\relax\@nil
\CF@if@firsttokin@a
}
-
-\CF@def\CF@if@firsttokin@a#1{%
+\def\CF@if@firsttokin@a#1{%
\CF@ifempty{#1}
- \@secondoftwo
+ \CF@execsecond
{\futurelet\CF@toks@b\CF@gobtonil#1\relax\@nil
\CF@ifx\CF@toks@a\CF@toks@b
- \@firstoftwo
- {\CF@exp@macroarg\CF@if@firsttokin@a{\@gobble#1}}%
+ \CF@execfirst
+ {\CF@exp@macroarg\CF@if@firsttokin@a{\CF@gobarg#1}}%
}%
}
-
-\CF@def\CF@if@instr#1#2{%
- \def\CF@if@instr@a##1#2##2\@nil{\ifx\@empty##2\@empty\expandafter\@secondoftwo\else\expandafter\@firstoftwo\fi}%
+\def\CF@if@instr#1#2{%
+ \def\CF@if@instr@a##1#2##2\@nil{\ifx\empty##2\empty\expandafter\CF@execsecond\else\expandafter\CF@execfirst\fi}%
\CF@if@instr@a#1\@@nil#2\@nil
}
-
-\CF@def\CF@after@space#1 #2\@nil{#2}
-
-\CF@def\CF@node@content{\expandafter\printatom\expandafter{\csname atom@\number\CF@cnt@atomnumber\endcsname\CF@node@strut}}
-
-\CF@def\chemskipalign{%
- \CF@doifempty\CF@bond@outcontentsaved% sauf si un \chemskipalign a \'et\'e fait \`a l'atome pr\'ec\'edent
- {\global\let\CF@bond@outcontentsaved\CF@bond@outcontent}% sauvegarder l'atome d'o\`u vient la liaison
- \let\CF@node@strut\@empty
+\def\CF@after@space#1 #2\@nil{#2}
+\def\CF@valuetomacro#1[#2]#3{% #1= macro #2=valeur défaut #3=clé
+ \CF@eexp@second{\def#1}{\useKV[chemfig]{#3}}%
+ \ifx#1\empty\def#1{#2}\fi
+}
+
+%---------------------------- Paramètres -----------------------------
+\def\setchemfig{\setKV[chemfig]}
+\def\resetchemfig{%
+ \setKVdefault[chemfig]{%
+ atom style ={},% code tikz mis à la fin de every node/.style
+ chemfig style ={},% code tikz mis à la fin de l'arugment optionnel de \tikzpicture
+ bond join =false,
+ fixed length =false,
+ cram rectangle =false,
+ cram width =1.5ex,
+ cram dash width =1pt,
+ cram dash sep =2pt,
+ atom sep =3em,
+ bond offset =2pt,
+ double bond sep =2pt,
+ angle increment =45,
+ node style ={},
+ bond style ={},
+ lewis | width =0.3ex,
+ lewis sep =0.4ex,
+ lewis length =1.5ex,
+ lewis style ={},
+ lewis dist =0.3em,
+ lewis radius =0.15ex,% [nouveau] rayon des disques
+ cycle radius coeff =0.75,% [nouveau] coeff du rayon du cercle dans les cycles
+ stack sep =1.5pt,
+ scheme debug =false,
+ compound style ={},
+ compound sep =5em,
+ arrow offset =4pt,
+ arrow angle =0,
+ arrow coeff =1,
+ arrow style ={},
+ arrow double sep =2pt,% [nouveau] espacement entre les doubles fleches
+ arrow double coeff =0.6,% [nouveau] coefficient de la petite fleche par rapport à la grande
+ arrow double harpoon=true,% [nouveau] fleche double forme harpon ou pas
+ arrow label sep =3pt,
+ arrow head =-CF,% [nouveau] style de bout de fleche
+ + sep left =0.5em,
+ + sep right =0.5em,
+ + vshift =0pt,
+ }%
}
-
-\CF@def\CF@empty@node{{}}
-
-\CF@def\CF@cycle@inraduiscoeff{0.75}% coeff multiplicateur du rayon des arcs dans les cycles
-
-\CF@def\CF@donoclip#1;{}
-\CF@def\setcrambond{%
- \@ifstar
- {\let\CF@clipcramornot\CF@donoclip\CF@setcrambond}
- {\def\CF@clipcramornot{\clip}\CF@setcrambond}%
+\resetchemfig
+
+\def\CF@warningdeprecated#1{\CF@warning{The macro \string#1 is deprecated. Please, use \string\setchemfig}}
+\def\setcrambond{%
+ \CF@warningdeprecated\setcrambond
+ \CF@ifstar
+ {\setchemfig{cram rectangle=true }\CF@setcrambond}
+ {\setchemfig{cram rectangle=false}\CF@setcrambond}%
+}
+\def\CF@setcrambond#1#2#3{\setchemfig{cram width=#1,cram dash width=#2,cram dash sep=#3}}
+\def\setatomsep#1{%
+ \CF@warningdeprecated\setatomsep
+ \setchemfig{atom sep=#1}%
+}
+\def\setbondoffset#1{%
+ \CF@warningdeprecated\setbondoffset
+ \setchemfig{bond offset=#1}%
+}
+\def\setdoublesep#1{%
+ \CF@warningdeprecated\setdoublesep
+ \setchemfig{double bond sep=#1}%
+}
+\def\setangleincrement#1{%
+ \CF@warningdeprecated\setangleincrement
+ \setchemfig{angle increment=#1}%
+}
+\def\enablefixedbondlength{%
+ \CF@warningdeprecated\enablefixedbondlength
+ \setchemfig{fixed length=true}%
+}
+\def\disablefixedbondlength{%
+ \CF@warningdeprecated\disablefixedbondlength
+ \setchemfig{fixed length=false}%
+}
+\def\setnodestyle#1{%
+ \CF@warningdeprecated\setnodestyle
+ \setchemfig{node style={#1}}%
+}
+\def\setbondstyle#1{%
+ \CF@warningdeprecated\setbondstyle
+ \setchemfig{bond style={#1}}%
+}
+\def\setlewis{%
+ \CF@warningdeprecated\setlewis
+ \CF@testopt\CF@setlewis{0.3ex}%
+}
+\def\CF@setlewis[#1]#2#3#4{\setchemfig{lewis | width=#1,lewis sep=#2,lewis length=#3,lewis style={#4}}}
+\def\setlewisdist#1{%
+ \CF@warningdeprecated\setlewisdist
+ \setchemfig{lewis dist=#1}%
+}
+\def\setstacksep#1{%
+ \CF@warningdeprecated\setstacksep
+ \setchemfig{stack sep=#1}%
+}
+\def\setcompoundstyle#1{%
+ \CF@warningdeprecated\setcompoundstyle
+ \setnodestyle\setchemfig{compound style={#1}}%
+}
+\def\CF@setdefault@a#1,#2,#3\@nil#4#5#6{%
+ \setchemfig{#4=#1}%
+ \CF@if@firsttokmatch\CF@quark{#2\relax}
+ {\setchemfig{#5={},#6={}}}%
+ {\setchemfig{#5={#2}}%
+ \CF@if@firsttokmatch\CF@quark{#3\relax}
+ {\setchemfig{#6={}}}%
+ {\CF@setdefault@b#3\@nil{#6}}%
+ }%
+}
+\def\CF@setdefault@b#1,\CF@quark#2\@nil#3{\setchemfig{#3={#1}}}
+\def\setarrowdefault#1{%
+ \CF@warningdeprecated\setarrowdefault
+ \CF@setdefault@a#1,\CF@quark,\CF@quark\@nil{arrow angle}{arrow coeff}{arrow style}%
+}
+\def\setandsign#1{%
+ \CF@warningdeprecated\setandsign
+ \CF@setdefault@a#1,\CF@quark,\CF@quark\@nil{+ sep left}{+ sep right}{+ vshift}%
+}
+\def\setarrowoffset#1{%
+ \CF@warningdeprecated\setarrowoffset
+ \setchemfig{arrow offset=#1}%
+}
+\def\setcompoundsep#1{%
+ \CF@warningdeprecated\setcompoundsep
+ \setchemfig{compound sep=#1}%
+}
+\def\setarrowlabelsep#1{%
+ \CF@warningdeprecated\setarrowlabelsep
+ \setchemfig{arrow label sep=#1}%
+}
+\def\enablebondjoin{%
+ \CF@warningdeprecated\enablebondjoin
+ \setchemfig{bond join=true}%
}
-\CF@def\CF@setcrambond#1#2#3{%
- \CF@ifempty{#1}{\def\CF@cram@basewidth{1.5ex}}{\def\CF@cram@basewidth{#1}}%
- \CF@ifempty{#2}{\def\CF@cram@dashlength{1pt}}{\def\CF@cram@dashlength{#2}}%
- \CF@ifempty{#3}{\def\CF@cram@dashsep{2pt}}{\def\CF@cram@dashsep{#3}}%
+\def\disablebondjoin{%
+ \CF@warningdeprecated\disablebondjoin
+ \setchemfig{bond join=false}%
+}
+\def\schemedebug#1{%
+ \CF@warningdeprecated\schemedebug
+ \setchemfig{scheme debug=#1}%
}
-\setcrambond{}{}{}
-\CF@def\setatomsep{\def\CF@atom@sep}% espacement des atomes li\'es
-\setatomsep{}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% D E S S I N M O L É C U L E S %%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\def\CF@sanitize@catcode{%
+ \CF@makeother\[\CF@makeother\]\CF@makeother\:\CF@makeother\(\CF@makeother\)%
+ \CF@makeother\,\CF@makeother\-\CF@makeother\=\CF@makeother\~\CF@makeother\!%
+ \CF@makeother\?\CF@makeother\<\CF@makeother\>\CF@makeother\;\CF@makeother\*%
+ \CF@makeother\|\CF@makeother\#\CF@makeother\@%
+}
-\CF@def\setbondoffset{\def\CF@bond@offset}% offset des liaisons
-\setbondoffset{2pt}
+\def\CF@node@content{\expandafter\printatom\expandafter{\csname atom@\number\CF@cnt@atomnumber\endcsname\CF@node@strut}}
-\CF@def\setdoublesep{\def\CF@double@sep}
-\setdoublesep{2pt}
+\def\chemskipalign{%
+ \CF@doifempty\CF@bond@outcontentsaved% sauf si un \chemskipalign a été fait à l'atome précédent
+ {\global\let\CF@bond@outcontentsaved\CF@bond@outcontent}% sauvegarder l'atome d'où vient la liaison
+ \let\CF@node@strut\empty
+}
-\CF@def\setangleincrement{\def\CF@angle@increment}
-\setangleincrement{45}% valeur par d\'efaut
+\def\CF@empty@node{{}}
-\CF@def\definesubmol{\CF@definesubmoltrue\CF@def@submol}
-\CF@def\redefinesubmol{\CF@definesubmolfalse\CF@def@submol}
+\def\definesubmol{\CF@definesubmoltrue\def@submol}
+\def\redefinesubmol{\CF@definesubmolfalse\def@submol}
-\CF@def\CF@def@submol#1{%
+\def\def@submol#1{%
\begingroup
\def\CF@tmp@str{#1}%
\catcode`[\@ne\catcode`]\tw@
\futurelet\CF@toks@a\CF@test@nxttok
}
-\CF@def\CF@test@nxttok{%
- \if[\noexpand\CF@toks@a\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
+\def\CF@test@nxttok{%
+ \if[\noexpand\CF@toks@a\expandafter\CF@execfirst\else\expandafter\CF@execsecond\fi
{\CF@exp@macroarg\CF@grab@optalias{\CF@tmp@str}}%
{\CF@exp@second{%
\endgroup
\begingroup
\CF@sanitize@catcode
- \CF@def@submol@a
+ \def@submol@a
}\CF@tmp@str{}%
}%
}
-\CF@def\CF@grab@optalias#1#2{%
+\def\CF@grab@optalias#1#2{%
\endgroup
\begingroup
- \everyeof{\@nil}\endlinechar\m@ne
+ \everyeof{\@nil}\endlinechar-1
\CF@sanitize@catcode
\expandafter\assign@tonil\expandafter\CF@tmp@str\scantokens{#2}%
\CF@exp@second{%
\CF@sanitize@catcode
- \CF@def@submol@a{#1}%
+ \def@submol@a{#1}%
}\CF@tmp@str
}
-\CF@def\CF@def@submol@a#1#2#3{% #1 nom, #2 = code si liaison arrive de droite , #3 = code si liaison arrive de gauche
+\def\def@submol@a#1#2#3{% #1 nom, #2 = code si liaison arrive de droite , #3 = code si liaison arrive de gauche
\endgroup
- \ifcat\relax\expandafter\noexpand\@car#1\@nil% si #1 est une s\'equence de contr\^ole
- \expandafter\ifdefined\@car#1\@nil
+ \ifcat\relax\expandafter\noexpand\CF@firsttonil#1\@nil% si #1 est une séquence de contrôle
+ \expandafter\ifdefined\CF@firsttonil#1\@nil
\ifCF@definesubmol
- \immediate\write\CF@unused{Package \CF@package@name\space Warning: the macro \expandafter\string\@car#1\@nil\space is already defined, the previous definition is lost on input line \the\inputlineno.}%
+ \immediate\write-1{Package \CFname\space Warning: the macro \expandafter\string\CF@firsttonil#1\@nil\space is already defined, the previous definition is lost on input line \the\inputlineno.}%
\fi
\fi
\CF@ifempty{#2}%
- {\CF@exp@second{\expandafter\def\@car#1\@nil}{\expandafter\@empty\romannumeral-`\.\noexpand#3}}
- {\expandafter\def\@car#1\@nil{%
+ {\CF@exp@second{\expandafter\def\CF@firsttonil#1\@nil}{\expandafter\empty\romannumeral-`\.\noexpand#3}}
+ {\expandafter\def\CF@firsttonil#1\@nil{%
\romannumeral-`\.%
\ifdim\CF@current@angle pt>90pt
\ifdim\CF@current@angle pt<270pt
- \expandafter\expandafter\expandafter\@firstoftwo
+ \expandafter\expandafter\expandafter\CF@execfirst
\else
- \expandafter\expandafter\expandafter\@secondoftwo
+ \expandafter\expandafter\expandafter\CF@execsecond
\fi
\else
- \expandafter\@secondoftwo
+ \expandafter\CF@execsecond
\fi
{\noexpand#2}{\noexpand#3}}%
}%
\else
\ifcsname CF@@#1\endcsname
\ifCF@definesubmol
- \immediate\write\CF@unused{Package \CF@package@name\space Warning:the submol "#1" is already defined, the previous definition is lost on input line \the\inputlineno.}%
+ \immediate\write-1{Package \CFname\space Warning:the submol "#1" is already defined, the previous definition is lost on input line \the\inputlineno.}%
\fi
\fi
\CF@ifempty{#2}%
- {\CF@exp@second{\expandafter\def\csname CF@@#1\endcsname}{\expandafter\@empty\romannumeral-`\.\noexpand#3}}
+ {\CF@exp@second{\expandafter\def\csname CF@@#1\endcsname}{\expandafter\empty\romannumeral-`\.\noexpand#3}}
{\expandafter\def\csname CF@@#1\endcsname{%
\romannumeral-`\.%
\ifdim\CF@current@angle pt>90pt
\ifdim\CF@current@angle pt<270pt
- \expandafter\expandafter\expandafter\@firstoftwo
+ \expandafter\expandafter\expandafter\CF@execfirst
\else
- \expandafter\expandafter\expandafter\@secondoftwo
+ \expandafter\expandafter\expandafter\CF@execsecond
\fi
\else
- \expandafter\@secondoftwo
+ \expandafter\CF@execsecond
\fi
{\noexpand#2}{\noexpand#3}}%
}%
\fi
}
-\CF@def\CF@seek@node#1#2#3{% cherche un noeud au d\'ebut de #1 l'assigne dans la sc #2 et met le reste dans #3
- \let#2\@empty
+\def\CF@seek@node#1#2#3{% cherche un noeud au début de #1 l'assigne dans la sc #2 et met le reste dans #3
+ \let#2\empty
\def#3{#1}%
\CF@if@firsttokmatch{#1}{ }%
- {\CF@exp@macroarg\CF@seek@node@a{\romannumeral-`\.\noexpand#1}#2#3}% ignore les espaces au d\'ebut du groupe d'atome
+ {\CF@exp@macroarg\CF@seek@node@a{\romannumeral-`\.\noexpand#1}#2#3}% ignore les espaces au début du groupe d'atome
{\CF@seek@node@a{#1}#2#3}%
}
-\CF@def\CF@seek@node@a#1#2#3{%
+\def\CF@seek@node@a#1#2#3{%
\CF@ifempty{#1}%
- {\let#3\@empty}
+ {\let#3\empty}
{\futurelet\CF@toks@a\CF@gobtonil#1\relax\@nil
\CF@ifx\CF@toks@a\@sptoken
{\CF@add@tocs#2{ }%
\CF@exp@macroarg\CF@seek@node@a{\CF@after@space#1\@nil}#2#3%
}%
{\CF@ifx\CF@toks@a\bgroup
- {\CF@expadd@tocs#2{\expandafter{\@car#1\@nil}}%
- \CF@exp@macroarg\CF@seek@node@a{\@gobble#1}#2#3%
+ {\CF@eadd@tocs#2{\expandafter{\CF@firsttonil#1\@nil}}%
+ \CF@exp@macroarg\CF@seek@node@a{\CF@gobarg#1}#2#3%
}%
{\CF@if@firsttokin@a{-=(*<>!~}%
{\def#3{#1}}%
- {\CF@expadd@tocs#2{\@car#1\@nil}%
- \CF@exp@macroarg\CF@seek@node@a{\@gobble#1}#2#3%
+ {\CF@eadd@tocs#2{\CF@firsttonil#1\@nil}%
+ \CF@exp@macroarg\CF@seek@node@a{\CF@gobarg#1}#2#3%
}%
}%
}%
@@ -398,32 +464,29 @@
}
% 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@findcode#1#2{%
+% #2 reçoit le type de liaisons (1 pour -, 2 pour =, 3 pour ~)
+\def\CF@bond@findcode#1#2{%
\futurelet\CF@toks@a\CF@gobtonil#1\@nil
\edef#2{%
\ifx-\CF@toks@a1\else
\ifx=\CF@toks@a2\else
\ifx~\CF@toks@a3\else
\ifx>\CF@toks@a4\else
- \ifx<\CF@toks@a5\else0% si 0 --> il y a une erreur non due \`a l'utilisateur
+ \ifx<\CF@toks@a5\else0% si 0 --> il y a une erreur non due à l'utilisateur
\fi\fi\fi\fi\fi}%
\ifnum#2>\thr@@% si c'est une liaison de Cram
- \CF@exp@after{\futurelet\CF@toks@a\CF@gobtonil}{\@gobble#1\@nil}% chope le caract\`ere suivant
+ \CF@exp@after{\futurelet\CF@toks@a\CF@gobtonil}{\CF@gobarg#1\@nil}% chope le caractère suivant
\CF@ifx:\CF@toks@a
- {\edef#2{\number\numexpr#2+2}}% si c 'est un ":", signe du pointill\'e, ajoute 2
- {\ifx|\CF@toks@a
- \edef#2{\number\numexpr#2+4}% si c 'est un "|", signe du triangle \'evid\'e, ajouter 4
- \fi
- }%
+ {\edef#2{\number\numexpr#2+2}}% si c 'est un ":", signe du pointillé, ajoute 2
+ {\CF@ifx|\CF@toks@a{\edef#2{\number\numexpr#2+4}}{}}% si c 'est un "|", signe du triangle évidé, ajouter 4
\fi
}
-\CF@def\CF@analyse@bondoffset#1,#2\@nil{%
+\def\CF@analyse@bondoffset#1,#2\@nil{%
\def\CF@start@offset{#1}\def\CF@end@offset{#2}%
}
-\CF@def\CF@grab@bondoffset#1(#2)#3\@nil{%
+\def\CF@grab@bondoffset#1(#2)#3\@nil{%
\CF@doifnotempty{#2}%
{\CF@if@instr{#2},%
{\CF@analyse@bondoffset#2\@nil}%
@@ -432,24 +495,24 @@
\def\CF@remain@afterbond{#3}%
}
-\CF@def\CF@analyse@bond#1#2{%
+\def\CF@analyse@bond#1#2{%
\CF@bond@findcode{#1}#2%
- \CF@exp@second{\def\CF@remain@afterbond}{\@gobble#1}%mange le premier signe de la liaison
+ \CF@exp@second{\def\CF@remain@afterbond}{\CF@gobarg#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
- \CF@exp@after{\futurelet\CF@toks@a\CF@gobtonil}{\@gobble#1\@nil}%
+ \ifnum#2=\tw@% si c'est une double liaison, regarde s'il y a un + ou - derrière
+ \CF@exp@after{\futurelet\CF@toks@a\CF@gobtonil}{\CF@gobarg#1\@nil}%
\CF@ifx^\CF@toks@a
{\let\CF@doublebond@type\@ne
- \CF@exp@second{\def\CF@remain@afterbond}{\@gobbletwo#1}% mange le "^"
+ \CF@exp@second{\def\CF@remain@afterbond}{\CF@gobtwoargs#1}% mange le "^"
}
{\ifx_\CF@toks@a
\let\CF@doublebond@type\tw@
- \CF@exp@second{\def\CF@remain@afterbond}{\@gobbletwo#1}% mange le "_"
+ \CF@exp@second{\def\CF@remain@afterbond}{\CF@gobtwoargs#1}% mange le "_"
\fi
}%
\else
- \ifnum#2>5 % si c'est une laision de Cram pointill\'ee ou triangle \'evid\'e
- \CF@exp@second{\def\CF@remain@afterbond}{\@gobbletwo#1}% mange un caract\`ere de plus
+ \ifnum#2>5 % si c'est une laision de Cram pointillée ou triangle évidé
+ \CF@exp@second{\def\CF@remain@afterbond}{\CF@gobtwoargs#1}% mange un caractère de plus
\fi
\fi
\CF@exp@twomacroargs\CF@if@firsttokmatch\CF@remain@afterbond\CF@hash%
@@ -460,30 +523,30 @@
{}%
\CF@exp@macroarg\CF@if@firsttokmatch{\CF@remain@afterbond}[%
{\expandafter\CF@analyse@optarg\CF@remain@afterbond\@nil\CF@remain@afterbond}%
- {\let\CF@current@stringangle\CF@default@stringangle
- \let\CF@current@length\CF@default@length
- \let\CF@current@fromatom\CF@default@fromatom
- \let\CF@current@toatom\CF@default@toatom
- \let\CF@current@tikz\CF@default@tikz
- \let\CF@movebond@name\@empty
+ {\let\CF@current@stringangle\default@stringangle
+ \let\CF@current@length\default@length
+ \let\CF@current@fromatom\default@fromatom
+ \let\CF@current@toatom\default@toatom
+ \let\CF@current@tikz\default@tikz
+ \let\CF@movebond@name\empty
}%
\ifCF@incycle
\pgfmathsetmacro\CF@cycle@increment@angle{360/\CF@cycle@num+\CF@initcycle@angle}%
\edef\CF@current@stringangle{::+\CF@cycle@increment@angle}%
\def\CF@initcycle@angle{0}%
- \let\CF@current@length\CF@default@length% et on ignore la longueur de liaison sp\'ecifi\'ee
+ \let\CF@current@length\default@length% et on ignore la longueur de liaison spécifiée
\fi
\CF@exp@macroarg\CF@set@bondangle{\CF@current@stringangle}\CF@current@angle
}
-\CF@def\CF@set@bondangle#1#2{% le code de la direction est contenu dans #1, en sortie, #2 contient l'angle
+\def\CF@set@bondangle#1#2{% le code de la direction est contenu dans #1, en sortie, #2 contient l'angle
\CF@ifempty{#1}%
- {\let#2\CF@default@angle}
- {\if:\expandafter\noexpand\@car#1\@nil
- \if:\CF@three@ea\noexpand\expandafter\@car\@gobble#1\@nil
- \pgfmathsetmacro#2{\CF@previous@angle+\expandafter\@gobble\@gobble#1}%
+ {\let#2\default@angle}
+ {\if:\expandafter\noexpand\CF@firsttonil#1\@nil
+ \if:\CF@three@ea\noexpand\expandafter\CF@firsttonil\CF@gobarg#1\@nil
+ \pgfmathsetmacro#2{\CF@previous@angle+\expandafter\CF@gobarg\CF@gobarg#1}%
\else
- \pgfmathsetmacro#2{\@gobble#1}%
+ \pgfmathsetmacro#2{\CF@gobarg#1}%
\fi
\else
\pgfmathsetmacro#2{#1*\CF@angle@increment}%
@@ -493,99 +556,124 @@
}%
}
-\CF@def\CF@int@part#1.#2\@nil{#1 }
+\def\CF@int@part#1.#2\@nil{#1 }
-\CF@def\CF@analyse@movearg#1,#2\@nil#3{%
+\def\CF@analyse@movearg#1,#2\@nil#3{%
\def#3{#1}\def\CF@movebond@coeff{#2}%
}
-% Argument limit\'es l\'egitimes ici car #2 (qui est ce qui suit "@{<nom>}" dans l'argument optionnel) ne DOIT
+% Argument limités légitimes ici car #2 (qui est ce qui suit "@{<nom>}" dans l'argument optionnel) ne DOIT
% pas commencer par une accolade.
-\expandafter\CF@def\expandafter\CF@grab@movearg\CF@arobas#1#2\@nil{%
+\expandafter\def\expandafter\CF@grab@movearg\CF@arobas#1#2\@nil{%
\CF@if@instr{#1},%
{\CF@analyse@movearg#1\@nil\CF@movebond@name}%
{\def\CF@movebond@name{#1}\def\CF@movebond@coeff{0.5}}%
\def\CF@remain@optarg{#2}%
}
-\CF@def\CF@testempty@andassign#1#2#3{\CF@ifempty{#2}{\let#1#3}{\def#1{#2}}}
-
-\CF@def\CF@sanitize@lastitem#1,\@empty#2\@nil{#1}
+\def\CF@testempty@andassign#1#2#3{\CF@ifempty{#2}{\let#1#3}{\def#1{#2}}}
-\CF@def\CF@parse@optlist#1,#2,#3,#4,#5\@nil{%
- \CF@testempty@andassign\CF@current@stringangle{#1}\CF@default@stringangle
- \CF@testempty@andassign\CF@current@length{#2}\CF@default@length
- \CF@testempty@andassign\CF@current@fromatom{#3}\CF@default@fromatom
- \CF@testempty@andassign\CF@current@toatom{#4}\CF@default@toatom
- \expandafter\CF@testempty@andassign\expandafter\CF@current@tikz\expandafter{\CF@sanitize@lastitem#5,\@empty\@nil}\CF@default@tikz
+\def\CF@parse@optlist#1,#2,#3,#4,#5\@nil{%
+ \CF@testempty@andassign\CF@current@stringangle{#1}\default@stringangle
+ \CF@testempty@andassign\CF@current@length{#2}\default@length
+ \CF@testempty@andassign\CF@current@fromatom{#3}\default@fromatom
+ \CF@testempty@andassign\CF@current@toatom{#4}\default@toatom
+ \expandafter\CF@testempty@andassign\expandafter\CF@current@tikz\expandafter{\CF@sanitize@lastitem#5,\empty\@nil}\default@tikz
}%
-\CF@def\CF@analyse@optarg[#1]#2\@nil#3{%
+\def\CF@analyse@optarg[#1]#2\@nil#3{%
\CF@doifnotempty{#1}%
{\CF@exp@after{\CF@if@firsttokmatch{#1}}{\CF@arobas}%
{\CF@grab@movearg#1\@nil}%
- {\let\CF@movebond@name\@empty
+ {\let\CF@movebond@name\empty
\def\CF@remain@optarg{#1}%
}%
- \expandafter\CF@parse@optlist\CF@remain@optarg,\@empty,\@empty,\@empty,\@empty\@nil
+ \expandafter\CF@parse@optlist\CF@remain@optarg,\empty,\empty,\empty,\empty\@nil
\def#3{#2}%
}%
}
-\CF@def\CF@seek@submol{%
+\def\CF@seek@submol{%
\CF@exp@second{\def\CF@remain@molecule}{\romannumeral-`\.\expandafter\noexpand\CF@remain@molecule}%
\CF@exp@macroarg\CF@if@firsttokmatch{\CF@remain@molecule}!%
- {\CF@twoexp@second{\def\CF@remain@molecule}{\expandafter\@gobble\CF@remain@molecule}% enl\`eve le "!"
- \ifx\empty\CF@remain@molecule\errmessage{Package \CF@package@name\space Error: no submol name found after "!"}\fi
- \ifcat\relax\CF@three@ea\noexpand\expandafter\@car\CF@remain@molecule*\@nil
- \CF@twoexp@second{\CF@twoexp@second{\def\CF@insert@submol}}{\expandafter\@car\CF@remain@molecule\@nil}%
+ {\CF@eexp@second{\def\CF@remain@molecule}{\expandafter\CF@gobarg\CF@remain@molecule}% enlève le "!"
+ \CF@ifx\empty\CF@remain@molecule{\errmessage{Package \CFname\space Error: no submol name found after "!"}}{}%
+ \ifcat\relax\CF@three@ea\noexpand\expandafter\CF@firsttonil\CF@remain@molecule*\@nil
+ \CF@eexp@second{\CF@eexp@second{\def\CF@insert@submol}}{\expandafter\CF@firsttonil\CF@remain@molecule\@nil}%
\else
- \CF@exp@second{\CF@twoexp@second{\def\CF@insert@submol}}{\csname CF@@\expandafter\@car\CF@remain@molecule\@nil\endcsname}%
+ \CF@exp@second{\CF@eexp@second{\def\CF@insert@submol}}{\csname CF@@\expandafter\CF@firsttonil\CF@remain@molecule\@nil\endcsname}%
\fi
- \CF@twoexp@second{\def\CF@remain@molecule}{\csname CF@insert@submol\CF@three@ea\endcsname\csname @gobble\expandafter\endcsname\CF@remain@molecule}%
+ \CF@eexp@second{\def\CF@remain@molecule}{\csname CF@insert@submol\CF@three@ea\endcsname\csname @gobble\expandafter\endcsname\CF@remain@molecule}%
\CF@seek@submol
}%
{}%
}
-\CF@def\CF@insert@emptygroup#1{% ins\`ere {} au d\'ebut de la sc #1
+\def\CF@insert@emptygroup#1{% insère {} au début de la sc #1
\CF@exp@second{\def#1}{\expandafter{\expandafter}#1}%
}
-\CF@def\chemfig{\@ifstar{\CF@macrofixedbondlengthtrue\CF@chemfig@a}{\CF@macrofixedbondlengthfalse\CF@chemfig@a}}
+\def\chemfig{%
+ \CF@ifstar
+ {\CF@warning{Do not use star \string\chemfig\space but set the key "fixed lengths"}%
+ \CF@macrofixedbondlengthtrue\CF@chemfig@a
+ }
+ {\ifboolKV[chemfig]{fixed length}
+ \CF@macrofixedbondlengthtrue
+ \CF@macrofixedbondlengthfalse
+ \CF@chemfig@a}%
+}
-\CF@def\CF@chemfig@a{\ifCF@globalfixedbondlength\CF@macrofixedbondlengthtrue\fi\@testopt\CF@chemfig@b{}}
+\def\CF@chemfig@a{\CF@testopt\CF@chemfig@b{}}
-\CF@def\CF@chemfig@b[#1]{\@testopt{\CF@chemfig@c[#1]}{}}
+\def\CF@chemfig@b[#1]{\CF@testopt{\CF@chemfig@c[#1]}{}}
-\CF@def\CF@chemfig@c[#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]}%
+\def\CF@chemfig@c[#1][#2]{%
+ \if\relax\detokenize{#1#2}\relax\else
+ \CF@warning{Do not use optional arguments but set the keys "tikz node style" and "tikz code"}%
+ \fi
+ \edef\CF@tmp@str{[remember picture,every node/.style={anchor=base,inner sep=\z@,outer sep=\z@,minimum size=\z@,\ifx\empty#2\empty\useKV[chemfig]{atom style}\else#2\fi},baseline,\ifx\empty#1\empty\useKV[chemfig]{chemfig style}\else#1\fi]}%
\CF@exp@threemacroargs\CF@chemfig@d\CF@begin@tikzpicture\CF@tmp@str\CF@end@tikzpicture
}
-\CF@def\CF@chemfig@d#1#2#3#4{%
+\def\CF@chemfig@d#1#2#3#4{%
#1#2%
\begingroup
- \let\CF@hook@list\@empty
- \CF@doifempty\CF@atom@sep{\def\CF@atom@sep{3em}}%
- \CF@doifempty\CF@cram@basewidth{\def\CF@cram@basewidth{1.5ex}}%
+ \let\CF@hook@list\empty
+ \ifboolKV[chemfig]{bond join}
+ {\let\CF@draw@axisbond\CF@draw@axisbond@join}
+ {\let\CF@draw@axisbond\CF@draw@axisbond@nojoin}%
+ \ifboolKV[chemfig]{cram rectangle}
+ {\let\CF@clipcramornot\CF@gobtikzinstruction}
+ {\let\CF@clipcramornot\clip}%
+ \CF@valuetomacro\CF@cram@basewidth[1.5ex]{cram width}%
+ \CF@valuetomacro\CF@cram@dashlength[1pt]{cram dash width}%
+ \CF@valuetomacro\CF@cram@dashsep[2pt]{cram dash sep}%
+ \CF@valuetomacro\CF@atom@sep[3em]{atom sep}% espacement des atomes liés
+ \CF@valuetomacro\CF@bond@offset[2pt]{bond offset}%
+ \CF@valuetomacro\CF@double@sep[2pt]{double bond sep}%
+ \CF@valuetomacro\CF@angle@increment[45]{angle increment}%
+ \CF@valuetomacro\CF@node@style[]{node style}%
+ \CF@valuetomacro\CF@bond@style[]{bond style}%
+ \CF@valuetomacro\CF@stacksep[1.5pt]{stack sep}%
+ \CF@valuetomacro\CF@cycle@inraduiscoeff[0.75]{cycle radius coeff}% coeff multiplicateur du rayon des arcs dans les cycles
\CF@incyclefalse
\CF@cnt@groupnumber\z@
- \let\CF@last@action\z@% 0=d\'ebut du dessin 1=trac\'e d'un noeud 2=trac\'e d'une liaison
- \let\CF@start@offset\@empty
- \let\CF@end@offset\@empty
- \let\CF@bond@outcontentsaved\@empty
+ \let\CF@last@action\z@% 0=début du dessin 1=tracé d'un noeud 2=tracé d'une liaison
+ \let\CF@start@offset\empty
+ \let\CF@end@offset\empty
+ \let\CF@bond@outcontentsaved\empty
\def\CF@cycle@anglecorrection{180/\CF@cycle@num}%
- \def\CF@default@angle{0}%
- \def\CF@default@stringangle{:0}% angle pris par d\'efaut si le champ est vide
- \def\CF@default@length{1}%
- \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
+ \def\default@angle{0}%
+ \def\default@stringangle{:0}% angle pris par défaut si le champ est vide
+ \def\default@length{1}%
+ \let\default@fromatom\empty% numero de l'atome d'où partent les liaisons par défaut
+ \let\default@toatom\empty% numéro de l'atome où arrivent les laisons par défaut
+ \let\default@tikz\empty
\let\CF@previous@bondangle\empty
\let\CF@joinbond\z@
\let\CF@previous@tikz\empty
- \everyeof{\@nil}\endlinechar\m@ne
+ \everyeof{\@nil}\endlinechar-1
\CF@sanitize@catcode
\expandafter\assign@tonil\expandafter\CF@remain@molecule\scantokens{#4}%
\CF@exp@macroarg\CF@chemfig@e{\CF@remain@molecule}%
@@ -593,39 +681,39 @@
\let\CF@split@state\z@
}
-\CF@def\CF@chemfig@e#1{% #1 est le code de la mol\'ecule
+\def\CF@chemfig@e#1{% #1 est le code de la molécule
\ifnum\CF@last@action=\thr@@
\ifCF@incycle
- \def\CF@default@angle{0}%
+ \def\default@angle{0}%
\else
- \ifnum\CF@cnt@cycle=\z@% si c'est le d\'ebut d'un cycle
- \pgfmathsetmacro\CF@default@angle{\CF@previous@angle+180+\CF@cycle@anglecorrection}% on met la liaison \`a +180° + correction
+ \ifnum\CF@cnt@cycle=\z@% si c'est le début d'un cycle
+ \pgfmathsetmacro\default@angle{\CF@previous@angle+180+\CF@cycle@anglecorrection}% on met la liaison à +180° + correction
\else
- \pgfmathsetmacro\CF@default@angle{\CF@previous@angle-90+180/\CF@cycle@num}% sinon \`a la bissectrice du sommet du cycle
+ \pgfmathsetmacro\default@angle{\CF@previous@angle-90+180/\CF@cycle@num}% sinon à la bissectrice du sommet du cycle
\fi
\fi
- \let\CF@default@stringangle\@empty
+ \let\default@stringangle\empty
\fi
- \let\CF@current@angle\CF@default@angle
+ \let\CF@current@angle\default@angle
\def\CF@remain@molecule{#1}%
\CF@seek@submol% alias en premier ?
- \if[\CF@three@ea\noexpand\expandafter\@car\CF@remain@molecule\@nil
+ \if[\CF@three@ea\noexpand\expandafter\CF@firsttonil\CF@remain@molecule\@nil
\expandafter\CF@analyse@optarg\CF@remain@molecule\@nil\CF@remain@molecule
\CF@exp@macroarg\CF@set@bondangle{\CF@current@stringangle}\CF@current@angle
- \let\CF@default@angle\CF@current@angle
+ \let\default@angle\CF@current@angle
\let\CF@previous@angle\CF@current@angle
- \CF@doifnotempty\CF@current@stringangle{\let\CF@default@angle\CF@current@angle}%
- \CF@doifnotempty\CF@current@length{\let\CF@default@length\CF@current@length}%
- \CF@doifnotempty\CF@current@fromatom{\let\CF@default@fromatom\CF@current@fromatom}%
- \CF@doifnotempty\CF@current@toatom{\let\CF@default@toatom\CF@current@toatom}%
- \CF@doifnotempty\CF@current@tikz{\let\CF@default@tikz\CF@current@tikz}%
+ \CF@doifnotempty\CF@current@stringangle{\let\default@angle\CF@current@angle}%
+ \CF@doifnotempty\CF@current@length{\let\default@length\CF@current@length}%
+ \CF@doifnotempty\CF@current@fromatom{\let\default@fromatom\CF@current@fromatom}%
+ \CF@doifnotempty\CF@current@toatom{\let\default@toatom\CF@current@toatom}%
+ \CF@doifnotempty\CF@current@tikz{\let\default@tikz\CF@current@tikz}%
\CF@seek@submol
\fi
- \edef\CF@default@stringangle{:\CF@default@angle}%
- \let\CF@current@length\CF@default@length
- \let\CF@current@fromatom\CF@default@fromatom
- \let\CF@current@toatom\CF@default@toatom
- \let\CF@current@tikz\CF@default@tikz
+ \edef\default@stringangle{:\default@angle}%
+ \let\CF@current@length\default@length
+ \let\CF@current@fromatom\default@fromatom
+ \let\CF@current@toatom\default@toatom
+ \let\CF@current@tikz\default@tikz
\ifCF@incycle% si on commence un cycle
\let\CF@current@angle\CF@previous@angle
\ifCF@cyclearc% on doit tracer l'arc de cercle dans le cycle ?
@@ -633,14 +721,14 @@
\pgfmathsetmacro\CF@cyclearc@initangle{\CF@current@angle+\CF@initcycle@angle+180/\CF@cycle@num+90}
\pgfmathparse{\CF@current@length*\CF@atom@sep/(2*sin(180/\CF@cycle@num))}%
\node[at=(\CF@bond@outnode),shift=(\CF@cyclearc@initangle:\pgfmathresult pt)](arccenter){};% le centre de l'arc
- \node[at=(arccenter),shift=(\CF@cyclearc@startangle:\CF@cyclearc@radius pt)](initarc){};% le d\'ebut de l'arc
+ \node[at=(arccenter),shift=(\CF@cyclearc@startangle:\CF@cyclearc@radius pt)](initarc){};% le début de l'arc
\expandafter\draw\expandafter[\CF@cyclearc@directtikz](initarc) arc (\CF@cyclearc@startangle:\CF@cyclearc@endangle:\CF@cyclearc@radius pt);
\fi
\else
- \let\CF@current@angle\CF@default@angle
+ \let\CF@current@angle\default@angle
\fi
\ifnum\CF@last@action=\z@
- \let\CF@previous@angle\CF@default@angle
+ \let\CF@previous@angle\default@angle
\node(CF@node){};
\CF@exp@macroarg\CF@if@firsttokin{\CF@remain@molecule}{-=(*~?<>}%
{\CF@insert@emptygroup\CF@remain@molecule}%
@@ -649,26 +737,26 @@
\CF@chemfig@f
}
-\CF@def\CF@chemfig@f{%
- \let\CF@next@action\CF@chemfig@f% \`a priori, on reboucle
- \CF@ifx\CF@remain@molecule\@empty
+\def\CF@chemfig@f{%
+ \let\CF@next@action\CF@chemfig@f% à priori, on reboucle
+ \CF@ifx\CF@remain@molecule\empty
{\let\CF@next@action\endgroup}
{\CF@seek@submol
\CF@exp@macroarg\CF@seek@node{\CF@remain@molecule}\CF@current@atomgroup\CF@remain@molecule
- \CF@ifx\@empty\CF@current@atomgroup% pas de noeud pour commencer ?
+ \CF@ifx\empty\CF@current@atomgroup% pas de noeud pour commencer ?
{\def\CF@bond@outnode{%
n\CF@last@groupnumber-%
- \ifx\CF@current@fromatom\@empty
+ \ifx\CF@current@fromatom\empty
\ifdim\CF@current@angle pt<90pt \number\CF@cnt@atomingroup
\else\ifdim\CF@current@angle pt>270pt \number\CF@cnt@atomingroup\else1\fi
\fi
- \else
+ \else
\CF@current@fromatom
- \fi}%
+ \fi}%
\CF@exp@after{\futurelet\CF@toks@a\CF@gobtonil}{\CF@remain@molecule\relax\@nil}%
\CF@if@firsttokin@a{-=<>~}% la suite est une liaison
- {\ifnum\CF@last@action=\tw@% c'est la deuxi\`eme liaison cons\'ecutive ?
- \CF@insert@emptygroup\CF@remain@molecule% ins\`ere un groupe vide
+ {\ifnum\CF@last@action=\tw@% c'est la deuxième liaison consécutive ?
+ \CF@insert@emptygroup\CF@remain@molecule% insère un groupe vide
\edef\CF@bond@outnode{\CF@bond@outnode}%
\else
\ifCF@incycle\advance\CF@cnt@cycle\@ne\fi
@@ -677,16 +765,16 @@
\let\CF@remain@molecule\CF@remain@afterbond
\ifCF@incycle
\ifnum\CF@cnt@cycle=\CF@cycle@num\relax
- \CF@three@ea\@firstoftwo
+ \CF@three@ea\CF@execfirst
\else
\ifnum\CF@cnt@cycle=\@ne
\let\CF@cycle@firsttikz\CF@current@tikz
\CF@doifnotempty\CF@start@offset{\let\CF@cycle@joinlast\z@}%
\fi
- \CF@three@ea\@secondoftwo
+ \CF@three@ea\CF@execsecond
\fi
\else
- \expandafter\@secondoftwo
+ \expandafter\CF@execsecond
\fi
{\let\CF@next@action\endgroup
\CF@draw@bond\CF@bond@type{\CF@bond@outnode}{\CF@hook@cycle}\CF@previous@atomgroup\CF@hook@atomgroup
@@ -697,39 +785,39 @@
}%
\fi
\ifcat\relax\detokenize\expandafter{\romannumeral-`\.\expandafter\noexpand\CF@remain@molecule}\relax
- % s'il ne reste plus rien apr\`es la liaison (sans tenir compte de l'espace devant)-> ins\`ere un groupe vide
+ % s'il ne reste plus rien après la liaison (sans tenir compte de l'espace devant)-> insère un groupe vide
\CF@insert@emptygroup\CF@remain@molecule
\fi
}%
- {\edef\CF@bond@outnode{\CF@bond@outnode}% \'evalue le l'atome de d\'epart de liaison
- \CF@ifx(\CF@toks@a% une parenth\`ese pour commencer ?
+ {\edef\CF@bond@outnode{\CF@bond@outnode}% évalue le l'atome de départ de liaison
+ \CF@ifx(\CF@toks@a% une parenthèse pour commencer ?
{\ifnum\CF@last@action=\tw@% il y avait une liaison juste avant ?
\CF@insert@emptygroup\CF@remain@molecule
\else
\CF@exp@macroarg\CF@grab@submol{\CF@remain@molecule}%
\begingroup
- \ifCF@incycle\let\CF@last@action\thr@@\fi% on \'etait dans un cycle
+ \ifCF@incycle\let\CF@last@action\thr@@\fi% on était dans un cycle
\CF@incyclefalse
\aftergroup\CF@chemfig@f
\def\CF@next@action{\CF@exp@macroarg\CF@chemfig@e{\CF@sub@mol}}%
\fi
}%
- {\CF@ifx\CF@remain@molecule\@empty
+ {\CF@ifx\CF@remain@molecule\empty
{\let\CF@next@action\endgroup}
- {% ce qui reste apr\`es le noeud courant n'est pas vide, ne commence pas par "-=~", ni par une parenth\`ese
+ {% ce qui reste après le noeud courant n'est pas vide, ne commence pas par "-=~", ni par une parenthèse
\CF@ifx*\CF@toks@a% un cycle ?
{\ifnum\CF@last@action=\tw@
- \CF@insert@emptygroup\CF@remain@molecule% ins\`ere un groupe vide
+ \CF@insert@emptygroup\CF@remain@molecule% insère un groupe vide
\else
- \ifCF@incycle\let\CF@last@action\thr@@\fi% on \'etait dans un cycle
+ \ifCF@incycle\let\CF@last@action\thr@@\fi% on était dans un cycle
\ifnum\CF@last@action=\thr@@\let\CF@lastcycle@num\CF@cycle@num\fi
- \CF@twoexp@macroarg\CF@if@firsttokmatch{\expandafter\@gobble\CF@remain@molecule}*%
- {\CF@twoexp@second{\def\CF@remain@molecule}{\expandafter\@gobble\CF@remain@molecule}% enl\`eve la 1er \'etoile
- \CF@twoexp@macroarg\CF@if@firsttokmatch{\expandafter\@gobble\CF@remain@molecule}[% un crochet ensuite ?
+ \CF@eexp@macroarg\CF@if@firsttokmatch{\expandafter\CF@gobarg\CF@remain@molecule}*%
+ {\CF@eexp@second{\def\CF@remain@molecule}{\expandafter\CF@gobarg\CF@remain@molecule}% enlève la 1er étoile
+ \CF@eexp@macroarg\CF@if@firsttokmatch{\expandafter\CF@gobarg\CF@remain@molecule}[% un crochet ensuite ?
{\expandafter\CF@cycle@parsepreamblewithoptarg\CF@remain@molecule\@nil% \begingroup inclus
}%
{\def\CF@cyclearc@startangle{0}\def\CF@cyclearc@endangle{360}%
- \let\CF@cyclearc@directtikz\@empty
+ \let\CF@cyclearc@directtikz\empty
\expandafter\CF@cycle@parsepreamble\CF@remain@molecule\@nil% \begingroup inclus
}%
\CF@cyclearctrue
@@ -753,7 +841,7 @@
\def\CF@next@action{\CF@exp@macroarg\CF@chemfig@e{\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.}%
+ {\errmessage{Package \CFname\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.}%
}%
}%
}%
@@ -765,9 +853,9 @@
\CF@next@action
}
-\CF@def\CF@cycle@parsepreamble*#1#2\@nil{%
+\def\CF@cycle@parsepreamble*#1#2\@nil{%
\ifnum#1<\thr@@
- \errmessage{Package \CF@package@name\space Error: A cycle must be at least a triangle.^^JThe number following "*" must be 3 or more}%
+ \errmessage{Package \CFname\space Error: A cycle must be at least a triangle.^^JThe number following "*" must be 3 or more}%
\fi
\def\CF@remain@molecule{#2}%
\CF@exp@macroarg\CF@grab@submol{\CF@remain@molecule}%
@@ -775,18 +863,18 @@
\def\CF@cycle@num{#1}%
}
-\CF@def\CF@cycle@parsepreamblewithoptarg*[#1]#2#3\@nil{%
- \CF@cycle@parseoptarg#1,\@empty,\@empty,\@empty\@nil
+\def\CF@cycle@parsepreamblewithoptarg*[#1]#2#3\@nil{%
+ \CF@cycle@parseoptarg#1,\empty,\empty,\empty\@nil
\CF@cycle@parsepreamble*#2#3\@nil
}
-\CF@def\CF@cycle@parseoptarg#1,#2,#3\@nil{%
+\def\CF@cycle@parseoptarg#1,#2,#3\@nil{%
\CF@ifempty{#1}{\def\CF@cyclearc@startangle{0}}{\def\CF@cyclearc@startangle{#1}}%
\CF@ifempty{#2}{\def\CF@cyclearc@endangle{360}}{\def\CF@cyclearc@endangle{#2}}%
- \CF@exp@second{\def\CF@cyclearc@directtikz}{\CF@sanitize@lastitem#3,\@empty\@nil}%
+ \CF@exp@second{\def\CF@cyclearc@directtikz}{\CF@sanitize@lastitem#3,\empty\@nil}%
}
-\CF@def\CF@grab@submol#1{%
+\def\CF@grab@submol#1{%
\begingroup
\catcode`(\@ne\catcode`)\tw@
\CF@three@ea
@@ -794,33 +882,33 @@
\expandafter\CF@grab@submol@a\scantokens{\relax#1}%
}
-\CF@def\CF@grab@submol@a#1\@nil{%
- \expandafter\assign@tonil\expandafter\CF@remain@molecule\scantokens\CF@three@ea{\expandafter\@gobble\@gobble#1}%
- \expandafter\assign@tonil\expandafter\CF@sub@mol\scantokens\CF@three@ea{\expandafter\@car\@gobble#1\@nil}%
+\def\CF@grab@submol@a#1\@nil{%
+ \expandafter\assign@tonil\expandafter\CF@remain@molecule\scantokens\CF@three@ea{\expandafter\CF@gobarg\CF@gobarg#1}%
+ \expandafter\assign@tonil\expandafter\CF@sub@mol\scantokens\CF@three@ea{\expandafter\CF@firsttonil\CF@gobarg#1\@nil}%
}
-\CF@def\assign@tonil#1#2\@nil{\def#1{#2}}
+\def\assign@tonil#1#2\@nil{\def#1{#2}}
-\CF@def\CF@ifcar@isupperletter#1{%
+\def\CF@ifcar@isupperletter#1{%
\ifcat\relax\noexpand#1%
- \let\CF@next\@secondoftwo% faux si c'est une sc
+ \let\CF@next\CF@execsecond% faux si c'est une sc
\else
\ifnum`#1<`A
- \let\CF@next\@secondoftwo
+ \let\CF@next\CF@execsecond
\else
\ifnum`#1>`Z
- \let\CF@next\@secondoftwo
+ \let\CF@next\CF@execsecond
\else
- \let\CF@next\@firstoftwo
+ \let\CF@next\CF@execfirst
\fi
\fi
\fi
\CF@next
}
-% Cr\'e\'e 4 noeuds au dessus et au dessous des noeuds #1 et #2
-% \`a une distance de #3 du noeud #1 et #4 du noeud #2
-\CF@def\CF@create@normnodes#1#2#3#4{%
+% Créé 4 noeuds au dessus et au dessous des noeuds #1 et #2
+% à une distance de #3 du noeud #1 et #4 du noeud #2
+\def\CF@create@normnodes#1#2#3#4{%
\CF@doifnotempty{#3}
{\node[shape=coordinate,at=(#1),xshift=#3*\CF@norm@x,yshift=#3*\CF@norm@y](#11){};
\node[shape=coordinate,at=(#1),xshift=-#3*\CF@norm@x,yshift=-#3*\CF@norm@y](#12){};
@@ -831,7 +919,7 @@
}%
}
-\CF@def\CF@compute@nodevect#1#2{%
+\def\CF@compute@nodevect#1#2{%
\pgfextractx\CF@dim{\pgfpointanchor{#1}{center}}\edef\CF@dimax{\the\CF@dim}%
\pgfextracty\CF@dim{\pgfpointanchor{#1}{center}}\edef\CF@dimay{\the\CF@dim}%
\pgfextractx\CF@dim{\pgfpointanchor{#2}{center}}\edef\CF@dimbx{\the\CF@dim}%
@@ -841,16 +929,16 @@
\pgfmathsetmacro\CF@norm@y{(\CF@dimbx-\CF@dimax)/\CF@len@vector}%
}
-\CF@def\CF@set@offset#1#2{%
+\def\CF@set@offset#1#2{%
\CF@doifempty#1%
- {\edef#1{\ifx#2\CF@empty@node0pt\else\ifx#2\@empty0pt\else\CF@bond@offset\fi\fi}}%
+ {\edef#1{\ifx#2\CF@empty@node0pt\else\ifx#2\empty0pt\else\CF@bond@offset\fi\fi}}%
}
-\CF@def\CF@draw@bond#1#2#3#4#5{% #1=type de liaison #2 et #3:nom de noeuds de d\'ebut et fin #4 et #5: contenu des atomes de d\'ebut et fin
+\def\CF@draw@bond#1#2#3#4#5{% #1=type de liaison #2 et #3:nom de noeuds de début et fin #4 et #5: contenu des atomes de début et fin
\CF@set@offset\CF@start@offset#4%
\CF@set@offset\CF@end@offset#5%
\let\CF@current@bondstyle\CF@bond@style
- \CF@doifnotempty\CF@current@tikz{\CF@expadd@tocs\CF@current@bondstyle{\expandafter,\CF@current@tikz}}%
+ \CF@doifnotempty\CF@current@tikz{\CF@eadd@tocs\CF@current@bondstyle{\expandafter,\CF@current@tikz}}%
\path(#2)--(#3)coordinate[pos=0](#2@)coordinate[pos=1](#3@);%
\CF@compute@nodevect{#2@}{#3@}%
\pgfmathsetmacro\CF@start@coeff{\CF@start@offset/\CF@len@vector}%
@@ -858,10 +946,10 @@
\path(#2@)--(#3@)coordinate[pos=\CF@start@coeff](#2@@)coordinate[pos=\CF@end@coeff](#3@@);%
\CF@doifnotempty\CF@movebond@name% 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
+ \let\CF@movebond@name\empty
}%
\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}%
+ \errmessage{Package \CFname\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@axisbond{#2}{#3}% trace la liaison simple dans l'axe
\or% 2 = liaison double
@@ -882,7 +970,7 @@
\or
\CF@create@normnodes{#2@@}{#3@@}\CF@double@sep\CF@double@sep
\CF@draw@axisbond{#2}{#3}% trace la liaison simple dans l'axe\CF@draw@bond@a(#2@@)--(#3@@);
- \begingroup% ajuste \'eventuellement les longueurs des l(0,0iaisons doubles
+ \begingroup% ajuste éventuellement les longueurs des l(0,0iaisons doubles
\ifCF@incycle
\ifdim\CF@start@offset=\z@
\CF@edefadd@tocs\CF@current@bondstyle{,shorten <=\CF@doublebond@lengthcorrection pt}%
@@ -896,7 +984,7 @@
\or
\CF@create@normnodes{#2@@}{#3@@}\CF@double@sep\CF@double@sep
\CF@draw@axisbond{#2}{#3}% trace la liaison simple dans l'axe\CF@draw@bond@a(#2@@)--(#3@@);
- \begingroup% ajuste \'eventuellement les longueurs des liaisons doubles
+ \begingroup% ajuste éventuellement les longueurs des liaisons doubles
\ifCF@incycle
\ifdim\CF@start@offset=\z@
\CF@edefadd@tocs\CF@current@bondstyle{,shorten \ifnum\CF@split@state=\z@<=-\else>=\fi\CF@doublebond@lengthcorrection pt}%
@@ -921,41 +1009,41 @@
\CF@create@normnodes{#3@@}{#2@@}{\CF@cram@basewidth/2}{}%
\expandafter\filldraw\expandafter[\CF@current@bondstyle,line join=bevel](#3@@1)--(#3@@2)--(#2@@)--cycle;
\let\CF@joinbond\z@
- \or% 6 = liaison Cram pointill\'ee de #2 vers #3
+ \or% 6 = liaison Cram pointillée de #2 vers #3
\scope
\CF@create@normnodes{#2@@}{#3@@}{\CF@cram@basewidth/2}{}%
\CF@clipcramornot(#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
+ \or% 7 = liaison Cram pointillée de #3 vers #2
\scope
\CF@create@normnodes{#3@@}{#2@@}{\CF@cram@basewidth/2}{}%
\CF@clipcramornot(#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
+ \or% 8 = liaison cram rectangle évidé 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@@)--cycle;
\let\CF@joinbond\z@
- \or% 9 = liaison Cram triangle \'evid\'e de #3 vers #1
+ \or% 9 = liaison cram rectangle évidé 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@@)--cycle;
\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}%
+ \errmessage{Package \CFname\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@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@a(#1@@)--(#2@@);}
+\def\CF@draw@axisbond@nojoin#1#2{\CF@draw@bond@a(#1@@)--(#2@@);}
-\CF@def\CF@draw@axisbond@join#1#2{% dessine une liaison simple dans l'axe avec raccord r\'etrograde
+\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
@@ -977,7 +1065,7 @@
\CF@ifx\CF@previous@tikz\CF@current@tikz
{\let\CF@joinbond\@ne
\CF@ifx\CF@previous@atomgroup\CF@empty@node
- {\CF@ifx\CF@previous@bondangle\empty% si d\'ebut mol\'ecule
+ {\CF@ifx\CF@previous@bondangle\empty% si début molécule
{\CF@draw@bond@a(#1@@)--(#2@@);
}
{\ifdim\CF@start@offset=\z@
@@ -1025,24 +1113,20 @@
\CF@draw@bond@a(#1@@)--(#2@@);
\fi
}%
- \fi
- \ifdim\CF@end@offset=\z@\else\let\CF@joinbond\z@\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
+\def\CF@draw@bond@a{\expandafter\draw\expandafter[\CF@current@bondstyle]}
-\CF@def\CF@draw@bond@a{\expandafter\draw\expandafter[\CF@current@bondstyle]}
-
-\CF@def\CF@hook@drawall{% dessine tous les crochets contenus dans la sc \CF@hook@draw
+\def\CF@hook@drawall{% dessine tous les crochets contenus dans la sc \CF@hook@draw
\CF@doifnotempty\CF@hook@drawlist
- {\expandafter\CF@hook@drawfirst\CF@hook@drawlist\@nil% trace un lien de crochet \`a crochet
+ {\expandafter\CF@hook@drawfirst\CF@hook@drawlist\@nil% trace un lien de crochet à crochet
\CF@hook@drawall
}%
}
-\CF@def\CF@hook@drawfirst[#1,#2,#3]#4#5#6#7#8\@nil{%
+\def\CF@hook@drawfirst[#1,#2,#3]#4#5#6#7#8\@nil{%
\def\CF@hook@drawlist{#8}%
\begingroup
\let\CF@joinbond\z@
@@ -1056,29 +1140,23 @@
\endgroup
}
-\CF@def\CF@extract@atom#1-#2\@nil{#2}% transforme le bound@outnode en n° de l'atome
-
-\CF@def\setnodestyle{\def\CF@node@style}
-\setnodestyle{}
-
-\CF@def\setbondstyle{\def\CF@bond@style}
-\setbondstyle{}
+\def\CF@extract@atom#1-#2\@nil{#2}% transforme le bound@outnode en n° de l'atome
-\expandafter\CF@def\expandafter\CF@gobble@movearg\CF@arobas#1#2\@nil#3{%
+\expandafter\def\expandafter\CF@gobble@movearg\CF@arobas#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}%
+ {\CF@analyse@movearg#1\@nil#3\let\CF@movebond@coeff\empty}%
{\def#3{#1}}%
- \CF@doifempty{#2}{\let\CF@node@strut\@empty}%
+ \CF@doifempty{#2}{\let\CF@node@strut\empty}%
}%
-\CF@def\hflipnext{\let\CF@split@state\@ne}
+\def\hflipnext{\let\CF@split@state\@ne}
-\CF@def\vflipnext{\let\CF@split@state\tw@}
+\def\vflipnext{\let\CF@split@state\tw@}
\let\CF@split@state\z@
-\CF@def\CF@draw@atomgroup#1#2#3{% #1=angle d'arriv\'ee de la liaison #2=numero atome sur lequel arrive la liaison #3=groupe d'atomes
- \expandafter\let\expandafter\CF@bond@outcontent% assigne le contenu de l'atome d'o\`u part la liaison
+\def\CF@draw@atomgroup#1#2#3{% #1=angle d'arrivée de la liaison #2=numero atome sur lequel arrive la liaison #3=groupe d'atomes
+ \expandafter\let\expandafter\CF@bond@outcontent% assigne le contenu de l'atome d'où part la liaison
\csname
\ifdefined\CF@bond@outnode
atom@\expandafter\CF@extract@atom\CF@bond@outnode\@nil
@@ -1087,12 +1165,12 @@
\fi
\endcsname
\global\advance\CF@cnt@groupnumber\@ne
- \let\CF@current@atom\@empty
- \global\let\CF@hook@drawlist\@empty
+ \let\CF@current@atom\empty
+ \global\let\CF@hook@drawlist\empty
\CF@cnt@atomingroup\z@
\CF@if@firsttokmatch{#3}?{\CF@draw@atomgroup@a{{}#3}}{\CF@draw@atomgroup@a{#3}}%
\def\CF@current@atomgroup{#3}%
- \CF@remove@movearg\CF@current@atomgroup% enl\`eve les "@{<nom>}"
+ \CF@remove@movearg\CF@current@atomgroup% enlève les "@{<nom>}"
\CF@if@instr{#3}?%
{\CF@remove@hook\CF@current@atomgroup
\ifcat\relax\detokenize\expandafter{\romannumeral-`\.\expandafter\noexpand\CF@current@atomgroup}\relax
@@ -1102,10 +1180,10 @@
{}%
\CF@doifnotempty{#2}
{\ifnum#2<\@ne
- \immediate\write\CF@unused{Package \CF@package@name\space Warning: no atom found at position #2, pershaps you mispelled the optional argument of the bond.}%
+ \immediate\write-1{Package \CFname\space Warning: no atom found at position #2, pershaps you mispelled the optional argument of the bond.}%
\else
\ifnum#2>\CF@cnt@atomingroup
- \errmessage{Package \CF@package@name\space Error: no atom found at position #2, pershaps you mispelled the optional argument of the bond.}%
+ \errmessage{Package \CFname\space Error: no atom found at position #2, pershaps you mispelled the optional argument of the bond.}%
\fi
\fi
}%
@@ -1120,45 +1198,45 @@
}%
\CF@cnt@atomnumber\CF@hook@atomnumber
\CF@ifx\CF@current@atomgroup\CF@empty@node
- {\let\CF@node@strut\@empty}
- {\CF@ifx\@empty\CF@bond@outcontentsaved
+ {\let\CF@node@strut\empty}
+ {\CF@ifx\empty\CF@bond@outcontentsaved
{\def\CF@node@strut{\vphantom\CF@bond@outcontent}}%
{\def\CF@node@strut{\vphantom\CF@bond@outcontentsaved}}%
}%
- \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
+ \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écule affiché
\loop
\unless\ifnum\CF@cnt@atomnumber>\CF@cnt@atomingroup
- \CF@twoexp@after
+ \CF@eexp@after
{\futurelet\CF@toks@a}
{\expandafter\expandafter\expandafter\CF@gobtonil\csname atom@\number\CF@cnt@atomnumber\endcsname\@nil}%
\expandafter\CF@ifx\CF@arobas\CF@toks@a% l'atome courant commence par un "@"
{\CF@three@ea\CF@gobble@movearg\csname atom@\number\CF@cnt@atomnumber\endcsname\@nil\CF@moveatom@name
\expandafter\node\expandafter[\CF@opt@string,overlay](\CF@moveatom@name){\phantom{\CF@node@content}};%
- \let\CF@moveatom@name\@empty
+ \let\CF@moveatom@name\empty
}
{}%
\expandafter\node\expandafter[\CF@opt@string](n\number\CF@cnt@groupnumber-\number\CF@cnt@atomnumber){\CF@node@content};%
- \let\CF@node@strut\@empty
+ \let\CF@node@strut\empty
\advance\CF@cnt@atomnumber\@ne
\edef\CF@opt@string{anchor=base \ifnum\CF@split@state=\@ne east\else west\fi,at=(n\number\CF@cnt@groupnumber-\number\numexpr\CF@cnt@atomnumber-1.base \ifnum\CF@split@state=\@ne west\else east\fi),\CF@node@style}%
\repeat
\CF@cnt@atomnumber\CF@hook@atomnumber
\ifnum\CF@last@action=\tw@% s'il faut tracer une liaison
- \gdef\CF@cycle@anglecorrection{0}% alors c'est qu'un cycle ne peut pas commencer la mol\'ecule : annulation de la correction d'angle
+ \gdef\CF@cycle@anglecorrection{0}% alors c'est qu'un cycle ne peut pas commencer la molécule : annulation de la correction d'angle
\CF@draw@bond\CF@bond@type{\CF@bond@outnode}{n\number\CF@cnt@groupnumber-\number\CF@cnt@atomnumber}\CF@previous@atomgroup\CF@current@atomgroup
\fi
- \let\CF@last@action\@ne% met la derni\`ere action \`a 1 : affichage d'un noeud
+ \let\CF@last@action\@ne% met la dernière action à 1 : affichage d'un noeud
\loop
\ifnum\CF@cnt@atomnumber>\@ne
- \advance\CF@cnt@atomnumber\m@ne
+ \advance\CF@cnt@atomnumber-1
\edef\CF@opt@string{anchor=base \ifnum\CF@split@state=\@ne west\else east\fi,at=(n\number\CF@cnt@groupnumber-\number\numexpr\CF@cnt@atomnumber+1.base \ifnum\CF@split@state=\@ne east\else west\fi),\CF@node@style}%
- \CF@twoexp@after
+ \CF@eexp@after
{\futurelet\CF@toks@a}
{\expandafter\expandafter\expandafter\CF@gobtonil\csname atom@\number\CF@cnt@atomnumber\endcsname\@nil}%
\expandafter\CF@ifx\CF@arobas\CF@toks@a% l'atome courant commence par un "@"
{\CF@three@ea\CF@gobble@movearg\csname atom@\number\CF@cnt@atomnumber\endcsname\@nil\CF@moveatom@name
\expandafter\node\expandafter[\CF@opt@string,overlay](\CF@moveatom@name){\phantom{\CF@node@content}};%
- \let\CF@moveatom@name\@empty
+ \let\CF@moveatom@name\empty
}
{}%
\expandafter\node\expandafter[\CF@opt@string](n\number\CF@cnt@groupnumber-\number\CF@cnt@atomnumber){\CF@node@content};%
@@ -1168,9 +1246,9 @@
\let\CF@previous@atomgroup\CF@current@atomgroup
}
-\expandafter\CF@def\expandafter\CF@keep@movearg\CF@arobas#1#2\@nil{\CF@exp@second{\def\CF@current@atom}{\CF@arobas{#1}}}
+\expandafter\def\expandafter\CF@keep@movearg\CF@arobas#1#2\@nil{\CF@exp@second{\def\CF@current@atom}{\CF@arobas{#1}}}
-\CF@def\CF@draw@atomgroup@a#1{% transforme #1 en un groupe d'atomes
+\def\CF@draw@atomgroup@a#1{% transforme #1 en un groupe d'atomes
\CF@ifempty{#1}
{\expandafter\let\csname atom@\number\CF@cnt@atomingroup\endcsname\CF@current@atom}
{\advance\CF@cnt@atomingroup\@ne
@@ -1180,33 +1258,33 @@
\CF@remove@movearg@a#1\@nil\CF@after@movearg
\CF@exp@macroarg\CF@draw@atomgroup@b{\CF@after@movearg}%
}%
- {\let\CF@current@atom\@empty
+ {\let\CF@current@atom\empty
\CF@draw@atomgroup@b{#1}%
}%
}%
}
-\CF@def\CF@draw@atomgroup@b#1{%
+\def\CF@draw@atomgroup@b#1{%
\CF@ifempty{#1}
{\expandafter\let\csname atom@\number\CF@cnt@atomingroup\endcsname\CF@current@atom}
{\futurelet\CF@toks@a\CF@gobtonil#1\@nil
\CF@ifx\bgroup\CF@toks@a
- {\CF@expadd@tocs\CF@current@atom{\expandafter{\@car#1\@nil}}%
- \CF@exp@macroarg\CF@draw@atomgroup@bi{\@gobble#1}%
+ {\CF@eadd@tocs\CF@current@atom{\expandafter{\CF@firsttonil#1\@nil}}%
+ \CF@exp@macroarg\CF@draw@atomgroup@bi{\CF@gobarg#1}%
}%
{\CF@ifx\@sptoken\CF@toks@a
{\CF@add@tocs\CF@current@atom{ }%
\CF@exp@macroarg\CF@draw@atomgroup@bi{\CF@after@space#1\@nil}%
}%
- {\CF@expadd@tocs\CF@current@atom{\@car#1\@nil}%
- \CF@exp@macroarg\CF@draw@atomgroup@bi{\@gobble#1}%
+ {\CF@eadd@tocs\CF@current@atom{\CF@firsttonil#1\@nil}%
+ \CF@exp@macroarg\CF@draw@atomgroup@bi{\CF@gobarg#1}%
}%
}%
}%
}
-% enl\`eve tous les "@{nom}" de la sc #1
-\CF@def\CF@remove@movearg#1{%
+% enlève tous les "@{nom}" de la sc #1
+\def\CF@remove@movearg#1{%
\CF@exp@after{\expandafter\CF@if@instr\expandafter{#1}}{\CF@arobas}%
{\expandafter\CF@remove@movearg@a#1\@nil#1%
\CF@remove@movearg#1%
@@ -1214,65 +1292,65 @@
{}%
}
-% enl\`eve le premier "@{<nom>}" de l'argument et l'assigne \`a #2
-\CF@def\CF@remove@movearg@a#1\@nil#2{%
+% enlève le premier "@{<nom>}" de l'argument et l'assigne à #2
+\def\CF@remove@movearg@a#1\@nil#2{%
\expandafter\def\expandafter\CF@remove@movearg@b\expandafter##\expandafter1\CF@arobas{%
- \CF@exp@second{\def#2}{\@gobble##1}% mange le \relax
+ \CF@exp@second{\def#2}{\CF@gobarg##1}% mange le \relax
\CF@remove@movearg@c\relax
}%
- \def\CF@remove@movearg@c##1\@nil{\CF@expadd@tocs#2{\@gobbletwo##1}}% mange le \relax et le <nom>
+ \def\CF@remove@movearg@c##1\@nil{\CF@eadd@tocs#2{\CF@gobtwoargs##1}}% mange le \relax et le <nom>
\CF@remove@movearg@b\relax#1\@nil
}
-\CF@def\CF@draw@atomgroup@bi#1{% transforme #1 en un groupe d'atomes
+\def\CF@draw@atomgroup@bi#1{% transforme #1 en un groupe d'atomes
\CF@ifempty{#1}
{\expandafter\let\csname atom@\number\CF@cnt@atomingroup\endcsname\CF@current@atom
- \let\CF@current@atom\@empty
+ \let\CF@current@atom\empty
}
{\futurelet\CF@toks@a\CF@gobtonil#1\@nil
\expandafter\CF@ifx\CF@arobas\CF@toks@a
{\expandafter\let\csname atom@\number\CF@cnt@atomingroup\endcsname\CF@current@atom
- \let\CF@current@atom\@empty
+ \let\CF@current@atom\empty
\CF@draw@atomgroup@a{#1}%
}%
{\CF@ifx|\CF@toks@a
{\expandafter\let\csname atom@\number\CF@cnt@atomingroup\endcsname\CF@current@atom
- \let\CF@current@atom\@empty
- \CF@exp@macroarg\CF@draw@atomgroup@a{\@gobble#1}%
+ \let\CF@current@atom\empty
+ \CF@exp@macroarg\CF@draw@atomgroup@a{\CF@gobarg#1}%
}%
{\CF@ifx\@sptoken\CF@toks@a
{\CF@add@tocs\CF@current@atom{ }%
\CF@exp@macroarg\CF@draw@atomgroup@bi{\CF@after@space#1\@nil}%
- }%
+ }%
{\CF@ifx\bgroup\CF@toks@a
- {\CF@expadd@tocs\CF@current@atom{\expandafter{\@car#1\@nil}}%
- \CF@exp@macroarg\CF@draw@atomgroup@bi{\@gobble#1}%
+ {\CF@eadd@tocs\CF@current@atom{\expandafter{\CF@firsttonil#1\@nil}}%
+ \CF@exp@macroarg\CF@draw@atomgroup@bi{\CF@gobarg#1}%
}%
- {\CF@exp@macroarg\CF@ifcar@isupperletter{\@car#1\@nil}%
+ {\CF@exp@macroarg\CF@ifcar@isupperletter{\CF@firsttonil#1\@nil}%
{\expandafter\let\csname atom@\number\CF@cnt@atomingroup\endcsname\CF@current@atom
- \let\CF@current@atom\@empty
+ \let\CF@current@atom\empty
\CF@draw@atomgroup@a{#1}%
}%
{\CF@ifx?\CF@toks@a
- {\CF@exp@macroarg\CF@if@firsttokmatch{\@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}%
- \CF@exp@twomacroargs\CF@if@instr{\CF@hook@list}{\expandafter(\CF@hook@currentname)}% crochet d\'ej\`a d\'efini ?
- {\CF@exp@macroarg\CF@hook@parselist{\CF@hook@currentname}% chercher les caract\'eristiques du crochet sauvegard\'e
+ {\CF@exp@macroarg\CF@if@firsttokmatch{\CF@gobarg#1}[% un crochet après le "?"
+ {\expandafter\CF@grab@optarg\CF@gobarg#1\@nil\CF@after@hook}%
+ {\expandafter\CF@grab@optarg\expandafter[\expandafter]\CF@gobarg#1\@nil\CF@after@hook}%
+ \CF@exp@twomacroargs\CF@if@instr{\CF@hook@list}{\expandafter(\CF@hook@currentname)}% crochet déjà défini ?
+ {\CF@exp@macroarg\CF@hook@parselist{\CF@hook@currentname}% chercher les caractéristiques du crochet sauvegardé
\CF@edefadd@tocs\CF@hook@drawlist{%
[\CF@hook@currentname,\CF@hook@currentlink,\CF@hook@currenttikz]{\CF@hook@savedcoord}{n\number\CF@cnt@groupnumber-\number\CF@cnt@atomingroup}}%
- \CF@expadd@tocs\CF@hook@drawlist{\expandafter{\CF@hook@savedcontent}}%
- \CF@expadd@tocs\CF@hook@drawlist{\expandafter{\CF@current@atom}}% ajoute les 4 arguments \`a la liste des crochets \`a tracer
+ \CF@eadd@tocs\CF@hook@drawlist{\expandafter{\CF@hook@savedcontent}}%
+ \CF@eadd@tocs\CF@hook@drawlist{\expandafter{\CF@current@atom}}% ajoute les 4 arguments à la liste des crochets à tracer
\global\let\CF@hook@drawlist\CF@hook@drawlist
}%
{\CF@edefadd@tocs\CF@hook@list{(\CF@hook@currentname)|n\number\CF@cnt@groupnumber-\number\CF@cnt@atomingroup|}%
- \CF@expadd@tocs\CF@hook@list{\CF@current@atom|}%
+ \CF@eadd@tocs\CF@hook@list{\CF@current@atom|}%
\global\let\CF@hook@list\CF@hook@list
}%
\CF@exp@macroarg\CF@draw@atomgroup@bi{\CF@after@hook}%
}%
- {\CF@expadd@tocs\CF@current@atom{\@car#1\@nil}%
- \CF@exp@macroarg\CF@draw@atomgroup@bi{\@gobble#1}%
+ {\CF@eadd@tocs\CF@current@atom{\CF@firsttonil#1\@nil}%
+ \CF@exp@macroarg\CF@draw@atomgroup@bi{\CF@gobarg#1}%
}%
}%
}%
@@ -1282,27 +1360,27 @@
}%
}
-\CF@def\CF@kook@defaultname{a}
-\CF@def\CF@hook@defaultlink{-}
-\CF@def\CF@hook@defaulttikz{}
+\def\CF@kook@defaultname{a}
+\def\CF@hook@defaultlink{-}
+\def\CF@hook@defaulttikz{}
-\CF@def\CF@hook@parseoptarg#1,#2,#3\@nil{%
+\def\CF@hook@parseoptarg#1,#2,#3\@nil{%
\CF@testempty@andassign\CF@hook@currentname{#1}\CF@kook@defaultname
\CF@testempty@andassign\CF@hook@currentlink{#2}\CF@hook@defaultlink
\CF@testempty@andassign\CF@hook@currenttikz{#3}\CF@hook@defaulttikz
}
-\CF@def\CF@grab@optarg[#1]#2\@nil#3{%
+\def\CF@grab@optarg[#1]#2\@nil#3{%
\CF@hook@parseoptarg#1,,\@nil
\def#3{#2}%
}
-\CF@def\CF@hook@parselist#1{% #1 est le nom du noeud \`a retrouver
+\def\CF@hook@parselist#1{% #1 est le nom du noeud à retrouver
\def\CF@hook@parselist@a##1(#1)|##2|##3|##4\@nil{\def\CF@hook@savedcoord{##2}\def\CF@hook@savedcontent{##3}}%
\expandafter\CF@hook@parselist@a\CF@hook@list\@nil
}
-\CF@def\CF@remove@hook#1{%
+\def\CF@remove@hook#1{%
\CF@exp@macroarg\CF@if@instr{#1}?%
{\expandafter\CF@remove@hook@a\expandafter\relax#1\@nil#1%
\CF@remove@hook#1%
@@ -1310,51 +1388,42 @@
{}%
}
-\CF@def\CF@remove@hook@a#1?#2\@nil#3{%
+\def\CF@remove@hook@a#1?#2\@nil#3{%
\CF@if@firsttokmatch{#2}[%
{\CF@remove@hook@b#1?#2\@nil#3}
- {\CF@exp@second{\def#3}{\@gobble#1#2}}%
-}
-
-\CF@def\CF@remove@hook@b#1?[#2]#3\@nil#4{\CF@exp@second{\def#4}{\@gobble#1#3}}
-
-\CF@def\setlewis{\@testopt\CF@setlewis{0.3ex}}
-
-\CF@def\CF@setlewis[#1]#2#3#4{%
- \def\CF@lewis@widthdouble{#1}%
- \CF@ifempty{#2}{\def\CF@lewis@offset{0.4ex}}{\def\CF@lewis@offset{#2}}%
- \CF@ifempty{#3}{\def\CF@lewis@length{1.5ex}}{\def\CF@lewis@length{#3}}%
- \CF@ifempty{#4}{\def\CF@lewis@style{}}{\def\CF@lewis@style{#4}}%
+ {\CF@exp@second{\def#3}{\CF@gobarg#1#2}}%
}
-\setlewis{}{}{}
-\CF@def\setlewisdist#1{%
- \CF@ifempty{#1}{\def\CF@lewis@dist{0.2em}}{\def\CF@lewis@dist{#1}}%
-}
-\setlewisdist{0.3em}
+\def\CF@remove@hook@b#1?[#2]#3\@nil#4{\CF@exp@second{\def#4}{\CF@gobarg#1#3}}
-\CF@def\Lewis{\@testopt{\CF@lewis@a{}}{1}}
+\def\Lewis{\CF@testopt{\CF@lewis@a{}}{1}}
-\CF@def\lewis{\@testopt{\CF@lewis@a{,overlay}}{1}}
+\def\lewis{\CF@testopt{\CF@lewis@a{,overlay}}{1}}
-\CF@def\CF@lewis@a#1[#2]{%
+\def\CF@lewis@a#1[#2]{%
+ \CF@valuetomacro\CF@lewis@widthdouble[0.3ex]{lewis | width}%
+ \CF@valuetomacro\CF@lewis@offset[0.4ex]{lewis sep}%
+ \CF@valuetomacro\CF@lewis@length[1.5ex]{lewis length}%
+ \CF@valuetomacro\CF@lewis@style[]{lewis style}%
+ \CF@valuetomacro\CF@lewis@dist[0.3em]{lewis dist}%
+ \CF@valuetomacro\CF@lewis@radius[0.15ex]{lewis radius}%
\CF@ifempty{#2}{\def\CF@lewis@diagcoeff{1}}{\def\CF@lewis@diagcoeff{#2}}%
\CF@lewis@b{#1}%
}
-\CF@def\CF@lewis@b#1#2{\CF@lewis@c#2\@nil{#1}}
+\def\CF@lewis@b#1#2{\CF@lewis@c#2\@nil{#1}}
-\CF@def\CF@lewis@c#1,#2\@nil#3{%
+\def\CF@lewis@c#1,#2\@nil#3{%
\setbox\CF@lewis@box\hbox{\printatom{#2}}% mettre en dehors de tikzpicture (si \printatom ne passe pas en mode math)
\tikzpicture[every node/.style={anchor=base,inner sep=\z@,outer sep=\z@,minimum size=\z@},baseline]%
- \@makeother;\@makeother:%
+ \CF@makeother;\CF@makeother:%
\node(CF@lewis@anchor){};
\def\CF@lewis@remainpos{#1}%
- \let\CF@lewis@previouspos\@empty
+ \let\CF@lewis@previouspos\empty
\loop
- \unless\ifx\CF@lewis@remainpos\@empty
- \edef\CF@lewis@currentpos{\expandafter\@car\CF@lewis@remainpos\@nil}%
- \edef\CF@lewis@remainpos{\expandafter\@gobble\CF@lewis@remainpos}%
+ \unless\ifx\CF@lewis@remainpos\empty
+ \edef\CF@lewis@currentpos{\expandafter\CF@firsttonil\CF@lewis@remainpos\@nil}%
+ \edef\CF@lewis@remainpos{\expandafter\CF@gobarg\CF@lewis@remainpos}%
\pgfmathsetmacro\CF@lewis@x{\wd\CF@lewis@box/2+\ifcase\CF@lewis@currentpos\space1\or1\or0\or-1\or-1\or-1\or0\or1\fi*(\wd\CF@lewis@box/2)}%
\pgfmathsetmacro\CF@lewis@y{\ht\CF@lewis@box/2+\ifcase\CF@lewis@currentpos\space0\or1\or1\or1\or0\or-1\or-1\or-1\fi*(\ht\CF@lewis@box/2\ifnum\CF@lewis@currentpos>4 +\dp\CF@lewis@box\fi)}%
\edef\CF@lewis@xoffset{\ifcase\CF@lewis@currentpos\space1\or0.70711\or0\or-0.70711\or-1\or-0.70711\or0\or0.70711\fi}%
@@ -1364,13 +1433,13 @@
\else
\let\CF@lewis@current@offset\CF@lewis@offset
\fi
- \if.\expandafter\@car\CF@lewis@remainpos\relax\@nil
- \edef\CF@lewis@remainpos{\expandafter\@gobble\CF@lewis@remainpos}%
+ \if.\expandafter\CF@firsttonil\CF@lewis@remainpos\relax\@nil
+ \edef\CF@lewis@remainpos{\expandafter\CF@gobarg\CF@lewis@remainpos}%
\CF@exp@after{\draw[fill,black,}{\CF@lewis@style#3]}%
- (\CF@lewis@x pt+\CF@lewis@xoffset*\CF@lewis@current@offset,\CF@lewis@y pt+\CF@lewis@yoffset*\CF@lewis@current@offset)circle(0.15ex);%
+ (\CF@lewis@x pt+\CF@lewis@xoffset*\CF@lewis@current@offset,\CF@lewis@y pt+\CF@lewis@yoffset*\CF@lewis@current@offset)circle(\CF@lewis@radius);%
\else
- \if|\expandafter\@car\CF@lewis@remainpos\relax\@nil
- \edef\CF@lewis@remainpos{\expandafter\@gobble\CF@lewis@remainpos}%
+ \if|\expandafter\CF@firsttonil\CF@lewis@remainpos\relax\@nil
+ \edef\CF@lewis@remainpos{\expandafter\CF@gobarg\CF@lewis@remainpos}%
\pgfmathsetmacro\CF@lewis@x{\CF@lewis@x pt+\CF@lewis@xoffset*\CF@lewis@current@offset}%
\pgfmathsetmacro\CF@lewis@y{\CF@lewis@y pt+\CF@lewis@yoffset*\CF@lewis@current@offset}%
\expandafter\draw\expandafter[\CF@lewis@style#3]%
@@ -1379,13 +1448,13 @@
(\CF@lewis@x pt-\CF@lewis@length*\CF@lewis@yoffset/2 pt+\CF@lewis@xoffset*\CF@lewis@widthdouble,\CF@lewis@y+\CF@lewis@length*\CF@lewis@xoffset/2 pt+\CF@lewis@yoffset*\CF@lewis@widthdouble)--
(\CF@lewis@x pt-\CF@lewis@length*\CF@lewis@yoffset/2 pt,\CF@lewis@y+\CF@lewis@length*\CF@lewis@xoffset/2 pt)--cycle;%
\else
- \if:\expandafter\@car\CF@lewis@remainpos\relax\@nil
- \edef\CF@lewis@remainpos{\expandafter\@gobble\CF@lewis@remainpos}%
+ \if:\expandafter\CF@firsttonil\CF@lewis@remainpos\relax\@nil
+ \edef\CF@lewis@remainpos{\expandafter\CF@gobarg\CF@lewis@remainpos}%
\pgfmathsetmacro\CF@lewis@x{\CF@lewis@x pt+\CF@lewis@xoffset*\CF@lewis@current@offset}%
\pgfmathsetmacro\CF@lewis@y{\CF@lewis@y pt+\CF@lewis@yoffset*\CF@lewis@current@offset}%
\CF@exp@after{\draw[fill,black,}{\CF@lewis@style#3]}%
- (\CF@lewis@x pt+\CF@lewis@dist*\CF@lewis@yoffset/2 pt,\CF@lewis@y-\CF@lewis@dist*\CF@lewis@xoffset/2 pt)circle(0.15ex)%
- (\CF@lewis@x pt-\CF@lewis@dist*\CF@lewis@yoffset/2 pt,\CF@lewis@y+\CF@lewis@dist*\CF@lewis@xoffset/2 pt)circle(0.15ex);%
+ (\CF@lewis@x pt+\CF@lewis@dist*\CF@lewis@yoffset/2 pt,\CF@lewis@y-\CF@lewis@dist*\CF@lewis@xoffset/2 pt)circle(\CF@lewis@radius)%
+ (\CF@lewis@x pt-\CF@lewis@dist*\CF@lewis@yoffset/2 pt,\CF@lewis@y+\CF@lewis@dist*\CF@lewis@xoffset/2 pt)circle(\CF@lewis@radius);%
\else
\pgfmathsetmacro\CF@lewis@x{\CF@lewis@x pt+\CF@lewis@xoffset*\CF@lewis@current@offset}%
\pgfmathsetmacro\CF@lewis@y{\CF@lewis@y pt+\CF@lewis@yoffset*\CF@lewis@current@offset}%
@@ -1400,16 +1469,13 @@
\endtikzpicture
}
-\CF@def\setstacksep#1{\edef\CF@stacksep{\CF@ifempty{#1}{1.5pt}{\the\dimexpr#1\relax}}}
-\setstacksep{1.5pt}
-
-\CF@def\Chembelow{\begingroup\let\CF@tmp@str\@gobble\CF@chembelow@a}
+\def\Chembelow{\begingroup\let\CF@tmp@str\CF@gobarg\CF@chembelow@a}
-\CF@def\chembelow{\begingroup\let\CF@tmp@str\@firstofone\CF@chembelow@a}
+\def\chembelow{\begingroup\let\CF@tmp@str\CF@id\CF@chembelow@a}
-\CF@def\CF@chembelow@a{\@testopt\CF@chembelow@b\CF@stacksep}
+\def\CF@chembelow@a{\CF@testopt\CF@chembelow@b\CF@stacksep}
-\CF@def\CF@chembelow@b[#1]#2#3{%
+\def\CF@chembelow@b[#1]#2#3{%
\setbox\CF@box@boxa\hbox{\printatom{#2}}%
\expandafter\vtop\CF@tmp@str{to\ht\CF@box@boxa}{%
\offinterlineskip
@@ -1421,13 +1487,13 @@
\endgroup
}
-\CF@def\Chemabove{\begingroup\let\CF@tmp@str\@gobble\CF@chemabove@a}
+\def\Chemabove{\begingroup\let\CF@tmp@str\CF@gobarg\CF@chemabove@a}
-\CF@def\chemabove{\begingroup\let\CF@tmp@str\@firstofone\CF@chemabove@a}
+\def\chemabove{\begingroup\let\CF@tmp@str\CF@id\CF@chemabove@a}
-\CF@def\CF@chemabove@a{\@testopt\CF@chemabove@b\CF@stacksep}
+\def\CF@chemabove@a{\CF@testopt\CF@chemabove@b\CF@stacksep}
-\CF@def\CF@chemabove@b[#1]#2#3{%
+\def\CF@chemabove@b[#1]#2#3{%
\setbox\CF@box@boxa\hbox{\printatom{#2}}%
\expandafter\vbox\CF@tmp@str{to\ht\CF@box@boxa}{%
\offinterlineskip
@@ -1439,9 +1505,9 @@
\endgroup
}
-\CF@def\chemmove{\@testopt\CF@chemmove{}}
+\def\chemmove{\CF@testopt\CF@chemmove{}}
-\CF@def\CF@chemmove[#1]#2{%
+\def\CF@chemmove[#1]#2{%
\CF@doifnotempty{#2}%
{\expandafter\tikzpicture\romannumeral\CF@ifempty{#1}%
{\z@[overlay,remember picture,-CF]}
@@ -1451,26 +1517,26 @@
}%
}
-\CF@def\chemnameinit#1{%
+\def\chemnameinit#1{%
\setbox\CF@stuff@box\hbox{#1}%
\xdef\CF@dp@max{\the\dp\CF@stuff@box}%
}
\let\CF@dp@max\z@
-\CF@def\CF@parse@molname#1\\#2\@nil{%
+\def\CF@parse@molname#1\\#2\@nil{%
\hbox to\CF@wd@stuffbox{\hss#1\hss}%
\CF@doifnotempty{#2}{\CF@parse@molname#2\@nil}%
}
-\CF@def\chemname{%
- \@ifstar
+\def\chemname{%
+ \CF@ifstar
{\CF@name@dp@adjustfalse\CF@chemname@a}
{\CF@name@dp@adjusttrue \CF@chemname@a}%
}
-\CF@def\CF@chemname@a{\@testopt\CF@chemname@b{1.5ex}}
+\def\CF@chemname@a{\CF@testopt\CF@chemname@b{1.5ex}}
-\CF@def\CF@chemname@b[#1]#2#3{%
+\def\CF@chemname@b[#1]#2#3{%
\setbox\CF@stuff@box\hbox{#2}%
\edef\CF@wd@stuffbox{\the\wd\CF@stuff@box}\edef\CF@dp@stuffbox{\the\dp\CF@stuff@box}%
\leavevmode
@@ -1483,61 +1549,16 @@
}%
}
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%% S C H E M A S R E A C T I O N N E L S %%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% S C H É M A S R É A C T I O N N E L S %%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\let\CF@scheme@nest\z@
-\newcount\CF@compound@cnt
-
-\newdimen\CF@arrow@size
-
-\newif\ifCF@name@start
-\newif\ifCF@name@end
-\newif\ifCF@reac@debug
+\def\CF@subscheme{\CF@testopt\CF@subscheme@a{}}
+\def\CF@subscheme@a[#1]{\CF@testopt{\CF@subscheme@b[#1]}{text}}
+\def\CF@subscheme@b[#1][#2]#3{\schemestart[#1][#2]#3\schemestop}
-\let\CF@scheme@nest\z@% ne PAS modifier cette ligne !
-
-\CF@def\CF@subscheme{\@testopt\CF@subscheme@a{}}
-\CF@def\CF@subscheme@a[#1]{\@testopt{\CF@subscheme@b[#1]}{text}}
-\CF@def\CF@subscheme@b[#1][#2]#3{\schemestart[#1][#2]#3\schemestop}
-
-\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}
-\setcompoundstyle{}
-
-\CF@def\CF@set@style#1,#2,#3\@nil#4#5#6{%
- \def#4{#1}%
- \CF@exp@second{\def#5}{#2}%
- \CF@expadd@tocs#6{#3}
- \CF@twoexp@second{\def#6}{\expandafter\CF@sanitize@lastitem#6,\@empty\@nil}%
-}
-
-\CF@def\setarrowdefault#1{%
- \def\CF@default@arrow@style{-CF,}% style minimal par d\'efaut
- \CF@set@style#1,\@empty,\@empty\@nil\CF@default@arrow@angle\CF@default@arrow@length\CF@default@arrow@style
- \CF@doifempty\CF@default@arrow@angle{\def\CF@default@arrow@angle{0}}%
- \CF@doifempty\CF@default@arrow@length{\def\CF@default@arrow@length{1}}%
-}
-\setarrowdefault{}% style de fl\`eche
-
-\CF@def\setarrowoffset#1{%
- \CF@ifempty{#1}{\def\CF@arrow@offset{1em}}{\def\CF@arrow@offset{#1}}%
-}%
-\setarrowoffset{}
-
-\CF@def\setcompoundsep#1{%
- \CF@ifempty{#1}{\def\CF@compound@sep{5em}}{\def\CF@compound@sep{#1}}%
-}
-\setcompoundsep{}
-
-\CF@def\setarrowlabelsep#1{%
- \CF@ifempty{#1}{\def\CF@arrow@labelsep{3pt}}{\def\CF@arrow@labelsep{#1}}%
-}
-\setarrowlabelsep{}
-
-\CF@def\chemleft#1#2\chemright#3{%
+\def\chemleft#1#2\chemright#3{%
\leavevmode
\begingroup
\setbox\z@\hbox{$\vcenter{\hbox{}}$}\edef\CF@delim@math@ht{\the\ht\z@}%
@@ -1548,11 +1569,11 @@
\endgroup
}
-\CF@def\chemright#1{%
- \immediate\write\CF@unused{Package \CF@package@name\space Warning: "\string\chemright\string#1"ignored! No \string\chemleft\space previously found.^^J}%
+\def\chemright#1{%
+ \immediate\write-1{Package \CFname\space Warning: "\string\chemright\string#1"ignored! No \string\chemleft\space previously found.^^J}%
}
-\CF@def\chemup#1#2\chemdown#3{%
+\def\chemup#1#2\chemdown#3{%
\begingroup
\setbox\z@\hbox{\printatom{#2}}\edef\CF@delim@dim{\the\dimexpr\wd\z@/\tw@}%
\tikzpicture[every node/.style={inner sep=\z@,outer sep=\z@,minimum size=\z@},baseline]%
@@ -1563,88 +1584,98 @@
\endgroup
}
-\CF@def\chemdown#1{%
- \immediate\write\CF@unused{Package \CF@package@name\space Warning: "\string\chemdown\string#1" ignored! No \string\chemup\space previously found.^^J}%
+\def\chemdown#1{%
+ \immediate\write-1{Package \CFname\space Warning: "\string\chemdown\string#1" ignored! No \string\chemup\space previously found.^^J}%
+}
+
+\def\CF@set@style#1,#2,#3\@nil#4#5#6{%
+ \def#4{#1}\let#5\empty\let#6\empty
+ \CF@if@firsttokmatch\CF@quark{#2\relax}
+ {}%
+ {\def#5{#2}%
+ \CF@if@firsttokmatch\CF@quark{#3\relax}
+ {}%
+ {\CF@set@style@a#3\@nil#6}%
+ }%
}
+\def\CF@set@style@a#1,\CF@quark#2\@nil#3{\def#3{#1}}
-\CF@def\CF@and{\futurelet\CF@toks@a\CF@and@a}
+\def\CF@and{\futurelet\CF@toks@a\CF@and@a}
-\CF@def\CF@and@a{%
+\def\CF@and@a{%
\CF@ifx\CF@toks@a\bgroup
\CF@and@b
{\CF@and@b{}}%
}
-\CF@def\CF@and@b#1{%
- \let\CF@sign@vshift\@empty
- \CF@set@style#1,\@empty,\@empty\@nil\CF@signspace@ante\CF@signspace@post\CF@sign@vshift
- \CF@doifempty\CF@signspace@ante{\let\CF@signspace@ante\CF@signspace@ante@default}%
- \CF@doifempty\CF@signspace@post{\let\CF@signspace@post\CF@signspace@post@default}%
- \CF@doifempty\CF@sign@vshift{\let\CF@sign@vshift\CF@sign@vshift@default}%
+\def\CF@and@b#1{%
+ \CF@set@style#1,\CF@quark,\CF@quark\@nil\CF@signspace@ante\CF@signspace@post\CF@sign@vshift
+ \CF@doifempty\CF@signspace@ante{\CF@valuetomacro\CF@signspace@ante[0.5em]{+ sep left}}%
+ \CF@doifempty\CF@signspace@post{\CF@valuetomacro\CF@signspace@post[0.5em]{+ sep right}}%
+ \CF@doifempty\CF@sign@vshift{\CF@valuetomacro\CF@sign@vshift[0pt]{+ vshift}}%
\raise\CF@sign@vshift\hbox{\kern\CF@signspace@ante$+$\kern\CF@signspace@post}%
}
-\CF@def\setandsign#1{%
- \let\CF@sign@vshift@default\@empty
- \CF@set@style#1,\@empty,\@empty\@nil\CF@signspace@ante@default\CF@signspace@post@default\CF@sign@vshift@default
- \CF@doifempty\CF@signspace@ante@default{\def\CF@signspace@ante@default{.5em}}%
- \CF@doifempty\CF@signspace@post@default{\def\CF@signspace@post@default{.5em}}%
- \CF@doifempty\CF@sign@vshift@default{\let\CF@sign@vshift@default\z@}%
-}
-\setandsign{}
-
-\CF@def\schemestart{%
+\def\schemestart{%
\xdef\CF@scheme@nest{\number\numexpr\CF@scheme@nest+\@ne}%
- \@testopt\CF@schemestart@a{}%
-}
-
-\CF@def\CF@schemestart@a[#1]{%
- \let\CF@arrow@style\@empty
- \CF@set@style#1,\@empty,\@empty\@nil\CF@arrow@angle\CF@arrow@length\CF@arrow@style
- \CF@doifempty\CF@arrow@angle{\let\CF@arrow@angle\CF@default@arrow@angle}%
- \CF@doifempty\CF@arrow@length{\let\CF@arrow@length\CF@default@arrow@length}%
- \CF@ifx\@empty\CF@arrow@style
+ \CF@testopt\CF@schemestart@a{}%
+}
+
+\def\CF@schemestart@a[#1]{%
+ \CF@valuetomacro\default@compound@style[]{compound style}%
+ \CF@set@style#1,\CF@quark,\CF@quark\@nil\CF@arrow@angle\CF@arrow@length\CF@arrow@style
+ \CF@doifempty\CF@arrow@angle{\CF@valuetomacro\CF@arrow@angle[0]{arrow angle}}%
+ \CF@doifempty\CF@arrow@length{\CF@valuetomacro\CF@arrow@length[1]{arrow coeff}}%
+ \CF@valuetomacro\CF@default@arrow@style[]{arrow style}%
+ \CF@valuetomacro\CF@arrow@offset[1em]{arrow offset}%
+ \CF@valuetomacro\CF@compound@sep[5em]{compound sep}%
+ \CF@valuetomacro\CF@arrow@labelsep[3pt]{arrow label sep}%
+ \CF@eexp@second{\CF@preadd@tocs\CF@default@arrow@style}{\useKV[chemfig]{arrow head},}%
+ \CF@ifx\empty\CF@arrow@style
{\let\CF@arrow@style\CF@default@arrow@style}
- {\CF@twoexp@second{\def\CF@arrow@style}{\expandafter\CF@default@arrow@style\expandafter,\CF@arrow@style}}% se rajoute apr\`es le style par d\'efaut
- \ifCF@reac@debug
- \tikzpicture[every node/.style={draw,anchor=base,inner sep=\z@,outer sep=\z@,minimum size=1.5pt},baseline,remember picture]%
- \else
- \tikzpicture[every node/.style={anchor=base,inner sep=\z@,outer sep=\z@,minimum size=\z@},baseline,remember picture]%
- \fi
+ {\CF@exp@second{\CF@preadd@tocs\CF@arrow@style}{\CF@default@arrow@style,}}% se rajoute après le style par défaut
+ \CF@valuetomacro\CF@arrow@double@sep[2pt]{arrow double sep}%
+ \pgfmathsetmacro\CF@arrow@double@sep{\CF@arrow@double@sep/2}%
+ \CF@valuetomacro\CF@arrow@double@pos@start[0.6]{arrow double coeff}%
+ \pgfmathsetmacro\CF@arrow@double@pos@start{(1-\CF@arrow@double@pos@start)/2}%
+ \pgfmathsetmacro\CF@arrow@double@pos@end{1-\CF@arrow@double@pos@start}%
+ \ifboolKV[chemfig]{scheme debug}
+ {\tikzpicture[every node/.style={draw,anchor=base,inner sep=\z@,outer sep=\z@,minimum size=1.5pt},baseline,remember picture]%
+ }
+ {\tikzpicture[every node/.style={anchor=base,inner sep=\z@,outer sep=\z@,minimum size=\z@},baseline,remember picture]%
+ }%
\let\merge\CF@merge
\expandafter\let\csname+\endcsname\CF@and
\let\arrow\CF@arrow
\let\schemestop\CF@schemestop
\let\subscheme\CF@subscheme
- \@testopt{\CF@schemestart@b[#1]}{text}%
+ \CF@testopt{\CF@schemestart@b[#1]}{text}%
}
-\CF@def\CF@schemestart@b[#1][#2]{%
- \ifnum\CF@scheme@nest=\@ne% la commande n'est pas imbriqu\'ee ?
+\def\CF@schemestart@b[#1][#2]{%
+ \ifnum\CF@scheme@nest=\@ne% la commande n'est pas imbriquée ?
\CF@compound@cnt\z@
\fi
\edef\CF@current@nodename{c\number\CF@compound@cnt}%
- \let\CF@next@nodename\@empty
- \let\CF@next@nodestyle\@empty
- \let\CF@direct@arrow@list\@empty
- \ifCF@reac@debug
- \node[fill,green](\CF@current@nodename){};%
- \else
- \node(\CF@current@nodename){};%
- \fi
+ \let\CF@next@nodename\empty
+ \let\CF@next@nodestyle\empty
+ \let\CF@direct@arrow@list\empty
+ \ifboolKV[chemfig]{scheme debug}
+ {\node[fill,green](\CF@current@nodename){};}
+ {\node(\CF@current@nodename){};}%
\def\CF@next@nodeanchor{#2}%
\CF@doifempty\CF@next@nodeanchor{\def\CF@next@nodeanchor{text}}%
- \let\CF@compound\@empty
+ \let\CF@compound\empty
\CF@schemestart@c
}
-\CF@def\CF@schemestart@c{%
+\def\CF@schemestart@c{%
\futurelet\CF@toks@a\CF@schemestart@e
}
-\expandafter\CF@def\expandafter\CF@schemestart@d\space{\futurelet\CF@toks@a\CF@schemestart@e}
+\expandafter\def\expandafter\CF@schemestart@d\space{\futurelet\CF@toks@a\CF@schemestart@e}
-\CF@def\CF@schemestart@e{% ... et l'examine :
+\def\CF@schemestart@e{% ... et l'examine :
\CF@if@firsttokin@a{\arrow\schemestop\merge}%
{}
{\CF@ifx\CF@toks@a\bgroup
@@ -1660,21 +1691,21 @@
}%
}
-\CF@def\CF@add@nextarg#1{\CF@add@tocs\CF@compound{{#1}}\CF@schemestart@c}
+\def\CF@add@nextarg#1{\CF@add@tocs\CF@compound{{#1}}\CF@schemestart@c}
-\CF@def\CF@display@compound#1#2{% #1 = nom et #2 = style
+\def\CF@display@compound#1#2{% #1 = nom et #2 = style
\CF@doifnotempty\CF@compound
{\global\advance\CF@compound@cnt\@ne
- \CF@ifx\CF@default@compound@style\@empty
- {\let\CF@current@nodestyle\@empty}
- {\CF@exp@second{\def\CF@current@nodestyle}{\CF@default@compound@style,}}%
+ \CF@ifx\default@compound@style\empty
+ {\let\CF@current@nodestyle\empty}
+ {\CF@exp@second{\def\CF@current@nodestyle}{\default@compound@style,}}%
\CF@add@tocs\CF@current@nodestyle{anchor=\CF@next@nodeanchor,at=(\CF@current@nodename)}%
\CF@ifempty{#2}%
{\CF@doifnotempty\CF@next@nodestyle
- {\CF@expadd@tocs\CF@current@nodestyle{\expandafter,\CF@next@nodestyle}}%
+ {\CF@eadd@tocs\CF@current@nodestyle{\expandafter,\CF@next@nodestyle}}%
}
{\CF@doifnotempty\CF@next@nodestyle
- {\immediate\write\CF@unused{Package \CF@package@name\space Warning: two styles for the same node, first style "\CF@next@nodestyle" ignored^^J}%
+ {\immediate\write-1{Package \CFname\space Warning: two styles for the same node, first style "\CF@next@nodestyle" ignored^^J}%
}%
\CF@add@tocs\CF@current@nodestyle{,#2}%
}%
@@ -1682,78 +1713,79 @@
{\edef\CF@tmp@str{\CF@ifempty\CF@next@nodename{c\number\CF@compound@cnt}{\CF@next@nodename}}%
}
{\CF@doifnotempty\CF@next@nodename
- {\immediate\write\CF@unused{Package \CF@package@name\space Warning: two names for the same node, first name "\CF@next@nodename" ignored^^J}%
+ {\immediate\write-1{Package \CFname\space Warning: two names for the same node, first name "\CF@next@nodename" ignored^^J}%
}%
\edef\CF@tmp@str{#1}%
}%
\expandafter\node\expandafter[\CF@current@nodestyle](\CF@tmp@str){\CF@compound};%
- \ifCF@reac@debug
- \node[draw=none,anchor=270,at=(\CF@tmp@str.90),fill=green!60,overlay,opacity=0.5]{\scriptsize\bfseries\CF@tmp@str};%
- \fi
+ \ifboolKV[chemfig]{scheme debug}%
+ {\node[draw=none,anchor=270,at=(\CF@tmp@str.90),fill=green!60,overlay,opacity=0.5]{\scriptsize\bfseries\CF@tmp@str};%
+ }
+ {}%
\let\CF@current@nodename\CF@tmp@str
}%
}
-\CF@def\CF@schemestop{%
+\def\CF@schemestop{%
\CF@display@compound{}{}%
\CF@direct@arrow@list
\endtikzpicture
\xdef\CF@scheme@nest{\number\numexpr\CF@scheme@nest-\@ne}%
}
-\CF@def\CF@analyse@arrowarg#1{\CF@analyse@arrowarg@i#1[]\@nil}
+\def\CF@analyse@arrowarg#1{\CF@analyse@arrowarg@i#1[]\@nil}
-\CF@def\CF@analyse@arrowarg@i#1[#2]#3\@nil{%
+\def\CF@analyse@arrowarg@i#1[#2]#3\@nil{%
\CF@if@instr{#1}.{\CF@add@tocs\CF@tmp@str{#1[#2]}}{\CF@add@tocs\CF@tmp@str{#1.[#2]}}%
}
-\CF@def\CF@arrow{%
- \@ifnextchar(%
+\def\CF@arrow{%
+ \CF@ifnextchar(%
\CF@arrow@a
- {\@ifnextchar\bgroup{\CF@arrow@b(.[]--.[])}{\CF@arrow@b(.[]--.[]){}}}%
+ {\CF@ifnextchar\bgroup{\CF@arrow@b(.[]--.[])}{\CF@arrow@b(.[]--.[]){}}}%
}
-\CF@def\CF@arrow@a(#1--#2){%
+\def\CF@arrow@a(#1--#2){%
\def\CF@tmp@str{(}%
\CF@analyse@arrowarg{#1}%
\CF@add@tocs\CF@tmp@str{--}%
\CF@analyse@arrowarg{#2}%
\CF@add@tocs\CF@tmp@str)%
- \@ifnextchar\bgroup{\expandafter\CF@arrow@b\CF@tmp@str}{\expandafter\CF@arrow@b\CF@tmp@str{}}%
+ \CF@ifnextchar\bgroup{\expandafter\CF@arrow@b\CF@tmp@str}{\expandafter\CF@arrow@b\CF@tmp@str{}}%
}
-\CF@def\CF@arrow@b(#1.#2[#3]--#4.#5[#6])#7{%
- \def\CF@current@arrowtype{#7}% nom de la fl\`eche
+\def\CF@arrow@b(#1.#2[#3]--#4.#5[#6])#7{%
+ \def\CF@current@arrowtype{#7}% nom de la flèche
\CF@doifempty\CF@current@arrowtype{\def\CF@current@arrowtype{->}}%
- \@testopt{\CF@arrow@c(#1.#2[#3]--#4.#5[#6])}{}%
+ \CF@testopt{\CF@arrow@c(#1.#2[#3]--#4.#5[#6])}{}%
}
-\CF@def\CF@arrow@c(#1.#2[#3]--#4.#5[#6])[#7]{%
+\def\CF@arrow@c(#1.#2[#3]--#4.#5[#6])[#7]{%
\def\CF@tmp@str{\CF@arrow@e(#1.#2[#3]--#4.#5[#6])}%
- \CF@arrow@d#7,\@empty,\@empty\@nil
+ \CF@arrow@d#7,\empty,\empty\@nil
}
-\CF@def\CF@arrow@d#1,#2,#3\@nil{%
+\def\CF@arrow@d#1,#2,#3\@nil{%
\CF@add@tocs\CF@tmp@str{{#1}}%
- \CF@expadd@tocs\CF@tmp@str{\expandafter{#2}}%
- \expandafter\CF@expadd@tocs\expandafter\CF@tmp@str\expandafter{\expandafter\expandafter\expandafter{\expandafter\CF@sanitize@lastitem#3,\@empty\@nil}}%
+ \CF@eadd@tocs\CF@tmp@str{\expandafter{#2}}%
+ \expandafter\CF@eadd@tocs\expandafter\CF@tmp@str\expandafter{\expandafter\expandafter\expandafter{\expandafter\CF@sanitize@lastitem#3,\empty\@nil}}%
\CF@tmp@str
}
% #1, #4 : nom des nodes #2, #5 : ancres des nodes #3, #6 : styles des nodes
-% #7 : angle fl\`eche #8 : longueur fl\`eche #9 : style tikz de la fl\`eche
-\CF@def\CF@arrow@e(#1.#2[#3]--#4.#5[#6])#7#8#9{%
+% #7 : angle flèche #8 : longueur flèche #9 : style tikz de la flèche
+\def\CF@arrow@e(#1.#2[#3]--#4.#5[#6])#7#8#9{%
\let\CF@arrow@current@style\CF@arrow@style
- \if\CF@arobas\expandafter\@car\detokenize{#1.}\@nil% si #1 commence par @
- \if\CF@arobas\expandafter\@car\detokenize{#4.}\@nil
- \CF@expadd@tocs\CF@direct@arrow@list{\expandafter\CF@direct@arrow\expandafter{\CF@current@arrowtype}{#1}{#2}{#4}{#5}{#9}}%
+ \if\CF@arobas\expandafter\CF@firsttonil\detokenize{#1.}\@nil% si #1 commence par @
+ \if\CF@arobas\expandafter\CF@firsttonil\detokenize{#4.}\@nil
+ \CF@eadd@tocs\CF@direct@arrow@list{\expandafter\CF@direct@arrow\expandafter{\CF@current@arrowtype}{#1}{#2}{#4}{#5}{#9}}%
\let\CF@next@action\CF@schemestart@c
\else
\CF@doifnotempty\CF@arrow@current@style{\CF@add@tocs\CF@arrow@current@style,}%
\CF@doifnotempty{#9}{\CF@add@tocs\CF@arrow@current@style{#9,}}%
\CF@display@compound{}{#3}%
\def\CF@next@nodename{#4}%
- \CF@exp@second{\def\CF@current@nodename}{\@gobble#1}%
+ \CF@exp@second{\def\CF@current@nodename}{\CF@gobarg#1}%
\let\CF@arrow@start@name\CF@current@nodename
\let\CF@arrow@end@name\CF@next@nodename
\CF@arrow@f{#7}{#8}{#2}{#5}%
@@ -1762,8 +1794,8 @@
\else
\CF@doifnotempty\CF@arrow@current@style{\CF@add@tocs\CF@arrow@current@style,}%
\CF@doifnotempty{#9}{\CF@add@tocs\CF@arrow@current@style{#9,}}%
- \if\CF@arobas\expandafter\@car\detokenize{#2.}\@nil
- \errmessage{Package \CF@package@name\space Error: syntax "(<name>--@<name>)" is not allowed}%
+ \if\CF@arobas\expandafter\CF@firsttonil\detokenize{#2.}\@nil
+ \errmessage{Package \CFname\space Error: syntax "(<name>--@<name>)" is not allowed}%
\else
\CF@display@compound{#1}{#3}%
\edef\CF@arrow@start@name{\CF@ifempty{#1}\CF@current@nodename{#1}\CF@doifnotempty{#2}{.#2}}%
@@ -1772,12 +1804,12 @@
\def\CF@next@nodestyle{#6}%
\fi
\fi
- \CF@arrow@gobspaces% mange les espaces puis ex\'ecute \CF@next@action
+ \CF@arrow@gobspaces% mange les espaces puis exécute \CF@next@action
}
-\CF@def\CF@arrow@gobspaces{\futurelet\CF@toks@a\CF@arrow@gobspaces@a}
+\def\CF@arrow@gobspaces{\futurelet\CF@toks@a\CF@arrow@gobspaces@a}
-\CF@def\CF@arrow@gobspaces@a{%
+\def\CF@arrow@gobspaces@a{%
\CF@ifx\@sptoken\CF@toks@a
\CF@arrow@gobspaces@b
\CF@next@action
@@ -1785,19 +1817,19 @@
\expandafter\def\expandafter\CF@arrow@gobspaces@b\space{\futurelet\CF@toks@a\CF@arrow@gobspaces@a}
-\CF@def\CF@arrow@f#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@c}%
+\def\CF@arrow@f#1#2#3#4{% #1=angle #2=longueur #3=ancre départ #4=ancre arrivée
+ \def\CF@next@action{\let\CF@compound\empty\CF@schemestart@c}%
\def\CF@arrow@current@angle{#1}\CF@doifempty\CF@arrow@current@angle{\let\CF@arrow@current@angle\CF@arrow@angle}%
\def\CF@current@arrow@length{#2}\CF@doifempty\CF@current@arrow@length{\let\CF@current@arrow@length\CF@arrow@length}%
\node[at=(\CF@current@nodename.\CF@ifempty{#3}\CF@arrow@current@angle{#3}),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\CF@doifnotempty{#4}{.#4}}%
- \ifCF@reac@debug
- \node[at=(\CF@current@nodename.\CF@ifempty{#3}\CF@arrow@current@angle{#3}),shift=(\CF@arrow@current@angle:\CF@arrow@offset),red,fill](start@arrow){};%
+ \ifboolKV[chemfig]{scheme debug}
+ {\node[at=(\CF@current@nodename.\CF@ifempty{#3}\CF@arrow@current@angle{#3}),shift=(\CF@arrow@current@angle:\CF@arrow@offset),red,fill](start@arrow){};%
\node[at=(\CF@current@nodename.\CF@ifempty{#3}\CF@arrow@current@angle{#3}),shift=(\CF@arrow@current@angle:\CF@current@arrow@length*\CF@compound@sep-\CF@arrow@offset),red,fill](end@arrow){};%
- \else
- \node[at=(\CF@current@nodename.\CF@ifempty{#3}\CF@arrow@current@angle{#3}),shift=(\CF@arrow@current@angle:\CF@arrow@offset)](start@arrow){};%
+ }
+ {\node[at=(\CF@current@nodename.\CF@ifempty{#3}\CF@arrow@current@angle{#3}),shift=(\CF@arrow@current@angle:\CF@arrow@offset)](start@arrow){};%
\node[at=(\CF@current@nodename.\CF@ifempty{#3}\CF@arrow@current@angle{#3}),shift=(\CF@arrow@current@angle:\CF@current@arrow@length*\CF@compound@sep-\CF@arrow@offset)](end@arrow){};%
- \fi
+ }%
\def\CF@arrow@start@node{start@arrow}\def\CF@arrow@end@node{end@arrow}%
\csname\expandafter\CF@grab@arrow@name\CF@current@arrowtype[\@nil\CF@three@ea\endcsname
\expandafter\CF@grab@arrow@args\CF@current@arrowtype[]\@nil[][][][][][][][]\@nil
@@ -1805,26 +1837,26 @@
\edef\CF@next@nodeanchor{\CF@ifempty{#4}{180+\CF@arrow@current@angle}{#4}}%
}
-% 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
-\CF@def\CF@direct@arrow#1#2#3#4#5#6{%
- \CF@exp@second{\def\CF@arrow@start@name}{\@gobble#2}%
- \CF@exp@second{\def\CF@arrow@end@name}{\@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)%
+% trace un flèche initiée par (@nom--@nom)
+% #1=type de flèche #2=nom depart #3=ancre départ #4=nom arrivée #5=ancre arrivée #6=style flèche
+\def\CF@direct@arrow#1#2#3#4#5#6{%
+ \CF@exp@second{\def\CF@arrow@start@name}{\CF@gobarg#2}%
+ \CF@exp@second{\def\CF@arrow@end@name}{\CF@gobarg#4}%
+ \path[sloped,allow upside down](\CF@gobarg#2\ifx\empty#3\empty\else.#3\fi)--(\CF@gobarg#4\ifx\empty#5\empty\else.#5\fi)%
coordinate[pos=0,xshift=\CF@arrow@offset](start@direct@arrow)%
coordinate[pos=1,xshift=-\CF@arrow@offset](end@direct@arrow);%
\def\CF@arrow@start@node{start@direct@arrow}%
\def\CF@arrow@end@node{end@direct@arrow}%
\pgfmathanglebetweenpoints
- {\pgfpointanchor{\@gobble#2}{\ifx\@empty#3\@empty center\else#3\fi}}% Ne pas utiliser \CF@ifempty ici !!!
- {\pgfpointanchor{\@gobble#4}{\ifx\@empty#5\@empty center\else#5\fi}}%
+ {\pgfpointanchor{\CF@gobarg#2}{\ifx\empty#3\empty center\else#3\fi}}% Ne pas utiliser \CF@ifempty ici !!!
+ {\pgfpointanchor{\CF@gobarg#4}{\ifx\empty#5\empty center\else#5\fi}}%
\let\CF@arrow@current@angle\pgfmathresult
\CF@doifnotempty{#6}{\CF@add@tocs\CF@arrow@current@style{#6,}}%
\csname\CF@grab@arrow@name#1[]\@nil\expandafter\endcsname\CF@grab@arrow@args#1[]\@nil[][][][][][][][]\@nil
}
-\CF@def\CF@merge@grab@chardir#1[#2][#3]#4\@nil{%
- \expandafter\futurelet\expandafter\CF@toks@a\expandafter\CF@gobtonil\@car#1>\@nil\@nil
+\def\CF@merge@grab@chardir#1[#2][#3]#4\@nil{%
+ \expandafter\futurelet\expandafter\CF@toks@a\expandafter\CF@gobtonil\CF@firsttonil#1>\@nil\@nil
\ifx>\CF@toks@a\def\CF@merge@angle{0}\def\CF@merge@extreme{xmax}\def\CF@merge@sign{+}\else
\ifx<\CF@toks@a\def\CF@merge@angle{180}\def\CF@merge@extreme{xmin}\def\CF@merge@sign{-}\else
\ifx^\CF@toks@a\def\CF@merge@angle{90}\def\CF@merge@extreme{ymax}\def\CF@merge@sign{+}\else
@@ -1833,23 +1865,23 @@
\def\CF@merge@labelup{#2}\def\CF@merge@labeldo{#3}%
}
-\CF@def\CF@merge#1({%
+\def\CF@merge#1({%
\CF@merge@grab@chardir#1[][]\@nil
\CF@merge@a(%
}
-\CF@def\CF@merge@a#1--(#2){\@testopt{\CF@merge@b#1--(#2)}{}}
+\def\CF@merge@a#1--(#2){\CF@testopt{\CF@merge@b#1--(#2)}{}}
-\CF@def\CF@merge@b#1--(#2)[#3]{%
+\def\CF@merge@b#1--(#2)[#3]{%
\CF@display@compound{}{}%
- \CF@parse@mergeopt#3,\@empty,\@empty,\@empty\@nil
+ \CF@parse@mergeopt#3,\CF@quark,\CF@quark,\CF@quark\@nil
\def\CF@merge@xmax{-16383.99999pt}\let\CF@merge@ymax\CF@merge@xmax
\def\CF@merge@xmin{16383.99999pt}\let\CF@merge@ymin\CF@merge@xmin
\CF@merge@parse@nodelist#1(\relax)% calcule les maxi des positions
\pgfmathsetmacro\CF@merge@extreme@result{\csname CF@merge@\CF@merge@extreme\endcsname\CF@merge@sign\CF@merge@fromcoeff*\CF@compound@sep}%
- \CF@merge@c#1(\relax)% trace les lignes entre les noeuds pr\'ec\'edents et la ligne de jonction
+ \CF@merge@c#1(\relax)% trace les lignes entre les noeuds précédents et la ligne de jonction
\CF@exp@second{\def\CF@tmp@str}{\expandafter[\CF@merge@style,shorten <=0,shorten >=0,-]}%
- \if x\expandafter\@car\CF@merge@extreme\@nil
+ \if x\expandafter\CF@firsttonil\CF@merge@extreme\@nil
\CF@add@tocs\CF@tmp@str{(\CF@merge@extreme@result pt,\CF@merge@ymax)--(\CF@merge@extreme@result pt,\CF@merge@ymin)}%
\else
\CF@add@tocs\CF@tmp@str{(\CF@merge@xmin,\CF@merge@extreme@result pt)--(\CF@merge@xmax,\CF@merge@extreme@result pt)}%
@@ -1861,18 +1893,18 @@
\expandafter\draw\expandafter[\CF@merge@style,shorten <=0](merge@point)--(end@merge)%
\expandafter\CF@arrow@display@label@a\expandafter{\CF@merge@labelup}{.5}+\expandafter\CF@arrow@display@label@a\expandafter{\CF@merge@labeldo}{.5}-;%
\def\CF@current@nodename{end@merge@i}%
- \let\CF@tmp@str\@empty
+ \let\CF@tmp@str\empty
\CF@analyse@arrowarg{#2}%
\expandafter\CF@merge@d\CF@tmp@str\@nil
}
-\CF@def\CF@merge@c(#1){%
- \if\relax\expandafter\noexpand\@car#1\@nil
+\def\CF@merge@c(#1){%
+ \if\relax\expandafter\noexpand\CF@firsttonil#1\@nil
\else
\CF@if@stop{#1}%
{\edef\merge@current@nodename{\CF@before@stop#1\@nil}\edef\merge@current@anchor{\CF@after@stop#1\@nil}}%
{\def\merge@current@nodename{#1}\let\merge@current@anchor\CF@merge@angle}%
- \if x\expandafter\@car\CF@merge@extreme\@nil
+ \if x\expandafter\CF@firsttonil\CF@merge@extreme\@nil
\pgfextracty\CF@dim{\pgfpointanchor\merge@current@nodename\merge@current@anchor}%
\expandafter\draw\expandafter[\CF@merge@style,shorten >=0,-]([shift=(\CF@merge@angle:\CF@arrow@offset)]\merge@current@nodename.\merge@current@anchor)--(\CF@merge@extreme@result pt,\CF@dim);%
\else
@@ -1883,24 +1915,38 @@
\fi
}
-\CF@def\CF@merge@d#1.#2[#3]\@nil{%
+\def\CF@merge@d#1.#2[#3]\@nil{%
\def\CF@next@nodename{#1}%
\edef\CF@next@nodeanchor{\CF@ifempty{#2}{180+\CF@merge@angle}{#2}}%
\def\CF@next@nodestyle{#3}%
- \let\CF@compound\@empty
+ \let\CF@compound\empty
\CF@schemestart@c
}
-\CF@def\CF@parse@mergeopt#1,#2,#3,#4\@nil{%
+\def\CF@parse@mergeopt#1,#2,#3,#4\@nil{%
\CF@ifempty{#1}{\def\CF@merge@fromcoeff{0.5}}{\def\CF@merge@fromcoeff{#1}}%
- \CF@exp@second{\def\CF@merge@tocoeff}{#2}\CF@doifempty\CF@merge@tocoeff{\def\CF@merge@tocoeff{0.5}}%
- \CF@exp@second{\def\CF@merge@splitcoeff}{#3}\CF@doifempty\CF@merge@splitcoeff{\def\CF@merge@splitcoeff{0.5}}%
- \def\CF@merge@style{-CF}\CF@doifnotempty{#4}{\CF@expadd@tocs\CF@merge@style{\expandafter,#4}}%
- \CF@twoexp@second{\def\CF@merge@style}{\expandafter\CF@sanitize@lastitem\CF@merge@style,\@empty\@nil}%
+ \def\CF@merge@tocoeff{0.5}%
+ \def\CF@merge@splitcoeff{0.5}%
+ \CF@eexp@second{\def\CF@merge@style}{\useKV[chemfig]{arrow head}}%
+ \CF@if@firsttokmatch\CF@quark{#2\relax}
+ {}
+ {\CF@ifempty{#2}{\def\CF@merge@tocoeff{0.5}}{\def\CF@merge@tocoeff{#2}}%
+ \CF@if@firsttokmatch\CF@quark{#3\relax}
+ {}
+ {\CF@ifempty{#3}{\def\CF@merge@splitcoeff{0.5}}{\def\CF@merge@splitcoeff{#3}}%
+ \CF@if@firsttokmatch\CF@quark{#4\relax}
+ {}
+ {\CF@parse@mergeopt@i#4\@nil}%
+ }%
+ }%
}
-\CF@def\CF@merge@parse@nodelist(#1){%
- \if\relax\expandafter\noexpand\@car#1\@nil
+\def\CF@parse@mergeopt@i#1,\CF@quark#2\@nil{%
+ \CF@ifempty{#1}{}{\CF@add@tocs\CF@merge@style{,#1}}%
+}
+
+\def\CF@merge@parse@nodelist(#1){%
+ \if\relax\expandafter\noexpand\CF@firsttonil#1\@nil
\else
\CF@if@stop{#1}%
{\edef\merge@current@nodename{\CF@before@stop#1\@nil}\edef\merge@current@anchor{\CF@after@stop#1\@nil}}%
@@ -1915,16 +1961,16 @@
\fi
}
-\CF@def\CF@grab@arrow@name#1[#2\@nil{\detokenize{CF@arrow(#1)}}
-\CF@def\CF@grab@arrow@args#1[#2\@nil{[#2}
+\def\CF@grab@arrow@name#1[#2\@nil{\detokenize{CF@arrow(#1)}}
+\def\CF@grab@arrow@args#1[#2\@nil{[#2}
-\CF@def\CF@make@parameter@text#1{%
+\def\CF@make@parameter@text#1{%
\toks\z@{}%
\CF@cnt@groupnumber#1\relax
\CF@make@parameter@text@a1%
}
-\CF@def\CF@make@parameter@text@a#1{%
+\def\CF@make@parameter@text@a#1{%
\unless\ifnum#1>\CF@cnt@groupnumber
\toks\z@\expandafter{\the\toks\z@[###1]}%
\expandafter\CF@make@parameter@text@a\expandafter{\number\numexpr#1+1\expandafter}%
@@ -1932,51 +1978,51 @@
}
% #1 est le nombre d'arguments optionnels, #2 est le nom et #3 le code
-\CF@def\definearrow#1#2#3{%
+\def\definearrow#1#2#3{%
\begingroup
\CF@make@parameter@text{#1}%
\expandafter\endgroup
\expandafter\def\csname\detokenize{CF@arrow(#2)}\expandafter\endcsname\the\toks\z@{#3\CF@gobtonil}%
}
-\CF@def\CF@if@stop#1{\CF@if@stop@a#1.\@nil}
-\CF@def\CF@if@stop@a#1.#2\@nil{\ifx\@empty#2\@empty\expandafter\@secondoftwo\else\expandafter\@firstoftwo\fi}
-\CF@def\CF@before@stop#1.#2\@nil{#1}
-\CF@def\CF@after@stop#1.#2\@nil{#2}
+\def\CF@if@stop#1{\CF@if@stop@a#1.\@nil}
+\def\CF@if@stop@a#1.#2\@nil{\ifx\empty#2\empty\expandafter\CF@execsecond\else\expandafter\CF@execfirst\fi}
+\def\CF@before@stop#1.#2\@nil{#1}
+\def\CF@after@stop#1.#2\@nil{#2}
-\CF@def\CF@rotate@node*#1#2\@nil{\CF@if@stop{#1}{\CF@before@stop#1\@nil}{#1}}
-\CF@def\CF@anchor@node*#1#2\@nil#3{\CF@if@stop{#1}{\CF@after@stop#1\@nil}{\CF@arrow@current@angle-#390-#1}}
+\def\CF@rotate@node*#1#2\@nil{\CF@if@stop{#1}{\CF@before@stop#1\@nil}{#1}}
+\def\CF@anchor@node*#1#2\@nil#3{\CF@if@stop{#1}{\CF@after@stop#1\@nil}{\CF@arrow@current@angle-#390-#1}}
-% #1 = label #2 = position #3 = + ou - (au dessus ou au dessous) #4 : nom du noeud de d\'epart
+% #1 = label #2 = position #3 = + ou - (au dessus ou au dessous) #4 : nom du noeud de départ
% #5 = label #6 = position #7 = + ou - (au dessus ou au dessous) #8 : nom du noeud de fin
-\CF@def\CF@arrow@display@label#1#2#3#4#5#6#7#8{%
+\def\CF@arrow@display@label#1#2#3#4#5#6#7#8{%
\CF@doifnotempty{#1#5}
{\path(#4)--(#8)\CF@arrow@display@label@a{#1}{#2}{#3}\CF@arrow@display@label@a{#5}{#6}{#7};}%
}
-\CF@def\CF@arrow@display@label@a#1#2#3{%
+\def\CF@arrow@display@label@a#1#2#3{%
\CF@doifnotempty{#1}
- {\if*\expandafter\@car\detokenize{#1}\@nil
- \ifCF@reac@debug
- node[pos=#2,sloped,yshift=#3\CF@arrow@labelsep,draw,fill,cyan](shifted@node){}%
- node[draw,rotate=\CF@rotate@node#1\@nil,anchor=\CF@anchor@node#1\@nil#3,at=(shifted@node)]{\expandafter\@gobble\@gobble#1}%
- \else
- node[pos=#2,sloped,yshift=#3\CF@arrow@labelsep](shifted@node){}%
- node[rotate=\CF@rotate@node#1\@nil,anchor=\CF@anchor@node#1\@nil#3,at=(shifted@node)]{\expandafter\@gobble\@gobble#1}%
- \fi
+ {\if*\expandafter\CF@firsttonil\detokenize{#1}\@nil
+ \ifboolKV[chemfig]{scheme debug}
+ {node[pos=#2,sloped,yshift=#3\CF@arrow@labelsep,draw,fill,cyan](shifted@node){}%
+ node[draw,rotate=\CF@rotate@node#1\@nil,anchor=\CF@anchor@node#1\@nil#3,at=(shifted@node)]{\expandafter\CF@gobarg\CF@gobarg#1}%
+ }
+ {node[pos=#2,sloped,yshift=#3\CF@arrow@labelsep](shifted@node){}%
+ node[rotate=\CF@rotate@node#1\@nil,anchor=\CF@anchor@node#1\@nil#3,at=(shifted@node)]{\expandafter\CF@gobarg\CF@gobarg#1}%
+ }%
\else
- \ifCF@reac@debug
- node[pos=#2,sloped,yshift=#3\CF@arrow@labelsep,draw,fill,cyan](shifted@node){}%
+ \ifboolKV[chemfig]{scheme debug}
+ {node[pos=#2,sloped,yshift=#3\CF@arrow@labelsep,draw,fill,cyan](shifted@node){}%
node[draw,pos=#2,anchor=-#390,sloped,yshift=#3\CF@arrow@labelsep]{#1}%
- \else
- node[pos=#2,anchor=-#390,sloped,yshift=#3\CF@arrow@labelsep]{#1}%
- \fi
+ }
+ {node[pos=#2,anchor=-#390,sloped,yshift=#3\CF@arrow@labelsep]{#1}%
+ }
\fi
}%
}
-% pose des noeuds d\'ecal\'es de la dimension #1 \`a (\CF@arrow@start@node) et (\CF@arrow@end@node)
-\CF@def\CF@arrow@shift@nodes#1{%
+% pose des noeuds décalés de la dimension #1 à (\CF@arrow@start@node) et (\CF@arrow@end@node)
+\def\CF@arrow@shift@nodes#1{%
\unless\ifdim\CF@ifempty{#1}\z@{#1}=\z@
\edef\CF@tmp@str{%
\noexpand\path(\CF@arrow@start@node)--(\CF@arrow@end@node)%
@@ -2024,12 +2070,12 @@
\definearrow3{<=>}{%
\CF@arrow@shift@nodes{#3}%
\path[allow upside down](\CF@arrow@start@node)--(\CF@arrow@end@node)%
- node[pos=0,sloped,yshift=1pt](\CF@arrow@start@node @u0){}%
- node[pos=0,sloped,yshift=-1pt](\CF@arrow@start@node @d0){}%
- node[pos=1,sloped,yshift=1pt](\CF@arrow@start@node @u1){}%
- node[pos=1,sloped,yshift=-1pt](\CF@arrow@start@node @d1){};%
+ node[pos=0,sloped,yshift=\CF@arrow@double@sep](\CF@arrow@start@node @u0){}%
+ node[pos=0,sloped,yshift=-\CF@arrow@double@sep](\CF@arrow@start@node @d0){}%
+ node[pos=1,sloped,yshift=\CF@arrow@double@sep](\CF@arrow@start@node @u1){}%
+ node[pos=1,sloped,yshift=-\CF@arrow@double@sep](\CF@arrow@start@node @d1){};%
\begingroup
- \pgfarrowharpoontrue
+ \ifboolKV[chemfig]{arrow double harpoon}{\pgfarrowharpoontrue}{}%
\expandafter\draw\expandafter[\CF@arrow@current@style](\CF@arrow@start@node @u0)--(\CF@arrow@start@node @u1);%
\expandafter\draw\expandafter[\CF@arrow@current@style](\CF@arrow@start@node @d1)--(\CF@arrow@start@node @d0);%
\endgroup
@@ -2040,11 +2086,11 @@
\CF@arrow@shift@nodes{#3}%
\path[allow upside down](\CF@arrow@start@node)--(\CF@arrow@end@node)%
node[pos=0,sloped,yshift=1pt](\CF@arrow@start@node @u0){}%
- node[pos=0.2,sloped,yshift=-1pt](\CF@arrow@start@node @d0){}%
+ node[pos=\CF@arrow@double@pos@start,sloped,yshift=-1pt](\CF@arrow@start@node @d0){}%
node[pos=1,sloped,yshift=1pt](\CF@arrow@start@node @u1){}%
- node[pos=0.8,sloped,yshift=-1pt](\CF@arrow@start@node @d1){};%
+ node[pos=\CF@arrow@double@pos@end,sloped,yshift=-1pt](\CF@arrow@start@node @d1){};%
\begingroup
- \pgfarrowharpoontrue
+ \ifboolKV[chemfig]{arrow double harpoon}{\pgfarrowharpoontrue}{}%
\expandafter\draw\expandafter[\CF@arrow@current@style](\CF@arrow@start@node @u0)--(\CF@arrow@start@node @u1);%
\expandafter\draw\expandafter[\CF@arrow@current@style](\CF@arrow@start@node @d1)--(\CF@arrow@start@node @d0);%
\endgroup
@@ -2053,12 +2099,12 @@
\definearrow3{<<->}{%
\path[allow upside down](\CF@arrow@start@node)--(\CF@arrow@end@node)%
- node[pos=0.2,sloped,yshift=1pt](\CF@arrow@start@node @u0){}%
+ node[pos=\CF@arrow@double@pos@start,sloped,yshift=1pt](\CF@arrow@start@node @u0){}%
node[pos=0,sloped,yshift=-1pt](\CF@arrow@start@node @d0){}%
- node[pos=0.8,sloped,yshift=1pt](\CF@arrow@start@node @u1){}%
+ node[pos=\CF@arrow@double@pos@end,sloped,yshift=1pt](\CF@arrow@start@node @u1){}%
node[pos=1,sloped,yshift=-1pt](\CF@arrow@start@node @d1){};%
\begingroup
- \pgfarrowharpoontrue
+ \ifboolKV[chemfig]{arrow double harpoon}{\pgfarrowharpoontrue}{}%
\expandafter\draw\expandafter[\CF@arrow@current@style](\CF@arrow@start@node @u0)--(\CF@arrow@start@node @u1);%
\expandafter\draw\expandafter[\CF@arrow@current@style](\CF@arrow@start@node @d1)--(\CF@arrow@start@node @d0);%
\endgroup
@@ -2215,227 +2261,287 @@
}%
}
-\chemfigrestorecatcode
+\def\CF@grab@delim#1#2#3\@nil{\def\CF@left@delim{#1}\def\CF@right@delim{#2}}
+\def\polymerdelim[#1]#2#3{%
+ \setKVdefault[CFdelimiters]
+ {delimiters =(),
+ height =10pt,
+ depth ={},
+ open xshift =0pt,
+ close xshift =0pt,
+ indice =n,
+ }%
+ \setKV[CFdelimiters]{#1}%
+ \expandafter\expandafter\expandafter\CF@grab@delim\useKV[CFdelimiters]{delimiters}()\@nil
+ \edef\CF@delim@height{\the\dimexpr\useKV[CFdelimiters]{height}}%
+ \CF@eexp@macroarg\CF@ifempty{\useKV[CFdelimiters]{depth}}
+ {\let\CF@delim@depth\CF@delim@height}
+ {\edef\CF@delim@depth{\useKV[CFdelimiters]{depth}}}%
+ \edef\CF@delim@halfdim{\the\dimexpr(\CF@delim@height+\CF@delim@depth)/2}%
+ \edef\CF@delim@vshift {\the\dimexpr(\CF@delim@height-\CF@delim@depth)/2}%
+ \edef\CF@leftdelim@xshift {\the\dimexpr\useKV[CFdelimiters]{open xshift}}%
+ \edef\CF@rightdelim@xshift{\the\dimexpr\useKV[CFdelimiters]{close xshift}}%
+ \chemmove{%
+ \nulldelimiterspace0pt
+ \pgfextractx\CF@dim{\pgfpointanchor{#2}{center}}\edef\CF@leftdelim@x{\the\CF@dim}%
+ \pgfextracty\CF@dim{\pgfpointanchor{#2}{center}}\edef\CF@leftdelim@y{\the\CF@dim}%
+ \pgfextractx\CF@dim{\pgfpointanchor{#3}{center}}\edef\CF@rightdelim@x{\the\CF@dim}%
+ \node[at={(\CF@leftdelim@x+\CF@leftdelim@xshift,\CF@leftdelim@y+\CF@delim@vshift)}]
+ {$\left\CF@left@delim\vrule height\CF@delim@halfdim depth\CF@delim@halfdim width0pt\right.$};%
+ \node[at={(\CF@rightdelim@x+\CF@rightdelim@xshift,\CF@leftdelim@y+\CF@delim@vshift)}]
+ {$\left.\vrule height\CF@delim@halfdim depth\CF@delim@halfdim width0pt\right\CF@right@delim
+ \CF@eexp@macroarg\CF@doifnotempty{\useKV[CFdelimiters]{indice}}
+ {_{\rlap{$\scriptstyle\useKV[CFdelimiters]{indice}$}}}
+ $};
+ }%
+}
+\CFrestorecatcode
\endinput
-######################################################################
-# Historique #
-######################################################################
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% H I S T O R I Q U E %%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
v0.1 2010/06/23
- - Premi\`ere version publique sur le CTAN
+ - Première version publique sur le CTAN
----------------------------------------------------------------------
v0.2 2010/08/31
- Ajout de la documentation en anglais.
- Correction de bugs.
- - \printatom est d\'esormais une macro publique.
- - Les espaces sont permis dans les mol\'ecules. Ils seront
- ignor\'es par d\'efaut puisque les atomes sont compos\'es en
+ - \printatom est désormais une macro publique.
+ - Les espaces sont permis dans les molécules. Ils seront
+ ignorés par défaut puisque les atomes sont composés en
mode math par \printatom
- - Une paire de Lewis peut \^etre repr\'esent\'ee ":".
+ - Une paire de Lewis peut être représentée ":".
- Dans les cycles, une correction de la longueur du trait
- d\'eport\'e des liaisons doubles est fait de telle sorte que si
- l'on \'ecrit \chemfig{*5(=====)}, on obtient deux polygones
- r\'eguliers concentriques.
- - La s\'equence de contr\^ole \setnodestyle permet de sp\'ecifier
- le style des noeuds dessin\'es par tikz.
+ déporté des liaisons doubles est fait de telle sorte que si
+ l'on écrit \chemfig{*5(=====)}, on obtient deux polygones
+ réguliers concentriques.
+ - La séquence de contrôle \setnodestyle permet de spécifier
+ le style des n?uds dessinés par tikz.
----------------------------------------------------------------------
v0.3 2010/11/21
- - Am\'elioration de \definesubmol qui accepte les s\'equences de
- contr\^ole. On peut aussi choisir un alias dont la substitution
- est diff\'erente selon l'orientation de la liaison qui lui
+ - Amélioration de \definesubmol qui accepte les séquences de
+ contrôle. On peut aussi choisir un alias dont la substitution
+ est différente selon l'orientation de la liaison qui lui
arrive dessus.
- - Le caract\`ere "|" force la fin d'un atome. Si on \'ecrit
+ - Le caractère "|" force la fin d'un atome. Si on écrit
"D|ef" alors, chemfig verra deux atomes "D" et "ef".
- - Le caract\`ere "#" est reconnu lorsqu'il suit un caract\`ere de
- liaison. Il doit \^etre suivi d'un argument entre parenth\`eses
- qui contient l'offset de d\'ebut et de fin qui s'appliqueront
- \`a cette liaison.
- - La macro \chemfig admet un argument optionnel qui sera pass\'e
- \`a l'environnement tikzpicture dans lequel elle est dessin\'ee
- - Mise en place de la repr\'esentation des m\'ecanismes
- r\'eactionnels avec la synatxe "@{<nom>}" devant un atome o\`u
- "@{<nom>,<coeff>}" au tout d\'ebut de l'argument d'une liaison.
- Cette syntaxe permet de placer un noeud (au sens de tikz) qui
- deviendra l'extr\'emit\'e des fl\`eches des m\'ecanismes.
- Le trac\'e des fl\`eches est faite par la macro \chemmove dont
+ - Le caractère "#" est reconnu lorsqu'il suit un caractère de
+ liaison. Il doit être suivi d'un argument entre parenthèses
+ qui contient l'offset de début et de fin qui s'appliqueront
+ à cette liaison.
+ - La macro \chemfig admet un argument optionnel qui sera passé
+ à l'environnement tikzpicture dans lequel elle est dessinée
+ - Mise en place de la représentation des mécanismes
+ réactionnels avec la syntaxe "@{<nom>}" devant un atome où
+ "@{<nom>,<coeff>}" au tout début de l'argument d'une liaison.
+ Cette syntaxe permet de placer un n?ud (au sens de tikz) qui
+ deviendra l'extrémité des flèches des mécanismes.
+ Le tracé des flèches est faite par la macro \chemmove dont
l'argument optionnel devient celui de l'environnement
- tikspicture dans lequel sont faites les fl\`eches.
- - Pour le m\'ecanisme d'alignement vertical via le \vphantom, la
+ tikzpicture dans lequel sont faites les flèches.
+ - Pour le mécanisme d'alignement vertical via le \vphantom, la
commande \chemskipalign permet d'ignorer le groupe d'atomes
- dans lequel elle est \'ecrite.
+ dans lequel elle est écrite.
- La commande \chemname permet d'afficher un nom sous une
- mol\'ecule. la commande \chemnameinit initialise la plus grande
- profondeur rencontr\'ee.
- - La commande \lewis a \'et\'e modifi\'ee de telle sorte que les
- dessins des d\'ecorations soient proportionnels \`a la taille
+ molécule. la commande \chemnameinit initialise la plus grande
+ profondeur rencontrée.
+ - La commande \lewis a été modifiée de telle sorte que les
+ dessins des décorations soient proportionnels à la taille
de la police.
----------------------------------------------------------------------
v0.3a 2011/01/08
- Correction d'un bug dans l'argument optionnel de \definesubmol
lorsque celui-ci comporte des crochets.
- - Mise \`a jour du manuel en anglais.
+ - Mise à jour du manuel en anglais.
- Ajout de \vflipnext et \hflipnext pour retourner
- horizontalement ou verticalement la prochaine mol\'ecule.
+ horizontalement ou verticalement la prochaine molécule.
----------------------------------------------------------------------
v0.4 2011/03/07
- - chemfig est d\'esormais \'ecrit en plain-etex et donc
+ - chemfig est désormais écrit en plain-etex et donc
utilisable par d'autres formats que LaTeX.
- - Un peu plus de rigueur avec les catcodes des caract\`eres
- sp\'eciaux, notamment lorsque la commande \chemfig se trouve
+ - Un peu plus de rigueur avec les catcodes des caractères
+ spéciaux, notamment lorsque la commande \chemfig se trouve
dans l'argument de \chemmove, \chemabove, \chembelow, \chemrel.
- TODO : faut-il \scantoker l'argument de \chemfig pour \^etre
- d\'efinitivement d\'ebarass\'e de ces histoires de catcode ???
+ TODO : faut-il \scantoker l'argument de \chemfig pour être
+ définitivement débarrassé de ces histoires de catcode ???
- Correction d'un bug dans le calcul de l'angle des liaisons
----------------------------------------------------------------------
v0.4a 2011/04/10
- - Correction d'un bug concernant l'argument optionnel en d\'ebut
- de mol\'ecule.
+ - Correction d'un bug concernant l'argument optionnel en début
+ de molécule.
----------------------------------------------------------------------
v0.4b 2011/04/24
- - l'argument de \chemfig est tok\'enis\'e avec \scantokens ce qui
- rend caduc tout souci de code de cat\'egorie, \`a part #.
- - la commande \setbondstyle permet de d\'efinir le style des
+ - l'argument de \chemfig est tokénisé avec \scantokens ce qui
+ rend caduc tout souci de code de catégorie, à part #.
+ - la commande \setbondstyle permet de définir le style des
liaisons.
- correction de l'affichage incorrect des doubles liaisons dans
- les cycles apr\`es les commandes \hflipnext et \vflipnext
- - correction d'un bug lorsqu'un alias commence une mol\'ecule
+ les cycles après les commandes \hflipnext et \vflipnext
+ - correction d'un bug lorsqu'un alias commence une molécule
----------------------------------------------------------------------
v1.0 2011/06/15
- - les sch\'emas r\'eactionnels sont d\'esormais disponibles.
+ - les schémas réactionnels sont désormais disponibles.
- \Chemabove et \Chembelow modifient la boite englobante.
- \Lewis modifie la boite englobante
- les macros \chemleft, \chemright, \chemup et \chemdown
- affichent des d\'elimiteurs extensibles \`a gauche, \`a droite,
- au dessus et au dessous d'un mat\'eriel.
+ affichent des délimiteurs extensibles à gauche, à droite,
+ au dessus et au dessous d'un matériel.
----------------------------------------------------------------------
v1.0a 2011/09/18
- les macros \Lewis et \lewis admettent un argument optionnel
- - la macro \setlewisdist r\`egle la distance entre les 2
- \'electrons
+ - la macro \setlewisdist règle la distance entre les 2
+ électrons
----------------------------------------------------------------------
v1.0b 2011/11/29
- - la commande \merge est d\'esormais prot\'eg\'ee entre
- \schemestart et \schemestop contre des d\'efinitions par d'autres
+ - la commande \merge est désormais protégée entre
+ \schemestart et \schemestop contre des définitions par d'autres
packages.
- - \box\z@ est utilis\'e au lieu du maladroit \unhbox\z@
+ - \box\z@ est utilisé au lieu du maladroit \unhbox\z@
----------------------------------------------------------------------
v1.0c 2011/11/30
- - la macro \+ n'est plus explicitement \'ecrite
- - v\'erifie que eTeX est le moteur utilis\'e
+ - la macro \+ n'est plus explicitement écrite
+ - vérifie que eTeX est le moteur utilisé
----------------------------------------------------------------------
v1.0d 2011/12/19
- - les cercles des cycles \'etaient trac\'es au mauvais moment. La
- longueur de la liaison qui les pr\'ec\'edait influait sur le
+ - les cercles des cycles étaient tracés au mauvais moment. La
+ longueur de la liaison qui les précédait influait sur le
rayon du cercle : \chemfig{-[,0.5]**6(------)} donnait un bug
- \`a l'affichage.
+ à l'affichage.
----------------------------------------------------------------------
v1.0e 2012/01/13
- la gestion des espaces dans les groupes d'atomes est
- d\'esormais plus rigoureuse. Plusieurs bugs ont \'et\'e
- corrig\'e
+ désormais plus rigoureuse. Plusieurs bugs ont été
+ corrigé
----------------------------------------------------------------------
v1.0f 2012/02/24
- - correction d'un bug avec \definesubmol, les catcodes n'\'etaient
- pas correctement g\'er\'es.
+ - correction d'un bug avec \definesubmol, les catcodes n'étaient
+ pas correctement gérés.
----------------------------------------------------------------------
v1.0g 2012/11/16
- correction d'un bug dans \CF@direct@arrow pour faire prendre en
- compte le style des fl\`eche par d\'efaut
- - correction d'un bug dans \CF@lewis@c : la boite *doit* \^etre
- compos\'ee en dehors de l'environnement tikzpicture pour
- \'eviter nullfont si jamais \printatom ne passe pas en mode
+ compte le style des flèche par défaut
+ - correction d'un bug dans \CF@lewis@c : la boite *doit* être
+ composée en dehors de l'environnement tikzpicture pour
+ éviter nullfont si jamais \printatom ne passe pas en mode
math.
- correction d'un bug dans \CF@chemfig@e : 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.
- - r\'e-\'ecriture des macros \chemabove et \chembemow pour
- prendre en compte le bug (d\'esormais corrig\'e) dans luatex.
- - nouvelle macro \setstacksep qui d\'efinit l'espacement par
- d\'efaut dans les macros \chemabove et \chembelow.
+ défaut est modifiée par [,<l>] au début d'une molécule
+ et si des cycles étaient emboités, cette longueur n'était
+ pas appliquée aux sous-cycles.
+ - ré-écriture des macros \chemabove et \chembemow pour
+ prendre en compte le bug (désormais corrigé) dans luatex.
+ - nouvelle macro \setstacksep qui définit l'espacement par
+ défaut dans les macros \chemabove et \chembelow.
----------------------------------------------------------------------
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\`eche
- n'\'etait pris en compte pour l'arc.
+ - \chemname admet maintenant une version étoilé qui ne tient
+ pas compte des profondeurs précédentes.
+ - \CF@dp@max est géré 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 \CF@direct@arrow : l'angle de la
- fl\`eche n'\'etait pas calcul\'e
+ flèche n'était pas calculé
----------------------------------------------------------------------
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.
+ \CF@remain@molecule est dépouillé de son éventuel espace
+ en première position.
- correction d'un bug dans \CF@arrow@f : 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
+ n?ud courant "end@arrow@i" était erroné dans le cas où une
+ flèche contenait un sous schéma. Ce nom doit dépendre 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
+ - la jonction entre deux liaisons consécutives dans l'axe peut
+ être activé avec \enablebondjoin et désactivé avec
+ \disablebondjoin (préférable, état par défaut).
+ - \chemfig suivi d'une "*" demande à 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.
+ variable. Cette fonctionnalité est désactivé dans les
+ cycles afin que les polygones soient réguliers.
+ \enablefixedbondlength permet cette fonctionnalité pour
+ toutes les macros \chemfig (même non étoilée) tandis que
+ \disablefixedbondlength le désactive.
----------------------------------------------------------------------
v1.1a 2015/02/23
- correction d'un bug dans \CF@grab@bondoffset. Si \chemfig est
- dans l'argument d'une macro, les # sont doubl\'es par l'action
+ dans l'argument d'une macro, les # sont doublés par l'action
de \scantokens de la macro \CF@chemfig@d et il faut un
- argument d\'elimit\'e avant "(" pour absorber tous les #.
+ argument délimité avant "(" pour absorber tous les #.
----------------------------------------------------------------------
v1.2 2015/10/08
- - correction d'un bug dans le trac\'e des liaisons de Cram.
- - cr\'eation de \setangleincrement.
- - chargement de "arrows.meta" et d\'efinition de la fl\`eche "CF"
- bas\'ee sur "Stealth" et d\'efinie avec \pgfdeclarearrow.
- Les anciennes fl\`eches "CF@full" et "CF@half" sont
- abandonn\'ees puisque d\'efinies avec \pgfarrowsdeclare.
- - fl\`eche "-U>" corrige\'e : le placement des labels est
+ - correction d'un bug dans le tracé des liaisons de Cram.
+ - création de \setangleincrement.
+ - chargement de "arrows.meta" et définition de la flèche "CF"
+ basée sur "Stealth" et définie avec \pgfdeclarearrow.
+ Les anciennes flèches "CF@full" et "CF@half" sont
+ abandonnées puisque définies avec \pgfarrowsdeclare.
+ - flèche "-U>" corrigée : le placement des labels est
maintenant correct dans tous les cas. Ainsi :
-U>[<a>][<b>][<d>][r][a]
- place le label <a> pr\`es du d\'ebut de la fl\`eche, quels que
+ place le label <a> près du début de la flèche, quels que
soient les signes du rayon r et de l'angle a.
- - \chemrel, \setchemrel et \chemsign sont supprim\'ees.
- - compatibilit\'e, avec les limitations d'usage, avec la
+ - \chemrel, \setchemrel et \chemsign sont supprimées.
+ - compatibilité, avec les limitations d'usage, avec la
librairie "externalize" : le \begin{tikzpicture} voit
- d\'esormais le \end{tikzpicture} correspondant dans la macro
+ désormais le \end{tikzpicture} correspondant dans la macro
\CF@chemfig@d.
----------------------------------------------------------------------
v1.2a 2015/10/21
- - erreur de copier-coller dans le code: une adresse url \'etait
- malencontreusement pr\'esente en plein milieu d'une ligne de
+ - erreur de copier-coller dans le code: une adresse url était
+ malencontreusement présente en plein milieu d'une ligne de
code
----------------------------------------------------------------------
v1.2b 2015/11/15
- bug dans \CF@seek@submol qui laissait "*" dans le flux de
- lecture de TeX. Un message d'erreur est \'egalement ajout\'e
+ lecture de TeX. Un message d'erreur est également ajouté
en cas de "!" en fin de traitement.
- - correction d'un bug dans \CF@set@bondangle o\`u l'angle [<:a>]
- n'\'etait pas \'evalu\'e par \pgfmathsetmacro.
+ - correction d'un bug dans \CF@set@bondangle où l'angle [<:a>]
+ n'était pas évalué par \pgfmathsetmacro.
----------------------------------------------------------------------
v1.2c 2015/11/20
- - Correction d'un bug dans \CF@set@bondangle : l'angle renvoy\'e
- pouvait \^etre n\'egatif
+ - Correction d'un bug dans \CF@set@bondangle : l'angle renvoyé
+ pouvait être négatif
- Correction d'un bug dans \CF@direct@arrow : la macro \CF@ifempty
- n'est pas correctement d\'evelopp\'ee dans l'argument de
+ n'est pas correctement développée dans l'argument de
\pgfpointanchor
----------------------------------------------------------------------
v1.2d 2015/12/01
- - correction d'un bug dans la fl\`eche "-U"
- - la version \'etoil\'ee de \setcrambond dessine les liaisons de
- Cram en pointill\'es sous forme de trait large et non pas sous
+ - correction d'un bug dans la flèche "-U"
+ - la version étoilée de \setcrambond dessine les liaisons de
+ Cram en pointillés sous forme de trait large et non pas sous
forme de triangle.
----------------------------------------------------------------------
v1.2e 2017/05/20
- - la macro contenant la d\'efinition d'une fl\`eche est
- d\'esormais "\CF@arrow(<nom>)", ainsi la macro \0 n'est plus
- d\'efinie par \definearrow
- - remerciements rajout\'es apr\`es une suppression indue, pour ne
- froisser aucune susceptibilit\'e \ No newline at end of file
+ - la macro contenant la définition d'une flèche est
+ désormais "\CF@arrow(<nom>)", ainsi la macro \0 n'est plus
+ définie par \definearrow
+ - remerciements rajoutés après une suppression indue, pour ne
+ froisser aucune susceptibilité
+----------------------------------------------------------------------
+v1.3 2018/03/08
+ - tous les paramètres sont désormais passés via \setchemfig qui
+ fait appel à "simplekv". Par conséquent, _toutes_ les macros qui
+ réglaient des paramètres deviennent obsolètes, à savoir :
+ \setcrambond, \setatomsep, \setbondoffset, \setdoublesep,
+ \setangleincrement, \enablefixedbondlength,
+ \disablefixedbondlength, \setnodestyle, \setbondstyle,
+ \setlewis, \setlewisdist, \setstacksep, \setcompoundstyle,
+ \setarrowdefault, \setandsign, \setarrowoffset,
+ \setcompoundsep, \setarrowlabelsep, \enablebondjoin,
+ \disablebondjoin et \schemedebug.
+ et ces macros seront *supprimées* dans une future version.
+ - la version étoilée "\chemfig*" et les deux arguments optionnels
+ de la macro "\chemfig[][]" sont également optionnels et seront
+ *supprimé*s dans une future version afin d'accéder à la syntaxe
+ \chemfig[clés=valeurs]{code}
+ - 6 nouveaux paramètres : "lewis radius", "arrow double sep",
+ "arrow double coeff", "arrow double harpoon", "cycle radius
+ coeff", "arrow head".
+ - correction d'un bug dans \CF@parse@mergeopt qui dans certains
+ cas, envoyait vers l'affichage des caractères
+ - petit toilettage du code
+ - macro \polymerdelim (non documentée) expérimentale et encore
+ en phase de tests
+ - suppression d'un registre d'écriture de fichier \ 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 7bfe48bb120..47bbcbd5175 100644
--- a/Master/texmf-dist/tex/generic/chemfig/t-chemfig.tex
+++ b/Master/texmf-dist/tex/generic/chemfig/t-chemfig.tex
@@ -1,41 +1,3 @@
-% __________________________________________________________________
-% | |
-% | chemfig v1.2e |
-% |__________________________________________________________________|
-%
-% This is t-chemfig.tex, the package file for conTeXt.
-%
-% Maintainer : Christian Tellechea
-% 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
-% Package URL: http://ctan.org/pkg/chemfig
-% 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)
-%
-% --------------------------------------------------------------------
-% This work may be distributed and/or modified under the
-% conditions of the LaTeX Project Public License, either version 1.3
-% 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.3 or later is part of all distributions of LaTeX
-% version 2005/12/01 or later.
-% --------------------------------------------------------------------
-% This work has the LPPL maintenance status `maintained'.
-%
-% The Current Maintainer of this work is Christian Tellechea
-% --------------------------------------------------------------------
\usemodule[tikz]%
\input chemfig.tex
\endinput