texlive[69227] Master/texmf-dist: chemfig (29dec23)
commits+karl at tug.org
commits+karl at tug.org
Fri Dec 29 00:03:29 CET 2023
Revision: 69227
https://tug.org/svn/texlive?view=revision&revision=69227
Author: karl
Date: 2023-12-29 00:03:29 +0100 (Fri, 29 Dec 2023)
Log Message:
-----------
chemfig (29dec23)
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 2023-12-28 00:41:04 UTC (rev 69226)
+++ trunk/Master/texmf-dist/doc/generic/chemfig/README 2023-12-28 23:03:29 UTC (rev 69227)
@@ -2,9 +2,9 @@
The
Chemfig package
- v1.6e
+ v1.66
- 2023/06/30
+ 2023/12/28
___________________________________
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 2023-12-28 00:41:04 UTC (rev 69226)
+++ trunk/Master/texmf-dist/doc/generic/chemfig/chemfig-en.tex 2023-12-28 23:03:29 UTC (rev 69227)
@@ -243,6 +243,9 @@
\subsection{Key "baseline"}
The value passed to this key sets the vertical position of the molecule. See page~\pageref{baseline}.
+\subsection{Cram bonds join}
+When \CFkey{bond join} is \CFval{true}, Cram bonds better connect to each other and to simple bonds. See page~\pageref{joinCram}.
+
\section{Presenting \protect\CF}
To use this package, start by adding the following code to the preamble:
\begin{itemize}
@@ -459,12 +462,6 @@
These angles remain valid if the atoms are empty, and this is the case for all the features we will see below:
\exemple{Predefined angles with empty groups}|\chemfig{--[1]-[3]--[7]-[6]}|
-For those who find this "ugly\footnote{See \texttt{\detokenize{http://tex.stackexchange.com/questions/161796/ugly-bond-joints-in-chemfig detokenize}}}", it is now possible connect the single bonds with a slightly increased compilation time. The boolean \chevrons{key} \CFkv{bond join}{boolean} macro enables this feature when \CFval{true} and disables it when \CFval{false}, which is the better behavior, set by default.
-
-\exemple{Connecting bonds}/\setchemfig{bond style={line width=3pt}}
-\chemfig{-[1]-[7]} et
-\chemfig[bond join=true]{-[1]-[7]}/
-
\label{angle increment}The \chevrons{key} \CFkv{angle increment}{angle} sets the default angle used to calculate the angle of a bond:
\exemple{Set the predefined angle}/Default (45) : \chemfig{-[1]-[-1]-[1]-[-1]}
@@ -599,6 +596,36 @@
Cram bonds ignore thickness and dash settings.
+\section{Connecting bonds}
+By default, the lines representing single bonds do not connect, which can be too visible and unsightly when the line widths are large.
+
+For those who find this "ugly\footnote{See \texttt{\detokenize{http://tex.stackexchange.com/questions/161796/ugly-bond-joints-in-chemfig detokenize}}}", it is now possible connect the single bonds with a slightly increased compilation time. The boolean \chevrons{key} \CFkv{bond join}{boolean} macro enables this feature when \CFval{true} and disables it when \CFval{false}, which is the better behavior, set by default.
+
+\exemple{Connecting bonds}/\setchemfig{bond style={line width=3pt}}
+\chemfig{-[1]-[7]} et
+\chemfig[bond join=true]{-[1]-[7]}/
+
+The problem is even more obvious with Cram bonds when they connect to a single bond or another Cram bond. Here again, setting \CFkey{bond join} to \CFval{true} makes for more aesthetically pleasing connections.\label{joinCram}
+
+\exemple{Connecting Cram bonds}/
+\chemfig{<[:-20]>[:50]}\qquad
+\chemfig[bond join]{<[:-20]>[:50]}
+\medbreak
+\setchemfig{cram width=5pt}
+\chemfig{<[:-45]-[:30,,,,line width=5pt]>[:-10]}\qquad
+\chemfig[bond join]{<[:-45]-[:30,,,,line width=5pt]>[:-10]}/
+
+It is important to note the tow following points:
+\begin{itemize}
+ \item \CFkey{bond join} is \CFval{true}, the Cram bond is drawn without an outline: it will therefore appear slightly thinner (the importance depending on the \CFval{line width} parameter);
+ \item \CFkey{bond join} has no effect between a simple bond and a Cram bond when the 2 vertices of the base of the triangle of the Cram bond are outside the space delimited by the 2 parallel edges of the simple bond. Mathematically, it is the case when $d \cos\alpha>w$, where $d$ is the value of \CFval{cram width}, $w$ is the width of the single bond and $\alpha$ is the angle between the 2 bonds.
+\end{itemize}
+
+\exemple{Connecting Cram bonds}/
+\setchemfig{cram width=5pt, bond join}
+\chemfig{-[,,,,line width=3pt]>[:30]}\qquad
+\chemfig{-[,,,,line width=3pt]>[:65]}/
+
\section{Default values}
At the beginning of each molecule, the default values for the optional arguments are initialized. They are:
\begin{itemize}
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 2023-12-28 00:41:04 UTC (rev 69226)
+++ trunk/Master/texmf-dist/doc/generic/chemfig/chemfig-fr.tex 2023-12-28 23:03:29 UTC (rev 69227)
@@ -243,6 +243,9 @@
\subsection{Clé «baseline»}
La valeur passée à cette clé permet de contrôler la position verticale de la molécule tracée par rapport à la ligne de base. Voir page~\pageref{baseline}.
+\subsection{Raccord avec les liaisons de Cram}
+Lorsque \CFkey{bond join} est \CFval{true}, les liaisons de Cram se raccordent plus esthétiquement entre-elles et aux liaisons simples. Voir page~\pageref{joinCram}.
+
\section{Présentation}
Pour charger \CF, il faut écrire :
\begin{itemize}
@@ -459,12 +462,6 @@
Ces angles restent valable si les atomes sont vides et il en sera de même par la suite pour toutes les fonctionnalités que nous verrons :
\exemple{Angles prédéfinis, groupes vides}|\chemfig{--[1]-[3]--[7]-[6]}|
-Pour ceux qui trouvent cela « affreux\footnote{Voir \texttt{\detokenize{http://tex.stackexchange.com/questions/161796/ugly-bond-joints-in-chemfig}}} », il est désormais possible de raccorder les liaisons simples entres-elles moyennant un temps de compilation légèrement augmenté. La \chevrons{clé} booléenne \CFkv{bond join}{booléen} permet, lorsqu'elle est \CFval{true} d'activer cette fonctionnalité. La valeur par défaut est \CFval{false} qui est le comportement préférable.
-
-\exemple{Raccord entre liaisons}/\setchemfig{bond style={line width=3pt}}
-\chemfig{-[1]-[7]} et
-\chemfig[bond join=true]{-[1]-[7]}/
-
\label{angle increment}La \chevrons{clé} \CFkv{angle increment}{angle} permet de choisir un autre angle que celui de 45\degres{} sélectionné par défaut :
\exemple{Modification de l'angle prédéfini}/Par défaut (45) : \chemfig{-[1]-[-1]-[1]-[-1]}
@@ -599,6 +596,36 @@
Les liaisons de Cram sont insensibles aux attributs d'épaisseur et de pointillés.
+\section{Raccord entre liaisons}
+Par défaut, les lignes représentant les liaisons simples ne se raccordent pas, ce qui peut être trop visible et inesthétique lorsque les épaisseurs des lignes sont importantes.
+
+Pour ceux qui trouvent cela « affreux\footnote{Voir \texttt{\detokenize{http://tex.stackexchange.com/questions/161796/ugly-bond-joints-in-chemfig}}} », il est désormais possible de raccorder les liaisons simples entres-elles moyennant un temps de compilation légèrement augmenté. La \chevrons{clé} booléenne \CFkv{bond join}{booléen} permet, lorsqu'elle est \CFval{true} d'activer cette fonctionnalité. La valeur par défaut est \CFval{false} qui est le comportement préférable.
+
+\exemple{Raccord entre liaisons simples}/\setchemfig{bond style={line width=3pt}}
+\chemfig{-[1]-[7]} et
+\chemfig[bond join=true]{-[1]-[7]}/
+
+Le problème est encore plus évident avec les liaisons de Cram pleines lorsqu'elles se connectent à une liaison simple ou à une autre liaison de Cram. Là encore, mettre \CFkey{bond join} à \CFval{true} permet des raccords plus esthétiques.\label{joinCram}
+
+\exemple{Raccord avec liaisons de Cram}/
+\chemfig{<[:-20]>[:50]}\qquad
+\chemfig[bond join]{<[:-20]>[:50]}
+\medbreak
+\setchemfig{cram width=5pt}
+\chemfig{<[:-45]-[:30,,,,line width=5pt]>[:-10]}\qquad
+\chemfig[bond join]{<[:-45]-[:30,,,,line width=5pt]>[:-10]}/
+
+Il est important de noter que les deux points suivants
+\begin{itemize}
+ \item lorsque \CFkey{bond join} est \CFval{true}, la liaison de Cram est tracée sans contour : elle paraitra donc légèrement plus fine (l'importance dépendant du paramètre \CFval{line width});
+ \item \CFkey{bond join} est sans effet entre une liaison simple et une liaison de Cram lorque les 2 sommets qui forment la base du triangle de la liaison de Cram sont au dehors de l'espace délimité par les 2 bords parallèles de la liaison simple. Mathématiquement, c'est la cas lorsque $d \cos\alpha>w$, où $d$ est la valeur de \CFval{cram width}, $w$ est l'épaisseur de la liaison simple et $\alpha$ est l'angle entre les 2 liaisons.
+\end{itemize}
+
+\exemple{Raccord avec liaisons de Cram}/
+\setchemfig{cram width=5pt, bond join}
+\chemfig{-[,,,,line width=3pt]>[:30]}\qquad
+\chemfig{-[,,,,line width=3pt]>[:65]}/
+
\section{Valeurs par défaut}
Au début de chaque molécule, les valeurs par défaut des arguments optionnels des liaisons sont initialisées. Elles valent :
\begin{itemize}
Modified: trunk/Master/texmf-dist/tex/generic/chemfig/chemfig.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/chemfig/chemfig.tex 2023-12-28 00:41:04 UTC (rev 69226)
+++ trunk/Master/texmf-dist/tex/generic/chemfig/chemfig.tex 2023-12-28 23:03:29 UTC (rev 69227)
@@ -4,9 +4,9 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
\def\CFname {chemfig} %
-\def\CFver {1.6e} %
+\def\CFver {1.66} %
% %
-\def\CFdate {2023/06/30} %
+\def\CFdate {2023/12/28} %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
@@ -110,6 +110,7 @@
\newif\ifCF_compound_is_chemfig
\newdimen\CF_dim
+\newdimen\CF_turnangle
\newdimen\CF_arrowsize
\newdimen\CF_zero
\CF_zero=0pt
@@ -991,6 +992,9 @@
\let\CF_defaulttoatom\empty% numéro de l'atome où arrivent les laisons par défaut
\let\CF_defaulttikz\empty
\let\CF_previousbondangle\empty
+ \def\CF_previousbondtype{0}%
+ \def\CF_previousnode{}%
+ \def\CF_previous_offset{0pt}%
\let\CF_joinbond\CF_zero
\let\CF_previoustikz\empty
\everyeof{\_nil}\endlinechar-1
@@ -1329,7 +1333,10 @@
\CF_setoffset\CF_startoffset#4%
\CF_setoffset\CF_endoffset#5%
\let\CF_currentbondstyle\CF_bondstyle
- \CF_doifnotempty\CF_currenttikz{\CF_eaddtomacro\CF_currentbondstyle{\expandafter,\CF_currenttikz}}%
+ \CF_doifnotempty\CF_currenttikz
+ {%
+ \CF_eaddtomacro\CF_currentbondstyle{\expandafter,\CF_currenttikz}%
+ }%
\path(#2)--(#3)coordinate[pos=0](#2@)coordinate[pos=1](#3@);%
\CF_computenodevect{#2@}{#3@}%
\pgfmathsetmacro\CF_startcoeff{\CF_startoffset/\CF_vectorlen}%
@@ -1343,6 +1350,36 @@
\ifcase#1\relax
\CF_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
+ \ifboolKV[chemfig]{bond join}% nouveau v1.66
+ {%
+ \scope
+ \expandafter\tikzset\expandafter{\CF_currentbondstyle}%
+ \ifnum\CF_previousbondtype=5
+ \ifnum0\ifdim\CF_startoffset=0pt 1\fi\ifdim\CF_previous_offset=0pt 1\fi=11
+ \CF_ifzerodim\CF_previousatomgroup
+ {%
+ \CF_turnangle=\CF_compute_turnangle{\CF_previousbondangle}{\CF_currentangle}%
+ \pgfmathsetmacro\CF_cram_overlap{\CF_crambasewidth*cos(\CF_turnangle)-\pgflinewidth}%
+ \ifdim\CF_cram_overlap pt>0pt
+ \CF_warning{Cram base too wide to join}%
+ \else
+ \ifdim\CF_turnangle>0pt % si on tourne à gauche
+ \fill(#2@@)--(\CF_previousnode@@2)--([shift=(\CF_currentangle-90:\pgflinewidth/2)]#2@@)--cycle;
+ \else
+ \fill(#2@@)--(\CF_previousnode@@1)--([shift=(\CF_currentangle+90:\pgflinewidth/2)]#2@@)--cycle;
+ \fi
+ \fi
+ }
+ {%
+ }%
+ \fi
+ \fi
+ \expandafter
+ \endscope
+ \expanded{\def\noexpand\CF_simplebondwidth{\the\dimexpr\pgflinewidth}}% récupère l'épaisseur de ligne si une liaison ">" est à suivre
+ }
+ {%
+ }%
\CF_drawaxisbond{#2}{#3}% trace la liaison simple dans l'axe
\or% 2 = liaison double
\ifCF_in_cycle
@@ -1393,13 +1430,40 @@
\CF_drawaxisbond{#2}{#3}% trace la liaison simple dans l'axe\CF_drawbonda(#2@@)--(#3@@);
\CF_drawbonda(#2@@1)--(#3@@1);
\CF_drawbonda(#2@@2)--(#3@@2);
- \or% 4 = liaison Cram pleine de #2 vers #3
- \CF_createnormnodes{#2@@}{#3@@}{\CF_crambasewidth/2}{}%
- \CF_expafter{\filldraw[}\CF_currentbondstyle,line join=bevel](#2@@1)--(#2@@2)--(#3@@)--cycle;
+ \or% 4 = liaison Cram pleine de #2 vers #3 : >
+ \CF_createnormnodes{#2@@}{#3@@}{\CF_crambasewidth/2}{\pgflinewidth/2}%
+ \CF_ifzerodim\CF_previousatomgroup% nouveau v1.66
+ {%
+ \ifnum\ifboolKV[chemfig]{bond join}10\ifdim\CF_startoffset=0pt 1\fi\ifdim\CF_previous_offset=0pt 1\fi=111
+ \ifnum\CF_previousbondtype=1
+ \CF_turnangle=\CF_compute_turnangle{\CF_previousbondangle}{\CF_currentangle}%
+ \pgfmathsetmacro\CF_cram_overlap{\CF_crambasewidth*cos(\CF_turnangle)-\CF_simplebondwidth}%
+ \ifdim\CF_cram_overlap pt>0pt
+ \CF_warning{Cram base too wide to join}%
+ \else
+ \CF_expafter{\fill[}\CF_currentbondstyle](#2@@1)--([shift=(\CF_previousbondangle\ifdim\CF_turnangle>0pt -\else+\fi90:\CF_simplebondwidth/2)]\CF_previousnode@@)--(#2@@2)--cycle;%
+ \fi
+ \else
+ \ifnum\CF_previousbondtype=5
+ \CF_turnangle=\CF_compute_turnangle{\CF_previousbondangle}{\CF_currentangle}%
+ \CF_expafter{\fill[}\CF_currentbondstyle](#2@@1)--([shift=(\CF_previousbondangle\ifdim\CF_turnangle>0pt -\else+\fi90:\CF_crambasewidth/2)]\CF_previousnode@@)--(#2@@2)--cycle;%
+ \fi
+ \fi
+ \fi
+ }
+ {%
+ }%
+ \ifboolKV[chemfig]{bond join}
+ {\CF_expafter{\fill[}}% pas de contour si liaisons jointes
+ {\CF_expafter{\filldraw[}}
+ \CF_currentbondstyle](#2@@1)--(#2@@2)--(#3@@2)--(#3@@1)--cycle;
\let\CF_joinbond\CF_zero
- \or% 5 = liaison Cram creuse de #3 vers #2
- \CF_createnormnodes{#3@@}{#2@@}{\CF_crambasewidth/2}{}%
- \CF_expafter{\filldraw[}\CF_currentbondstyle,line join=bevel](#3@@1)--(#3@@2)--(#2@@)--cycle;
+ \or% 5 = liaison Cram pleine de #2 vers #3 : <
+ \CF_createnormnodes{#3@@}{#2@@}{\CF_crambasewidth/2}{\pgflinewidth/2}%
+ \ifboolKV[chemfig]{bond join}
+ {\CF_expafter{\fill[}}% pas de contour si liaisons jointes
+ {\CF_expafter{\filldraw[}}
+ \CF_currentbondstyle](#2@@2)--(#2@@1)--(#3@@1)--(#3@@2)--cycle;
\let\CF_joinbond\CF_zero
\or% 6 = liaison Cram pointillée de #2 vers #3
\scope
@@ -1427,12 +1491,22 @@
\CF_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_startoffset\empty
+ \let\CF_previous_offset\CF_endoffset
\let\CF_endoffset\empty
\let\CF_previoustikz\CF_currenttikz
\let\CF_previousbondangle\CF_previousangle
- \def\CF_previousbond{#1}%
+ \edef\CF_previousnode{#3}%
}
+\def\CF_compute_turnangle#1#2{%
+ \expandafter\CF_compute_turnangle_a\the\dimexpr #2pt-#1pt\relax\_nil
+}
+\def\CF_compute_turnangle_a#1\_nil{%
+ \dimexpr#1
+ \ifdim#1<-180pt +360pt\else
+ \ifdim#1>180pt -360pt\fi\fi\relax
+}
+
\def\CF_drawaxisbondnojoin#1#2{\CF_drawbonda(#1@@)--(#2@@);}
\def\CF_drawaxisbondjoin#1#2{% dessine une liaison simple dans l'axe avec raccord rétrograde
@@ -1513,7 +1587,7 @@
\CF_drawbonda(#1@@)--(#2@@);
\fi
\else
- \CF_drawbonda(#1@@)--(#2@@);
+ \CF_drawbonda(#1@@)--(#2@@);%
\fi
}%
\fi
@@ -1669,6 +1743,7 @@
\ifnum\CF_lastaction=2 % s'il faut tracer une liaison
\gdef\CF_cycleanglecorrection{0}% alors c'est qu'un cycle ne peut pas commencer la molécule : annulation de la correction d'angle
\CF_drawbond\CF_bondtype{\CF_bondoutnode}{n\number\CF_cnt_group-\number\CF_cnt_atom}\CF_previousatomgroup\CF_currentatomgroup
+ \let\CF_previousbondtype\CF_bondtype
\fi
\def\CF_lastaction{1}% met la dernière action à 1 : affichage d'un noeud
\loop
@@ -3218,7 +3293,7 @@
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.
+ le style des noeuds dessinés par tikz.
----------------------------------------------------------------------
v0.3 2010/11/21
- Amélioration de \definesubmol qui accepte les séquences de
@@ -3554,4 +3629,8 @@
----------------------------------------------------------------------
v1.6e 2023/06/30
- nouvelle clé "baseline" pour régler finement l'alignement
- vertical d'une molécule
\ No newline at end of file
+ vertical d'une molécule
+----------------------------------------------------------------------
+v1.66 2023/12/28
+ - les liaisons de Cram pleines sont jointes entre elles ou aux
+ liaisons simples lorsque "bond join" est vrai
\ No newline at end of file
More information about the tex-live-commits
mailing list.