From e8020380e9b63f6813e4c1b958bb41b0dc860a78 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 27 Sep 2022 20:32:22 +0000 Subject: chemfig (27sep22) git-svn-id: svn://tug.org/texlive/trunk@64529 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/generic/chemfig/README | 4 +-- .../texmf-dist/doc/generic/chemfig/chemfig-en.pdf | Bin 1123098 -> 1141846 bytes .../texmf-dist/doc/generic/chemfig/chemfig-en.tex | 18 +++++++++++++- .../texmf-dist/doc/generic/chemfig/chemfig-fr.pdf | Bin 1152787 -> 1170720 bytes .../texmf-dist/doc/generic/chemfig/chemfig-fr.tex | 22 ++++++++++++++--- Master/texmf-dist/tex/generic/chemfig/chemfig.tex | 27 ++++++++++++++------- 6 files changed, 56 insertions(+), 15 deletions(-) diff --git a/Master/texmf-dist/doc/generic/chemfig/README b/Master/texmf-dist/doc/generic/chemfig/README index 593d70bf7c7..9613f062ef2 100644 --- a/Master/texmf-dist/doc/generic/chemfig/README +++ b/Master/texmf-dist/doc/generic/chemfig/README @@ -2,9 +2,9 @@ ___________________________________ The Chemfig package - v1.6b + v1.6c - 2021/08/01 + 2022/09/27 ___________________________________ Maintainer: Christian Tellechea diff --git a/Master/texmf-dist/doc/generic/chemfig/chemfig-en.pdf b/Master/texmf-dist/doc/generic/chemfig/chemfig-en.pdf index 0173183489e..0fef2cb8dcd 100644 Binary files a/Master/texmf-dist/doc/generic/chemfig/chemfig-en.pdf and b/Master/texmf-dist/doc/generic/chemfig/chemfig-en.pdf differ diff --git a/Master/texmf-dist/doc/generic/chemfig/chemfig-en.tex b/Master/texmf-dist/doc/generic/chemfig/chemfig-en.tex index 79c40243597..b0b0bf31764 100644 --- a/Master/texmf-dist/doc/generic/chemfig/chemfig-en.tex +++ b/Master/texmf-dist/doc/generic/chemfig/chemfig-en.tex @@ -4,7 +4,6 @@ \usepackage[a4paper,margin=2.5cm,head=17pt,headsep=3mm,footskip=10mm]{geometry} \usepackage[bottom]{footmisc} \usepackage{libertine,amsmath,array,longtable,xspace,fancybox,boites,textcomp,enumitem,chemfig,fancyhdr} -\usepackage[scaled=0.8]{luximono} \usetikzlibrary{decorations.pathmorphing} \usetikzlibrary{decorations.markings} \usetikzlibrary{matrix} @@ -19,6 +18,7 @@ \renewcommand\headrulewidth{0pt} \makeatletter +\usepackage[scaled=0.8]{GoMono} \newcommand\make@car@active[1]{% \catcode`#1\active \begingroup @@ -233,6 +233,14 @@ In this example, a blue arrow starts at atom \verb|n1-3|, which is "C2", and goe \subsection{Token \texttt\# in schemes} In a scheme, the \verb|#| token is now allowed when in the argument of the \verb|\chemfig| macro. See page~\pageref{modif.retrait}. +\subsection{Key gchemname} +This key, true by default, makes the maximum depth assignments made by \verb|\chemnameinit| and \verb|\chemname| global or local. + +\subsection{Keys "schemestart code" and "schemestop code"} +The values (empty by default) contained in these two keys are executed at the very beginning and at the very end of a reaction scheme. They are not executed in nested reaction schemes. + +For example, we can write \verb|schemestart code=\chemnameint{}| to reset the name depth at the beginning of each reaction scheme. + \section{Presenting \protect\CF} To use this package, start by adding the following code to the preamble: \begin{itemize} @@ -297,6 +305,9 @@ Here is the complete list of parameters as well as their default values\label{li \begin{minipage}[t]{.45\linewidth} \begin{longtable}{rl}\hline \chevrons{keys} & default \chevrons{values}\\\hline\endhead + \CFparam{gchemname} + \CFparam{schemestart code} + \CFparam{schemestop code} \CFparam{scheme debug} \CFparam{compound style} \CFparam{compound sep} @@ -948,6 +959,8 @@ In fact, to draw the \Verb-- the command \falseverb{\chemname} inserts 1.5 \item write \verb-\chemnameinit{}- after having written all the names in a chemical reaction lest the greatest depth in this reaction interfere with a future reaction. \end{itemize} +Note that the assignments for the largest depth are global if \CFkv{gchemname}{true}, which is the default behavior. They are local otherwise. + Thus the correct code uses \falseverb{\chemnameinit} before and after the reaction: \exemple*{Name alignment 2}/\chemnameinit{\chemfig{R-C(-[:-30]OH)=[:30]O}} \schemestart @@ -2450,6 +2463,9 @@ The commands created by \CF are: \item \CFkv{+ sep left} {0.5em}: space before the $+$ sign \item \CFkv{+ sep right} {0.5em}: space after the $+$ sign \item \CFkv{+ vshift} {0pt}: vertical shift of the $+$ sign + \item \CFkv{gchemname} {true}: if true, makes the depth assignments made by \verb|chemnameinit| and \verb|chemname| global + \item \CFkv{schemestart code} {}: code executed at the very beginning of a non-nested reaction scheme + \item \CFkv{schemestop code} {}: code executed at the very end of a non-nested reaction scheme \end{itemize} \\ \verb|\resetchemfig|&Reset the parameters to their default values\\ diff --git a/Master/texmf-dist/doc/generic/chemfig/chemfig-fr.pdf b/Master/texmf-dist/doc/generic/chemfig/chemfig-fr.pdf index 1232ef95e0e..06ca3b912df 100644 Binary files a/Master/texmf-dist/doc/generic/chemfig/chemfig-fr.pdf and b/Master/texmf-dist/doc/generic/chemfig/chemfig-fr.pdf differ diff --git a/Master/texmf-dist/doc/generic/chemfig/chemfig-fr.tex b/Master/texmf-dist/doc/generic/chemfig/chemfig-fr.tex index 72fbf7b70c4..918d79ab25b 100644 --- a/Master/texmf-dist/doc/generic/chemfig/chemfig-fr.tex +++ b/Master/texmf-dist/doc/generic/chemfig/chemfig-fr.tex @@ -4,7 +4,6 @@ \usepackage[a4paper,margin=2.5cm,footskip=10mm]{geometry} \usepackage[bottom]{footmisc} \usepackage{libertine,amsmath,array,longtable,xspace,fancybox,boites,textcomp,enumitem,chemfig,fancyhdr,multicol} -\usepackage[scaled=0.8]{luximono} \usetikzlibrary{decorations.pathmorphing} \usetikzlibrary{decorations.markings} \usetikzlibrary{matrix} @@ -19,6 +18,7 @@ \renewcommand\headrulewidth{0pt} \makeatletter +\usepackage[scaled=0.8]{GoMono} \newcommand\make@car@active[1]{% \catcode`#1\active \begingroup @@ -233,6 +233,14 @@ Sur cet exemple, l'atome \verb|n1-3| qui est «C2» est relié par une flèche b \subsection{Token \texttt\# dans les schémas} Dans un schéma réactionnel, le token \verb|#| est désormais permis lorsqu'il se trouve dans l'argument de la commande \verb|\chemfig|. Voir page~\pageref{modif.retrait}. +\subsection{Clé gchemname} +Cette clé, vraie par défaut, rend globales les assignations de profondeur faites par \verb|\chemnameinit| et \verb|\chemname|. + +\subsection{Clés «schemestart code» et «schemestop code»} +Les valeurs, vides par défaut, contenues dans ces deux clés sont exécutées au tout début (immédiatement après le \verb|begingroup|) et à la toute fin (juste avant le \verb|endgroup|) d'un schéma réactionnel. Elles ne sont pas exécutées si le schéma réactionnel est imbriqué dans un autre. + +On peut, par exemple, écrire «\verb|schemestart code=\chemnameint{}|» pour réinitialiser la profondeur des noms au début de chaque schéma réactionnel. + \section{Présentation} Pour charger \CF, il faut écrire : \begin{itemize} @@ -297,6 +305,9 @@ Voici la liste exhaustive des paramètres ainsi que leurs valeurs par défaut\la \begin{minipage}[t]{.45\linewidth} \begin{longtable}{rl}\hline \chevrons{clés} & \chevrons{valeurs} par défaut\\\hline\endhead + \CFparam{gchemname} + \CFparam{schemestart code} + \CFparam{schemestop code} \CFparam{scheme debug} \CFparam{compound style} \CFparam{compound sep} @@ -930,7 +941,7 @@ Voici une réaction avec les noms sous les molécules : \schemestop \chemnameinit{}/ -Il y a quelques contraintes avec cette commande. Pour en pendre conscience, mettons que l'on ait inversé l'acide et l'alcool dans le membre de gauche : +Il y a quelques contraintes avec cette commande. Pour en pendre conscience, supposons que l'on ait inversé l'acide et l'alcool dans le membre de gauche : \exemple*{Alignement des noms 1}/\schemestart \chemname{\chemfig{R'OH}}{Alcool} \+ @@ -948,6 +959,8 @@ En fait, au dessous de la ligne de base de chaque molécule (en gris clair sur l \item d'écrire \verb-\chemnameinit{}- après avoir écrit tous les noms d'une réaction chimique afin d'éviter que la plus grande profondeur trouvée dans cette réaction n'interfère dans une réaction future. \end{itemize} +Il faut noter que les assignations concernant la plus grande profondeur sont globales si \CFkv{gchemname}{true}, ce qui est le comportement par défaut. Elles sont locales sinon. + Le code correct est donc d'utiliser \falseverb{\chemnameinit} avant et après la réaction : \exemple*{Alignement des noms 2}/\chemnameinit{\chemfig{R-C(-[:-30]OH)=[:30]O}} \schemestart @@ -2446,10 +2459,13 @@ Les commandes créées par \CF sont : \item \CFkv{arrow double coeff} {0.6}: coefficient de réduction de la petite flèche pour les flèches doubles \item \CFkv{arrow double harpoon}{true}: booléen pour le tracé des doubles flèches sous forme de «harpon» \item \CFkv{arrow label sep} {3pt}: espacement entre la flèche et son texte - \item \CFkv{arrow head} {-CF}: style des pointes de flèches + \item \CFkv{arrow head} {-CF}: style des pointes de flèches \item \CFkv{+ sep left} {0.5em}: espacement avant le signe $+$ \item \CFkv{+ sep right} {0.5em}: espacement après le signe $+$ \item \CFkv{+ vshift} {0pt}: décalage vertical du signe $+$ + \item \CFkv{gchemname} {true}: si vrai, rend les assignations de profondeur faites par \verb|chemnameinit| et \verb|chemname| globales + \item \CFkv{schemestart code} {}: code exécuté au tout début d'un schéma réactionnel non imbriqué + \item \CFkv{schemestop code} {}: code exécuté à la toute fin d'un schéma réactionnel non imbriqué \end{itemize} \\ \verb|\resetchemfig|&Restaure les paramètres à leurs valeurs par défaut\\ diff --git a/Master/texmf-dist/tex/generic/chemfig/chemfig.tex b/Master/texmf-dist/tex/generic/chemfig/chemfig.tex index ed8948b2eb3..5ebc702d366 100644 --- a/Master/texmf-dist/tex/generic/chemfig/chemfig.tex +++ b/Master/texmf-dist/tex/generic/chemfig/chemfig.tex @@ -4,9 +4,9 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % \def\CFname {chemfig} % -\def\CFver {1.6b} % +\def\CFver {1.6c} % % % -\def\CFdate {2021/08/01} % +\def\CFdate {2022/09/27} % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % @@ -15,9 +15,7 @@ % 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-2021 | +% Copyright : Christian Tellechea 2010-2022 | % Licence : Released under the LaTeX Project Public License v1.3c | % or later, see http://www.latex-project.org/lppl.txt | % Files : 1) chemfig.tex | @@ -406,7 +404,7 @@ stack sep = 1.5pt, autoreset cntcycle = true, show cntcycle = false, - debug =false, + debug = false, scheme debug = false, compound style = {}, compound sep = 5em, @@ -422,6 +420,9 @@ + sep left = 0.5em, + sep right = 0.5em, + vshift = 0pt, + gchemname = true,% ajout de cette clé v1.6c + schemestart code = {},% ajout de cette clé v1.6c + schemestop code = {}% ajout de cette clé v1.6c }% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -1844,9 +1845,9 @@ \def\chemnameinit#1{% \setbox\CF_boxstuff\hbox{#1}% - \xdef\CF_dpmax{\the\dp\CF_boxstuff}% + \ifboolKV[chemfig]{gchemname}\xdef\edef\CF_dpmax{\the\dp\CF_boxstuff}% } -\let\CF_dpmax\CF_zero +\chemnameinit{} \def\CF_parsemolname#1\\#2\_nil{% \hbox to\CF_wdstuffbox{\hss#1\hss}% @@ -1865,7 +1866,9 @@ \setbox\CF_boxstuff\hbox{#2}% \edef\CF_wdstuffbox{\the\wd\CF_boxstuff}\edef\CF_dpstuffbox{\the\dp\CF_boxstuff}% \leavevmode - \ifdim\CF_dpmax<\CF_dpstuffbox\global\let\CF_dpmax\CF_dpstuffbox\fi + \ifdim\CF_dpmax<\CF_dpstuffbox + \ifboolKV[chemfig]{gchemname}\global{}\let\CF_dpmax\CF_dpstuffbox + \fi \vtop{% \box\CF_boxstuff \nointerlineskip @@ -1943,6 +1946,7 @@ \def\schemestart{% \begingroup + \ifnum\CF_schemenest=0 \expandafter\CF_id\else\expandafter\CF_gobarg\fi{\useKV[chemfig]{schemestart code}}% \xdef\CF_schemenest{\number\numexpr\CF_schemenest+1}% \CF_testopt\CF_schemestarta{}% } @@ -2067,6 +2071,7 @@ \CF_directarrowlist \endtikzpicture \xdef\CF_schemenest{\number\numexpr\CF_schemenest-1}% + \ifnum\CF_schemenest=0 \expandafter\CF_id\else\expandafter\CF_gobarg\fi{\useKV[chemfig]{schemestop code}}% \endgroup } @@ -3049,3 +3054,7 @@ v1.6b 2021/08/01 - encodage UTF-8 - la macro \# n'était pas définie pour remplacer «#(...)» lorsque \chemfig se trouve dans l'argument d'une macro. +---------------------------------------------------------------------- +v1.6c 2022/09/27 + - nouvelles clés "gchemname", "schemestart code" et + "schemestop code" (suggestion de Balazs Debreceni) \ No newline at end of file -- cgit v1.2.3