texlive[55828] Master/texmf-dist: chemfig (13jul20)

commits+karl at tug.org commits+karl at tug.org
Mon Jul 13 23:10:07 CEST 2020


Revision: 55828
          http://tug.org/svn/texlive?view=revision&revision=55828
Author:   karl
Date:     2020-07-13 23:10:07 +0200 (Mon, 13 Jul 2020)
Log Message:
-----------
chemfig (13jul20)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/generic/chemfig/README
    trunk/Master/texmf-dist/doc/generic/chemfig/chemfig-en.pdf
    trunk/Master/texmf-dist/doc/generic/chemfig/chemfig-en.tex
    trunk/Master/texmf-dist/doc/generic/chemfig/chemfig-fr.pdf
    trunk/Master/texmf-dist/doc/generic/chemfig/chemfig-fr.tex
    trunk/Master/texmf-dist/tex/generic/chemfig/chemfig.tex

Modified: trunk/Master/texmf-dist/doc/generic/chemfig/README
===================================================================
--- trunk/Master/texmf-dist/doc/generic/chemfig/README	2020-07-13 21:09:51 UTC (rev 55827)
+++ trunk/Master/texmf-dist/doc/generic/chemfig/README	2020-07-13 21:10:07 UTC (rev 55828)
@@ -2,9 +2,9 @@
 
                 The
           Chemfig package
-               v1.55
+               v1.56
 
-            2020/06/15
+            2020/07/13
 ___________________________________
 
 Maintainer: Christian Tellechea

Modified: trunk/Master/texmf-dist/doc/generic/chemfig/chemfig-en.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/generic/chemfig/chemfig-en.tex
===================================================================
--- trunk/Master/texmf-dist/doc/generic/chemfig/chemfig-en.tex	2020-07-13 21:09:51 UTC (rev 55827)
+++ trunk/Master/texmf-dist/doc/generic/chemfig/chemfig-en.tex	2020-07-13 21:10:07 UTC (rev 55828)
@@ -247,6 +247,9 @@
 \exemple{Consecutive bonds}/\chemfig{[:30]-\charge{90=\:}{}
 -[:-30]\charge{-90=\"}{}-\charge{90:2pt=$\delta^+$}{}-[:-30]}/
 
+\subsection{Center of rings}
+The center of each ring is reachable with a \TIKZ node. See page~\pageref{centre_cycle}.
+
 \subsection{Manual Update}
 More detailed explanations are given on:
 \begin{itemize}
@@ -313,16 +316,18 @@
 		\CFparam{lewis sep}
 		\CFparam{lewis length}
 		\CFparam{lewis style}
-		\CFparam{lewis dist}\hline
+		\CFparam{lewis dist}
+		\CFparam{lewis radius}
+		\CFparam{lewis diag coeff}
+		\CFparam{cycle radius coeff}
+		\CFparam{stack sep}
+		\CFparam{show cntcycle}
+		\CFparam{autoreset cntcycle}\hline
 	\end{longtable}
 \end{minipage}\hfill
 \begin{minipage}[t]{.45\linewidth}
 	\begin{longtable}{rl}\hline
 		\chevrons{keys} & default \chevrons{values}\\\hline\endhead
-		\CFparam{lewis radius}
-		\CFparam{lewis diag coeff}
-		\CFparam{cycle radius coeff}
-		\CFparam{stack sep}
 		\CFparam{scheme debug}
 		\CFparam{compound style}
 		\CFparam{compound sep}
@@ -799,6 +804,21 @@
 In order for the ring to have a regular shape, it is necessary to override the \CF mechanism which automatically calculates the departure and arrival atoms of bonds. Here, \verb/C-F/ and \verb/F-G/ must be connected by using the optional argument of these bonds:
 \exemple{Forced departure and arrival atoms}|\chemfig{AB*5(-CDE-[,,1]F-[,,,1]GH-I-)}|
 
+\subsection{Center of rings}\label{centre_cycle}
+Each ring has at its center a node of zero dimension whose name is \Verb|centrecycle<n>| where \Verb|<n>| is the number of the ring, (the rings are numbered in the order in which they are drawn). It is possible to display the number of each ring by setting the boolean \CFkey{show cntcycle} to true.
+
+The default true boolean \CFkey{autoreset cntcycle} resets the ring counter at the beginning of each molecule to 0 (i.e., each time \verb|\chemfig| is executed).
+
+\exemple{Centre of rings}/\chemfig{*5(---(-*3(---))--)}
+\chemmove{\draw[red](cyclecenter1)to[out=20,in=-45](cyclecenter2);}
+\qquad
+\chemfig{*6(-=-=-=)}
+\chemmove{%
+	\node[at=(cyclecenter1)](){.+}
+	node [at=(cyclecenter1),shift=(120:1.75cm)](end){\printatom{R^1}};
+	\draw[-,shorten <=.5cm](cyclecenter1)--(end);
+}/
+
 \section{Representing electron movements}\label{mecanismes-reactionnels}
 Starting with \CF version 0.3, we can represent the movement of electrons in mesomeric effects or reaction mechanisms. This is done by marking the departure and arrival points of the electron movement arrow using the syntax ``\Verb-@{<argument>}-''. This syntax allows a \TIKZ node to be placed and makes this node accessible outside the argument of the \verb-\chemfig- command thanks to the ``\texttt{remember picture}'' option which is passed to all the ``\falseverb{tikzpicture}'' environments. It is assumed that the viewer supports ``\falseverb{picture remembering}'' and that the compilation is done twice.
 
@@ -2457,6 +2477,8 @@
 	\item \CFkv{lewis diag coeff}    {1}: factor that multiplies the distance to Lewis formulas in odd directions
 	\item \CFkv{cycle radius coeff}  {0.75}: shrinkage ratio of the circle or arc inside cycles
 	\item \CFkv{stack sep}           {1.5pt}: vertical gap between arguments of \verb-\chemabove- and \verb-\chembelow- macros
+	\item \CFkv{show cntcycle}       {false}: show rings numbers
+	\item \CFkv{autoreset cntcycle}  {true}: reset ring counter at \verb|\chemfig| execution
 	\item \CFkv{compound style}      {{}}: style of compounds
 	\item \CFkv{compound sep}        {5em}: space between compounds
 	\item \CFkv{arrow offset}        {4pt}: space between compound and arrow

Modified: trunk/Master/texmf-dist/doc/generic/chemfig/chemfig-fr.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/generic/chemfig/chemfig-fr.tex
===================================================================
--- trunk/Master/texmf-dist/doc/generic/chemfig/chemfig-fr.tex	2020-07-13 21:09:51 UTC (rev 55827)
+++ trunk/Master/texmf-dist/doc/generic/chemfig/chemfig-fr.tex	2020-07-13 21:10:07 UTC (rev 55828)
@@ -247,6 +247,9 @@
 \exemple{Liaisons jointives}/\chemfig{[:30]-\charge{90=\:}{}
 -[:-30]\charge{-90=\"}{}-\charge{90:2pt=$\delta^+$}{}-[:-30]}/
 
+\subsection{Centre des cycles}
+Le centre de chaque cycle est désormais accessible via un nœud de \TIKZ. Voir page~\pageref{centre_cycle}.
+
 \subsection{Mise à jour du manuel}
 Des explications plus détaillées sont données sur:
 \begin{itemize}
@@ -313,16 +316,18 @@
 		\CFparam{lewis sep}
 		\CFparam{lewis length}
 		\CFparam{lewis style}
-		\CFparam{lewis dist}\hline
+		\CFparam{lewis dist}
+		\CFparam{lewis radius}
+		\CFparam{lewis diag coeff}
+		\CFparam{cycle radius coeff}
+		\CFparam{stack sep}
+		\CFparam{show cntcycle}
+		\CFparam{autoreset cntcycle}\hline
 	\end{longtable}
 \end{minipage}\hfill
 \begin{minipage}[t]{.45\linewidth}
 	\begin{longtable}{rl}\hline
 		\chevrons{clés} & \chevrons{valeurs} par défaut\\\hline\endhead
-		\CFparam{lewis radius}
-		\CFparam{lewis diag coeff}
-		\CFparam{cycle radius coeff}
-		\CFparam{stack sep}
 		\CFparam{scheme debug}
 		\CFparam{compound style}
 		\CFparam{compound sep}
@@ -799,6 +804,21 @@
 Pour que le cycle ait une forme régulière, il faut passer outre le mécanisme de \CF qui calcule automatiquement les atomes de départ et d'arrivée des liaisons. Ici, il faut relier \verb/C-F/ et \verb/F-G/ en le spécifiant avec l'argument optionnel de ces liaisons :
 \exemple{Atomes de départ et d'arrivée imposés}|\chemfig{AB*5(-CDE-[,,1]F-[,,,1]GH-I-)}|
 
+\subsection{Centre du cycle}\label{centre_cycle}
+Chaque cycle porte en son centre un nœud de dimension nulle dont le nom est \Verb|centrecycle<n>| où \Verb|<n>| est le numéro du cycle, entendu que les cycles sont numérotés dans l'ordre où ils sont tracés. Il est possible d'afficher le numéro de chaque cycle en mettant à vrai la \chevrons{clé} booléenne \CFkey{show cntcycle}.
+
+La \chevrons{clé} booléenne \CFkey{autoreset cntcycle}, vraie par défaut, remet à 0 le compteur de cycle au début de chaque molécule tracée (c'est-à-dire à chaque appel de \verb|\chemfig|).
+
+\exemple{Centre de cycle}/\chemfig{*5(---(-*3(---))--)}
+\chemmove{\draw[red](cyclecenter1)to[out=20,in=-45](cyclecenter2);}
+\qquad
+\chemfig{*6(-=-=-=)}
+\chemmove{%
+	\node[at=(cyclecenter1)](){.+}
+	node [at=(cyclecenter1),shift=(120:1.75cm)](end){\printatom{R^1}};
+	\draw[-,shorten <=.5cm](cyclecenter1)--(end);
+}/
+
 \section{Représentation des déplacements d'électrons}\label{mecanismes-reactionnels}
 Depuis la version 0.3 de \CF, on peut représenter les déplacements d'électrons des effets mésomères ou des mécanismes réactionnels. Cela est rendu possible en marquant le point de départ et le point d'arrivée de la flèche que l'on utilise pour indiquer la migration des électrons à l'aide de la syntaxe «\Verb-@{<argument>}-». Cette syntaxe permet de poser un nœud (au sens de \TIKZ) en rendant ce nœud accessible en dehors de l'argument de la commande \verb-\chemfig- grâce à l'option «\texttt{remember picture}» qui est passée à tous les environnements «\falseverb{tikzpicture}». Cela suppose que le visualiseur prenne en charge le «\falseverb{picture remembering}» et que la compilation soit lancée deux fois.
 
@@ -2457,6 +2477,8 @@
 	\item \CFkv{lewis diag coeff}    {1}: coefficient multiplicatif de la distance dans les directions impaires
 	\item \CFkv{cycle radius coeff}  {0.75}: coefficient du cercle ou de l'arc de cercle tracé dans les cycles
 	\item \CFkv{stack sep}           {1.5pt}: espacement vertical pour les arguments des macros \verb-\chemabove- et \verb-\chembelow-
+	\item \CFkv{show cntcycle}       {false}: affichage des numéros des cycles
+	\item \CFkv{autoreset cntcycle}  {true}: remise à 0 du compteur de cycles à chaque exécution de \verb|\chemfig|
 	\item \CFkv{compound style}      {{}}: style des composés
 	\item \CFkv{compound sep}        {5em}: espacement entre 2 composés
 	\item \CFkv{arrow offset}        {4pt}: espacement entre un composé et la flèche

Modified: trunk/Master/texmf-dist/tex/generic/chemfig/chemfig.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/chemfig/chemfig.tex	2020-07-13 21:09:51 UTC (rev 55827)
+++ trunk/Master/texmf-dist/tex/generic/chemfig/chemfig.tex	2020-07-13 21:10:07 UTC (rev 55828)
@@ -4,9 +4,9 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %                                                                    %
 \def\CFname                    {chemfig}                             %
-\def\CFver                       {1.55}                              %
+\def\CFver                       {1.56}                              %
 %                                                                    %
-\def\CFdate                   {2020/06/15}                           %
+\def\CFdate                   {2020/07/13}                           %
 %                                                                    %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
@@ -56,22 +56,18 @@
 %-------------------- V\xE9rification des pr\xE9requis ---------------------
 \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_checkprimitive#1#2#3{% V\xE9rifie que #1 est une primitive et sinon, \xE9met le message #2 et ex\xE9cute #3
+\def\CF_checkprimitive#1#2{% V\xE9rifie que #1 est une primitive et sinon, \xE9met le message #2 et ex\xE9cute \endinput
 	\begingroup
 		\edef\__tempa{\meaning#1}\edef\__tempb{\string#1}\expandafter
 	\endgroup
 	\ifx\__tempa\__tempb\else
 		\CF_error{#2}%
-		\def\CF_temp{\CFrestorecatcode#3}%
+		\def\CF_temp{\CFrestorecatcode\endinput}%
 		\expandafter\CF_temp
 	\fi
 }
-\CF_checkprimitive\eTeXversion
-	{You are not using an eTeX engine, \CFname\space cannot work.}
-	{\endinput}%
-\CF_checkprimitive\expanded
-	{the \string\expanded\space primitive is not provided by your TeX engine, \CFname\space cannot work.}
-	{\endinput}%
+\CF_checkprimitive\eTeXversion{You are not using an eTeX engine, \CFname\space cannot work.}
+\CF_checkprimitive\expanded{the \string\expanded\space primitive is not provided by your TeX engine, \CFname\space cannot work.}
 
 %------------------------ Chargement simplekv ------------------------
 \input simplekv.tex
@@ -88,6 +84,7 @@
 \newcount\CF_cntgroup
 \newcount\CF_cntatom
 \newcount\CF_cntcycle
+\newcount\CF_cntcyclebonds
 \newcount\CF_cntcompound
 
 \newif\ifCF_incycle
@@ -185,7 +182,7 @@
 \def\CF_ifinteger#1{%
 	\begingroup
 		\afterassignment\CF_afterinteger
-		\CF_cntcycle0#1\relax
+		\CF_cntcyclebonds0#1\relax
 }
 \def\CF_afterinteger#1\relax{%
 	\endgroup
@@ -434,7 +431,9 @@
 	arrow head          = -CF,
 	+ sep left          = 0.5em,
 	+ sep right         = 0.5em,
-	+ vshift            = 0pt
+	+ vshift            = 0pt,
+	autoreset cntcycle  = true,
+	show cntcycle       = false,
 }%
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -823,6 +822,9 @@
 					{\let\CF_clipcramornot\clip}%
 				\CF_incyclefalse
 				\CF_cntgroup0
+				\ifboolKV[chemfig]{autoreset cntcycle}
+					{\global\CF_cntcycle0 }
+					{}%
 				\let\CF_lastaction\CF_zero% 0=d\xE9but du dessin 1=trac\xE9 d'un noeud 2=trac\xE9 d'une liaison
 				\let\CF_startoffset\empty
 				\let\CF_endoffset\empty
@@ -854,7 +856,7 @@
 		\ifCF_incycle
 			\def\CF_defaultangle{0}%
 		\else
-			\ifnum\CF_cntcycle=0 % si c'est le d\xE9but d'un cycle
+			\ifnum\CF_cntcyclebonds=0 % si c'est le d\xE9but d'un cycle
 				\pgfmathsetmacro\CF_defaultangle{\CF_previousangle+180+\CF_cycleanglecorrection}% on met la liaison \xE0 +180\xB0 + correction
 			\else
 				\pgfmathsetmacro\CF_defaultangle{\CF_previousangle-90+180/\CF_cyclenum}% sinon \xE0 la bissectrice du sommet du cycle
@@ -884,13 +886,16 @@
 	\let\CF_currenttikz\CF_defaulttikz
 	\ifCF_incycle% si on commence un cycle
 		\let\CF_currentangle\CF_previousangle
+		\pgfmathsetmacro\CF_cyclearcinitangle{\CF_currentangle+\CF_initcycleangle+180/\CF_cyclenum+90}%
+		\pgfmathsetmacro\CF_centeroffset{\CF_currentlength*\CF_atomsep/(2*sin(180/\CF_cyclenum))}%
+		\node[at=(\CF_bondoutnode),shift=(\CF_cyclearcinitangle:\CF_centeroffset pt),anchor=center](cyclecenter\number\CF_cntcycle){};% le centre du cycle
+		\ifboolKV[chemfig]{show cntcycle}
+			{\node[at=(cyclecenter\number\CF_cntcycle),anchor=center,overlay]{\tiny\number\CF_cntcycle};}
+			{}%
 		\ifCF_cyclearc% on doit tracer l'arc de cercle dans le cycle ?
 			\pgfmathsetmacro\CF_cyclearcradius{\CF_cycleradiuscoeff*\CF_currentlength*\CF_atomsep/(2*tan(180/\CF_cyclenum))}%
-			\pgfmathsetmacro\CF_cyclearcinitangle{\CF_currentangle+\CF_initcycleangle+180/\CF_cyclenum+90}
-			\pgfmathparse{\CF_currentlength*\CF_atomsep/(2*sin(180/\CF_cyclenum))}%
-			\node[at=(\CF_bondoutnode),shift=(\CF_cyclearcinitangle:\pgfmathresult pt)](arccenter){};% le centre de l'arc
-			\node[at=(arccenter),shift=(\CF_cyclearcstartangle:\CF_cyclearcradius pt)](initarc){};% le d\xE9but de l'arc
-			\CF_expafter{\draw[}\CF_cyclearcdirecttikz](initarc) arc (\CF_cyclearcstartangle:\CF_cyclearcendangle:\CF_cyclearcradius pt);
+			\node[at=(cyclecenter\number\CF_cntcycle),shift=(\CF_cyclearcstartangle:\CF_cyclearcradius pt)](initarc){};% le d\xE9but de l'arc
+			\CF_expafter{\draw[}\CF_cyclearcdirecttikz](initarc) arc (\CF_cyclearcstartangle:\CF_cyclearcendangle:\CF_cyclearcradius pt);%
 		\fi
 	\else
 		\let\CF_currentangle\CF_defaultangle
@@ -934,16 +939,16 @@
 					\edef\CF_bondoutnode{\CF_bondoutnode}%
 				\else
 					\ifCF_incycle
-						\advance\CF_cntcycle1
+						\advance\CF_cntcyclebonds1
 					\fi
 					\CF_expsecond\CF_analysebond{\CF_molecule}\CF_bondtype
 					\edef\CF_bondoutnode{\CF_bondoutnode}%
 					\let\CF_molecule\CF_remainafterbond
 					\ifCF_incycle
-						\ifnum\CF_cntcycle=\CF_cyclenum\relax
+						\ifnum\CF_cntcyclebonds=\CF_cyclenum\relax
 							\CF_threeea\CF_execfirst
 						\else
-							\ifnum\CF_cntcycle=1
+							\ifnum\CF_cntcyclebonds=1
 								\let\CF_cyclefirsttikz\CF_currenttikz
 								\CF_doifnotempty\CF_startoffset{\let\CF_cyclejoinlast\CF_zero}%
 							\fi
@@ -1006,7 +1011,7 @@
 									{\expandafter\CF_cycleparsepreamble\CF_molecule\_nil% \begingroup inclus
 									\CF_cyclearcfalse
 									}%
-								\CF_cntcycle0
+								\CF_cntcyclebonds0
 								\edef\CF_hookcycle{\CF_bondoutnode}%
 								\let\CF_hookatomgroup\CF_previousatomgroup
 								\CF_ifzerodim\CF_hookatomgroup
@@ -1013,6 +1018,7 @@
 									{\def\CF_cyclejoinlast{1}}% joindre le dernier
 									{\def\CF_cyclejoinlast{0}}%
 								\CF_incycletrue
+								\global\advance\CF_cntcycle1
 								\ifnum\CF_lastaction=3
 									\pgfmathsetmacro\CF_initcycleangle{360/\CF_lastcyclenum-180}% c'est un cycle dans un cycle
 								\else
@@ -1234,12 +1240,12 @@
 \def\CF_drawaxisbondnojoin#1#2{\CF_drawbonda(#1@@)--(#2@@);}
 
 \def\CF_drawaxisbondjoin#1#2{% dessine une liaison simple dans l'axe avec raccord r\xE9trograde
-	\ifCF_incycle\ifnum\CF_cntcycle=\CF_cyclenum\relax
+	\ifCF_incycle\ifnum\CF_cntcyclebonds=\CF_cyclenum\relax
 		\let\CF_nexttikz\CF_cyclefirsttikz
 	\fi\fi
 	\ifnum\CF_joinbond=0
 		\ifCF_incycle
-			\ifnum\CF_cntcycle=\CF_cyclenum\relax
+			\ifnum\CF_cntcyclebonds=\CF_cyclenum\relax
 				\ifnum\CF_cyclejoinlast=1
 					\CF_drawbonda(#1@@)--(#2@@)--%
 						([shift=(\CF_previousbondangle+2*\CF_cycleincrementangle:.5\pgflinewidth)]#2@@);
@@ -1262,7 +1268,7 @@
 					}
 					{\ifdim\CF_startoffset=0pt
 						\ifCF_incycle
-							\ifnum\CF_cntcycle=\CF_cyclenum\relax
+							\ifnum\CF_cntcyclebonds=\CF_cyclenum\relax
 								\ifnum\CF_cyclejoinlast=1
 									\CF_ifx\CF_cyclefirsttikz\CF_currenttikz
 										{\CF_drawbonda([shift=(\CF_previousbondangle:-.5\pgflinewidth)]#1@@)--(#1@@)--(#2@@)--%
@@ -1287,7 +1293,7 @@
 				{\CF_drawbonda(#1@@)--(#2@@);}%
 			}
 			{\ifCF_incycle
-				\ifnum\CF_cntcycle=\CF_cyclenum\relax
+				\ifnum\CF_cntcyclebonds=\CF_cyclenum\relax
 					\ifnum\CF_cyclejoinlast=1
 						\CF_ifx\CF_nexttikz\CF_currenttikz
 							{\CF_drawbonda(#1@@)--(#2@@)--([shift=(\CF_previousbondangle+2*\CF_cycleincrementangle:.5\pgflinewidth)]#2@@);}%
@@ -3086,4 +3092,8 @@
 v1.55       2020/06/15
     - chemfig est incompatible avec conTeXt, vu que ce moteur red\xE9finit
       des primitives telles que \expanded, \unexpanded et peut \xEAtre
-      d'autres.
\ No newline at end of file
+      d'autres.
+----------------------------------------------------------------------
+v1.56       2020/07/13
+    - le centre des cycles est d\xE9sormais accessible via un noeud
+      sp\xE9cifique pour chacun d'eux.
\ No newline at end of file



More information about the tex-live-commits mailing list.