summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-04-25 23:53:11 +0000
committerKarl Berry <karl@freefriends.org>2011-04-25 23:53:11 +0000
commitfa970c2346fbb2a938fc0cbddf2aeec1e111c993 (patch)
treeb3d58fd5e9d7bcf8a66ec61b0e634e3a8a9c1591
parent634ddfa7204fe5e21548eda9e1e2f7cbd0238fe3 (diff)
chemfig (25apr11)
git-svn-id: svn://tug.org/texlive/trunk@22205 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/generic/chemfig/chemfig_doc_en.pdfbin1116388 -> 1117107 bytes
-rw-r--r--Master/texmf-dist/doc/generic/chemfig/chemfig_doc_en.tex35
-rw-r--r--Master/texmf-dist/doc/generic/chemfig/chemfig_doc_fr.pdfbin1138953 -> 1140438 bytes
-rw-r--r--Master/texmf-dist/doc/generic/chemfig/chemfig_doc_fr.tex35
-rw-r--r--Master/texmf-dist/tex/generic/chemfig/chemfig.sty4
-rw-r--r--Master/texmf-dist/tex/generic/chemfig/chemfig.tex158
-rw-r--r--Master/texmf-dist/tex/generic/chemfig/t-chemfig.tex6
7 files changed, 120 insertions, 118 deletions
diff --git a/Master/texmf-dist/doc/generic/chemfig/chemfig_doc_en.pdf b/Master/texmf-dist/doc/generic/chemfig/chemfig_doc_en.pdf
index 46963d23523..f7fa601944b 100644
--- a/Master/texmf-dist/doc/generic/chemfig/chemfig_doc_en.pdf
+++ b/Master/texmf-dist/doc/generic/chemfig/chemfig_doc_en.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/generic/chemfig/chemfig_doc_en.tex b/Master/texmf-dist/doc/generic/chemfig/chemfig_doc_en.tex
index b83578545d2..c02a4121e69 100644
--- a/Master/texmf-dist/doc/generic/chemfig/chemfig_doc_en.tex
+++ b/Master/texmf-dist/doc/generic/chemfig/chemfig_doc_en.tex
@@ -1,11 +1,11 @@
-% _________________________________________________________________
-% | |
-% | |
-% | ChemFig Documentation |
-% | |
-% | April 10, 2011 |
-% | |
-% |_________________________________________________________________|
+% __________________________________________________________________
+% | |
+% | |
+% | ChemFig Documentation |
+% | |
+% | April 24, 2011 |
+% | |
+% |__________________________________________________________________|
%
% This is chemfig_doc_en.tex, the LaTeX code of the chemfig English
% documentation. Translation by Theo Hopman (hopman.theo@gmail.com).
@@ -286,11 +286,13 @@ delim_2 "\\dotfill"
\setitemize{leftmargin=3em,topsep=0pt,parsep=0pt,itemsep=0pt}
\part{Introduction}
-\section{New in version 0.3}
-Here's what's new in version 0.4:
+\section{New in version 0.4b}
+Here's what's new in version 0.4b:
\begin{enumerate}
- \item The code is now written in plain $\varepsilon$\TeX\idx*{etex@$\protect\varepsilon$\protect\TeX}. Therefore, the package may be used with \LaTeX{}\idx*{Latex@\protect\LaTeX} or Con\TeX{}t\idx*{ConTeXt@Con\protect\TeX{}t}.
- \item Bugfixes.
+ \item the argument of the \verb-\chemfig- command is no longer dependent of the \idx{catcode} regime. Therefore, the \verb-\chemfig- command can be put inside arguments of macros, even if the molecule code contains characters with an active catcode like ``\verb-~-''. It is now possible to write\footnote{The \texttt{\string\protect} command makes \texttt{\string\chemfig} robust, i.e. able to be stored without being altered by \texttt{\string\section} and reused later, especially in the table of content.} in a \LaTeX{} document something like:\par\verb-\section{The molecule \protect\chemfig{N~N}}-.
+
+ ``\verb-#-'' is the exception to this rule. In order to put in an argument of a macro the command \verb-\chemfig- with a molecule code containing \verb-# -, you must wrap it between ``\verb-\catcode`\#=12-'' and ``\verb-\catcode`\#=6-''.
+ \item The new \idx{\setbondstyle} command sets the style of the bonds, see page~\pageref{setbondstyle}.
\end{enumerate}
\section{Foreword}
@@ -548,6 +550,10 @@ Therefore the first group of atoms ``$\mathrm{H_3C}$'' is split into two atoms:
If one bond is followed immediately by another, then \CF inserts an empty group \verb-{}-. Around this empty group the separation $\delta$ is zero:
\exemple{Empty groups}/\chemfig{A-B=-=C}/
+\label{setbondstyle}\idx*{\setbondstyle}The \verb-\setbondstyle{<tikz code>}- command sets the style for all the bonds drawn thereafter. The \verb-<tikz code>- is empty by default. To custom a single bond, see page~\pageref{perso-liaisons}.
+\exemple{Style of bonds}/\setbondstyle{line width=1pt,red}
+\chemfig{A-B=C>|D<E>:F}/
+
\label{modif.retrait} The spacing $\delta$ for just one bond can be specified with the character \verb-#-\idx*{\protect\symbol{'043}@\protect\texttt{\protect\symbol{'043}}}. This character must be placed \emph{immediately} after the bond symbol and has one required argument between parentheses of the form ``\verb-#(<dim1>,<dim2>)-'', where \verb-<dim1>- is the spacing $\delta$ at the beginning of the bond and \verb-<dim2>- is the that at the end. If \verb-<dim2>- is omitted, the spacing at the end of the bond takes the value of $\delta$ in effect at that time. One can see in the example how the shortening, set to 4pt to be more visible, is nullified for the bond arriving at ``B'', then for the one leaving ``B'', and finally for both:
\begingroup
\catcode`\#12
@@ -648,7 +654,7 @@ where \verb-<integer 1>- and \verb-<integer 2>- are the numbers of the desired d
\chemfig{ABCD-[:75,,,2]EFG}\qquad
\chemfig{ABCD-[:75,,3,2]EFG}|
-\section{Customization of bonds}
+\section{Customization of bonds}\label{perso-liaisons}
\idx*{bond!customization}There is a fifth and last optional argument for bonds which is found after the fourth comma:
\centerverb/[,,,,<tikz code>]/
\smallskip
@@ -1675,6 +1681,7 @@ The commands created by \CF are:
\verb-\chemfig<code>-\idx*\chemfig& draws the molecule whose design is described by the \verb-<code>-\\
\verb-\printatom-\idx*\printatom& displays the atoms within the molecules. It can be redefined to customize the output. See page~\pageref{perso.affichage}\\
\verb-\setnodestyle{<style tikz>}-\idx*\setnodestyle& using \TIKZ syntax, this macro defines the style of nodes containing the atoms. See page~\pageref{style.noeuds}\\
+\verb-\setbondestyle{<style tikz>}-\idx*\setbondstyle& with the \TIKZ syntax, this macro defines the style of the bonds. See~\pageref{setbondstyle}\\
\idx\hflipnext&the next molecule will be horizontally flipped\\
\idx\vflipnext&the next molecule will be vertically flipped\\
\verb-\definesubmol{<name>}[code1]{<code2>}-\idx*\definesubmol& creates an alias \verb-!<nom>- which can be put in the code of molecules to be drawn, and which will be replaced with \verb-<code1>- or \verb-<code2>- depending on the angle of the last bond. See page~\pageref{definesubmol}\\
@@ -1731,7 +1738,7 @@ $\star\quad\star$
\idx*\definesubmol
\exemple*{Stearine, skeleton diagram}/\definesubmol{x}{-[:+30,.6]-[:-30,.6]}
\definesubmol{y}{-O-(=[2,.6]O)-!x!x!x!x!x!x!x!x}
-\chemfig{[2](!y)-[,1.5](!y)-[,1.5](!y)}/
+\chemfig{[2]([0]!y)-[,1.5]([0]!y)-[,1.5]([0]!y)}/
\exemple*{Methyl 2-methylpropanoate}/\chemfig{H_3C-CH_2(-[2]CH_3)-C(=[1]O)-[7]O-CH_3}/
diff --git a/Master/texmf-dist/doc/generic/chemfig/chemfig_doc_fr.pdf b/Master/texmf-dist/doc/generic/chemfig/chemfig_doc_fr.pdf
index 14a81b35887..88cbaffa998 100644
--- a/Master/texmf-dist/doc/generic/chemfig/chemfig_doc_fr.pdf
+++ b/Master/texmf-dist/doc/generic/chemfig/chemfig_doc_fr.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/generic/chemfig/chemfig_doc_fr.tex b/Master/texmf-dist/doc/generic/chemfig/chemfig_doc_fr.tex
index e6d29a6564b..c92c6990af9 100644
--- a/Master/texmf-dist/doc/generic/chemfig/chemfig_doc_fr.tex
+++ b/Master/texmf-dist/doc/generic/chemfig/chemfig_doc_fr.tex
@@ -1,11 +1,11 @@
-% _________________________________________________________________
-% | |
-% | |
-% | Documentation de ChemFig |
-% | |
-% | 10 avril 2011 |
-% | |
-% |_________________________________________________________________|
+% __________________________________________________________________
+% | |
+% | |
+% | Documentation de ChemFig |
+% | |
+% | 24 avril 2011 |
+% | |
+% |__________________________________________________________________|
%
% Ceci est chemfig_doc_fr.tex, le code LaTeX de la documentation en
% français de chemfig.
@@ -286,11 +286,13 @@ delim_2 "\\dotfill"
\setitemize{leftmargin=3em,topsep=0pt,parsep=0pt,itemsep=0pt,label=--}
\part{Introduction}
-\section{Nouveautés de la version 0.4}
-Voici les nouveautés de la version 0.4 :
+\section{Nouveautés de la version 0.4b}
+Voici les nouveautés de la version 0.4b :
\begin{enumerate}
- \item Le code a été ré-écrit en plain $\varepsilon$\TeX\idx*{etex@$\protect\varepsilon$\protect\TeX}. L'extention est donc utilisable avec \LaTeX{}\idx*{Latex@\protect\LaTeX} et avec Con\TeX{}t\idx*{ConTeXt@Con\protect\TeX{}t}.;
- \item Corrections de bugs.
+ \item l'argument de la commande \verb-\chemfig- n'est plus sensible au régime courant des \idx{codes de catégories}. Par conséquent, la commande \verb-\chemfig- peut se trouver dans l'argument d'autres macros, même lorsque le code de la molécule contient des caractères ayant des codes de catégorie non inoffensifs : \verb-~-, \verb-!- ou \verb-?-. On peut donc sans problème écrire\footnote{La commande \texttt{\string\protect} ne sert ici qu'à rendre la commande \texttt{\string\chemfig} \emph{robuste}, c'est-à-dire capable d'être sauvegardée et conservée intacte par \texttt{\string\section} pour être réutilisée plus tard, dans la table des matières notamment.} dans un document \LaTeX : \verb-\section{La molécule \protect\chemfig{N~N}}-.
+
+ Seul \og\verb-#-\fg{} est l'exception à cette règle. Pour mettre dans l'argument d'une macro la commande \texttt{\string\chemfig} dont le code de la molécule contient le caractère \verb-#-, il faut faire précéder le tout de \og\verb-\catcode`\#=12-\fg{} et le faire suivre de \og\verb-\catcode`\#=6-\fg.
+ \item La commande \idx{\setbondstyle} permet de régler le style des liaisons, voir page~\pageref{setbondstyle}.
\end{enumerate}
\section{Avant propos}
@@ -548,6 +550,10 @@ Par conséquent, le premier groupe d'atomes ``$\mathrm{H_3C}$'' est découpé en
Si deux liaisons se suivent, alors \CF insère un groupe vide \verb-{}-, et autour de ce groupe vide, l'espacement $\delta$ est nul :
\exemple{Groupes vides}/\chemfig{A-B=-=C}/
+\label{setbondstyle}\idx*{\setbondstyle}La commande \verb-\setbondstyle{<code tikz>}- définit le style de toutes les liaisons qui seront dessinées par la suite. Le \verb-<code tikz>- est vide par défaut. Pour personnaliser les liaisons une par une, voir page~\pageref{perso-liaisons}.
+\exemple{Style des liaisons}/\setbondstyle{line width=1pt,red}
+\chemfig{A-B=C>|D<E>:F}/
+
\label{modif.retrait}On peut spécifier l'espacement $\delta$ pour une seule liaison avec le caractère \verb-#-\idx*{\protect\symbol{'043}@\protect\texttt{\protect\symbol{'043}}}. Ce caractère doit se situer \emph{immédiatement} après le signe de liaison et dispose d'un argument obligatoire entre parenthèses de la forme ``\verb-#(<dim1>,<dim2>)-'', où \verb-<dim1>- représente l'espacement $\delta$ au début de la liaison et \verb-<dim2>- celui de la fin. Si \verb-<dim2>- est omis, l'espacement en fin de liaison prend la valeur de $\delta$ en vigueur à ce moment. On peut observer sur cet exemple comment le retrait, réglé à 4pt pour être plus visible, est rendu nul pour la liaison arrivant sur ``B'', puis partant de ``B'' et enfin pour les deux à la fois :
\begingroup
\catcode`\#12
@@ -648,7 +654,7 @@ où \verb-<entier 1>- et \verb-<entier 2>- sont les numéros des atomes de dépa
\chemfig{ABCD-[:75,,,2]EFG}\qquad
\chemfig{ABCD-[:75,,3,2]EFG}|
-\section{Personnalisation des liaisons}
+\section{Personnalisation des liaisons}\label{perso-liaisons}
\idx*{liaison!personnalisation}Il existe un 5\ieme{} et dernier argument optionnel pour les liaisons qui se trouve à droite de la 4\ieme{} virgule :
\centerverb/[,,,,<code tikz>]/
\smallskip
@@ -1675,6 +1681,7 @@ Les commandes créées par \CF sont :
\verb-\chemfig<code>-\idx*\chemfig&dessine la molécule dont le dessin est décrit par le \verb-<code>-\\
\verb-\printatom-\idx*\printatom & cette macro affiche les atomes dans les molécules. Elle peut être redéfinie pour personnaliser l'affichage, voir~\pageref{perso.affichage}\\
\verb-\setnodestyle{<style tikz>}-\idx*\setnodestyle& à l'aide de la syntaxe de \TIKZ, cette macro définit le style de nœuds contenant les atomes, voir~\pageref{style.noeuds}\\
+\verb-\setbondestyle{<style tikz>}-\idx*\setbondstyle& à l'aide de la syntaxe de \TIKZ, cette macro définit le style des liaisons voir~\pageref{setbondstyle}\\
\verb-\hflipnext-\idx*\hflipnext&la prochaine molécule sera inversée horizontalement\\
\verb-\vflipnext-\idx*\vflipnext&la prochaine molécule sera inversée verticalement\\
\verb-\definesubmol{<nom>}[code1]{<code2>}-\idx*\definesubmol & créé un alias \verb-!<nom>- que l'on peut placer dans le code des molécules à dessiner qui remplace le \verb-<code1>- ou le \verb-<code2>- selon l'inclinaison de la dernière liaison. Voir page~\pageref{definesubmol}\\
@@ -1731,7 +1738,7 @@ $\star\quad\star$
\idx*\definesubmol
\exemple*{Stéarine, formule topologique}/\definesubmol{x}{-[:+30,.6]-[:-30,.6]}
\definesubmol{y}{-O-(=[2,.6]O)-!x!x!x!x!x!x!x!x}
-\chemfig{[2](!y)-[,1.5](!y)-[,1.5](!y)}/
+\chemfig{[2]([0]!y)-[,1.5]([0]!y)-[,1.5]([0]!y)}/
\exemple*{2-méthylpropanoate de méthyl}/\chemfig{H_3C-CH_2(-[2]CH_3)-C(=[1]O)-[7]O-CH_3}/
diff --git a/Master/texmf-dist/tex/generic/chemfig/chemfig.sty b/Master/texmf-dist/tex/generic/chemfig/chemfig.sty
index 5111fdd5966..85c3a9269c0 100644
--- a/Master/texmf-dist/tex/generic/chemfig/chemfig.sty
+++ b/Master/texmf-dist/tex/generic/chemfig/chemfig.sty
@@ -1,9 +1,9 @@
% __________________________________________________________________
% | |
% | |
-% | chemfig v0.4a |
+% | chemfig v0.4b |
% | |
-% | April 10, 2011 |
+% | April 24, 2011 |
% | |
% |__________________________________________________________________|
%
diff --git a/Master/texmf-dist/tex/generic/chemfig/chemfig.tex b/Master/texmf-dist/tex/generic/chemfig/chemfig.tex
index 1ac9f1c5ef3..11a90945caf 100644
--- a/Master/texmf-dist/tex/generic/chemfig/chemfig.tex
+++ b/Master/texmf-dist/tex/generic/chemfig/chemfig.tex
@@ -1,9 +1,9 @@
% __________________________________________________________________
% | |
% | |
-% | chemfig v0.4a |
+% | chemfig v0.4b |
% | |
-% | April 10, 2011 |
+% | April 24, 2011 |
% | |
% |__________________________________________________________________|
%
@@ -39,12 +39,10 @@
%
% The Current Maintainer of this work is Christian Tellechea
% --------------------------------------------------------------------
-%
-% Sauvegarde tous les catcodes des caract\`eres sp\'eciaux sauf #
+% Sauvegarde tous les catcodes des caract\`eres sp\'eciaux sauf #
\begingroup
\def\X#1{\catcode\number`#1=\number\catcode`#1\relax}
-% Sauve tous les catcode sauf #
\expandafter\xdef\csname CF@savedcatcode\endcsname{%
\X\[\X\]\X\:\X\(\X\)\X\,\X\-\X\=\X\~\X\!\X\?\X\<\X\>\X\;\X\*\X\|\X\@%
}
@@ -55,7 +53,7 @@
\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`\@11 \catcode`\#6 \catcode`\ 10
\def\CF@def#1{%
\ifdefined#1%
@@ -64,10 +62,10 @@
\def#1%
}
-\CF@def\CF@ver {0.4a}
-\CF@def\CF@date {2011/04/10}
-\CF@def\CF@fr@date {10 avril 2011}
-\CF@def\CF@en@date {April 10, 2011}
+\CF@def\CF@ver {0.4b}
+\CF@def\CF@date {2011/04/24}
+\CF@def\CF@fr@date {24 avril 2011}
+\CF@def\CF@en@date {April 24, 2011}
\CF@def\CF@package@name{chemfig}
\expandafter\ifx\csname @latexerr\endcsname\relax% on n'utilise pas LaTeX ?
@@ -128,33 +126,11 @@
\newwrite\CF@unused
-\CF@def\CF@specialchar@list{\[\]\:\(\)\,\-\=\~\!\?\<\>\;\*\|\#\@}
-
\CF@def\CF@sanitize@catcode{%
- \expandafter\CF@sanitize@catcode@i\expandafter{\CF@specialchar@list}%
-}
-
-\CF@def\CF@sanitize@catcode@i#1{%
- \ifx\@empty#1\@empty
- \else
- \expandafter\@makeother\@car#1\@nil
- \CF@swap@fi
- \expandafter\CF@sanitize@catcode@i\expandafter{\@gobble#1}%
- \fi
-}
-
-\CF@def\CF@save@catcode{%
- \let\CF@restore@catcode\@empty
- \expandafter\CF@save@catcode@i\expandafter{\CF@specialchar@list}%
-}
-
-\CF@def\CF@save@catcode@i#1{%
- \ifx\@empty#1\@empty
- \else
- \CF@edefadd@tocs\CF@restore@catcode{\catcode`\expandafter\noexpand\@car#1\@nil=\number\expandafter\catcode\expandafter`\@car#1\@nil\noexpand\space}%
- \CF@swap@fi
- \expandafter\CF@save@catcode@i\expandafter{\@gobble#1}%
- \fi
+ \@makeother\[\@makeother\]\@makeother\:\@makeother\(\@makeother\)%
+ \@makeother\,\@makeother\-\@makeother\=\@makeother\~\@makeother\!%
+ \@makeother\?\@makeother\<\@makeother\>\@makeother\;\@makeother\*%
+ \@makeother\|\@makeother\#\@makeother\@%
}
\CF@def\CF@node@content{\expandafter\printatom\expandafter{\csname atom@\number\CF@cnt@atomnumber\endcsname\CF@node@strut}}
@@ -312,7 +288,7 @@
\expandafter\CF@add@tocs\expandafter#1\expandafter{\CF@tmp@str}%
}
-\CF@def\CF@if@firsttokmatch#1#2{% est ce que #1 et #2 commencent par les mêmes tokens ?
+\CF@def\CF@if@firsttokmatch#1#2{% est ce que #1 et #2 commencent par les m\^emes tokens ?
\futurelet\CF@toks@a\CF@gobble@tonil#1\relax\@nil
\futurelet\CF@toks@b\CF@gobble@tonil#2\relax\@nil
\ifx\CF@toks@a\CF@toks@b\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
@@ -597,7 +573,8 @@
}
\CF@def\CF@chemfig@iii#1{%
- \CF@chemfig@iv{#1}%
+ \expandafter\assign@tonil\expandafter\CF@remain@molecule\scantokens{#1}%
+ \expandafter\CF@chemfig@iv\expandafter{\CF@remain@molecule}%
\endtikzpicture
\let\CF@split@state\z@
}
@@ -617,8 +594,10 @@
\let\CF@default@stringangle\@empty
\fi
\let\CF@current@angle\CF@default@angle
- \if[\expandafter\noexpand\@car#1\@nil
- \CF@analyse@optarg#1\@nil\CF@remain@molecule
+ \def\CF@remain@molecule{#1}%
+ \CF@seek@submol% alias en premier ?
+ \if[\expandafter\expandafter\expandafter\noexpand\expandafter\@car\CF@remain@molecule\@nil
+ \expandafter\CF@analyse@optarg\CF@remain@molecule\@nil\CF@remain@molecule
\expandafter\CF@set@bondangle\expandafter{\CF@current@stringangle}\CF@current@angle
\let\CF@default@angle\CF@current@angle
\let\CF@previous@angle\CF@current@angle
@@ -627,9 +606,8 @@
\unless\ifx\@empty\CF@current@fromatom\let\CF@default@fromatom\CF@current@fromatom\fi
\unless\ifx\@empty\CF@current@toatom\let\CF@default@toatom\CF@current@toatom\fi
\unless\ifx\@empty\CF@current@tikz\let\CF@default@tikz\CF@current@tikz\fi
- \else
- \def\CF@remain@molecule{#1}% on prend tout puisque pas d'argument optionnel au d\'ebut
- \fi% apr\`es l'argument entre crochet au d\'ebut, on passe \`a la suite
+ \CF@seek@submol
+ \fi
\ifCF@incycle% si on commence un cycle
\let\CF@current@angle\CF@previous@angle
\else
@@ -842,21 +820,17 @@
\pgfmathparse{(\CF@dimbx-\CF@dimax)/\CF@len@vector}\let\CF@norm@y\pgfmathresult
}
+\CF@def\CF@set@offset#1#2{%
+ \ifx#1\@empty
+ \edef#1{\ifx#2\CF@empty@node0pt\else\ifx#2\@empty0pt\else\CF@bond@offset\fi\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
- \edef\CF@start@offset{%
- \ifx\CF@start@offset\@empty
- \ifx#4\CF@empty@node0pt\else\ifx#4\@empty0pt\else\CF@bond@offset\fi\fi
- \else
- \CF@start@offset
- \fi
- }%
- \edef\CF@end@offset{%
- \ifx\CF@end@offset\@empty
- \ifx#5\CF@empty@node0pt\else\ifx#5\@empty0pt\else\CF@bond@offset\fi\fi
- \else
- \CF@end@offset
- \fi
- }%
+ \CF@set@offset\CF@start@offset#4%
+ \CF@set@offset\CF@end@offset#5%
+ \let\CF@current@bondstyle\CF@bond@style
+ \unless\ifx\CF@current@tikz\@empty\CF@expadd@tocs\CF@current@bondstyle{\expandafter,\CF@current@tikz}\fi
\path(#2)--(#3)coordinate[pos=0](#2@)coordinate[pos=1](#3@);%
\CF@compute@nodevect{#2@}{#3@}%
\pgfmathparse{\CF@start@offset/\CF@len@vector}\let\CF@start@coeff\pgfmathresult
@@ -875,6 +849,9 @@
\ifnum\CF@doublebond@type=\z@
\let\CF@doublebond@type\@ne
\fi
+ \ifnum\CF@split@state>\z@
+ \let\CF@doublebond@type\tw@
+ \fi
\pgfmathparse{\CF@double@sep*tan(180/\CF@cycle@num)}%
\let\CF@doublebond@lengthcorrection\pgfmathresult
\fi
@@ -888,10 +865,10 @@
\begingroup% ajuste \'eventuellement les longueurs des liaisons doubles
\ifCF@incycle
\ifdim\CF@start@offset=\z@
- \CF@add@tocs\CF@current@tikz{,shorten <=\CF@doublebond@lengthcorrection pt}%
+ \CF@edefadd@tocs\CF@current@bondstyle{,shorten <=\CF@doublebond@lengthcorrection pt}%
\fi
\ifdim\CF@end@offset=\z@
- \CF@add@tocs\CF@current@tikz{,shorten >=\CF@doublebond@lengthcorrection pt}%
+ \CF@edefadd@tocs\CF@current@bondstyle{,shorten >=\CF@doublebond@lengthcorrection pt}%
\fi
\fi
\CF@draw@bond@i(#2@@1)--(#3@@1);
@@ -902,10 +879,10 @@
\begingroup% ajuste \'eventuellement les longueurs des liaisons doubles
\ifCF@incycle
\ifdim\CF@start@offset=\z@
- \CF@add@tocs\CF@current@tikz{,shorten <=-\CF@doublebond@lengthcorrection pt}%
+ \CF@edefadd@tocs\CF@current@bondstyle{,shorten \ifnum\CF@split@state=\z@<=-\else>=\fi\CF@doublebond@lengthcorrection pt}%
\fi
\ifdim\CF@end@offset=\z@
- \CF@add@tocs\CF@current@tikz{,shorten >=-\CF@doublebond@lengthcorrection pt}%
+ \CF@edefadd@tocs\CF@current@bondstyle{,shorten \ifnum\CF@split@state=\z@>=-\else<=\fi\CF@doublebond@lengthcorrection pt}%
\fi
\fi
\CF@draw@bond@i(#2@@2)--(#3@@2);
@@ -918,28 +895,28 @@
\CF@draw@bond@i(#2@@2)--(#3@@2);
\or% 4 = liaison Cram pleine de #2 vers #3
\CF@create@normnodes{#2@@}{#3@@}{\CF@cram@basewidth/2}{}%
- \expandafter\filldraw\expandafter[\CF@current@tikz,line join=bevel](#2@@1)--(#2@@2)--(#3@@)--(#2@@1);
+ \expandafter\filldraw\expandafter[\CF@current@bondstyle,line join=bevel](#2@@1)--(#2@@2)--(#3@@)--(#2@@1);
\or% 5 = liaison Cram pleine de #3 vers #2
\CF@create@normnodes{#3@@}{#2@@}{\CF@cram@basewidth/2}{}%
- \expandafter\filldraw\expandafter[\CF@current@tikz,line join=bevel](#3@@1)--(#3@@2)--(#2@@)--(#3@@1);
+ \expandafter\filldraw\expandafter[\CF@current@bondstyle,line join=bevel](#3@@1)--(#3@@2)--(#2@@)--(#3@@1);
\or% 6 = liaison Cram pointill\'ee de #2 vers #3
\scope
\CF@create@normnodes{#2@@}{#3@@}{\CF@cram@basewidth/2}{}%
\clip(#2@@1)--(#2@@2)--(#3@@)--(#2@@1);
- \expandafter\draw\expandafter[\CF@current@tikz,dash pattern=on \CF@cram@dashlength off \CF@cram@dashsep,line width=\CF@cram@basewidth](#2@@)--(#3@@);
+ \expandafter\draw\expandafter[\CF@current@bondstyle,dash pattern=on \CF@cram@dashlength off \CF@cram@dashsep,line width=\CF@cram@basewidth](#2@@)--(#3@@);
\endscope
\or% 7 = liaison Cram pointill\'ee de #3 vers #2
\scope
\CF@create@normnodes{#3@@}{#2@@}{\CF@cram@basewidth/2}{}%
\clip(#3@@1)--(#3@@2)--(#2@@)--(#3@@1);
- \expandafter\draw\expandafter[\CF@current@tikz,dash pattern=on \CF@cram@dashlength off \CF@cram@dashsep,line width=\CF@cram@basewidth](#3@@)--(#2@@);
+ \expandafter\draw\expandafter[\CF@current@bondstyle,dash pattern=on \CF@cram@dashlength off \CF@cram@dashsep,line width=\CF@cram@basewidth](#3@@)--(#2@@);
\endscope
\or% 8 = liaison Cram triangle \'evid\'e de #2 vers #3
\CF@create@normnodes{#2@@}{#3@@}{\CF@cram@basewidth/2}{}%
- \expandafter\draw\expandafter[\CF@current@tikz,line join=bevel](#2@@1)--(#2@@2)--(#3@@)--(#2@@1);
+ \expandafter\draw\expandafter[\CF@current@bondstyle,line join=bevel](#2@@1)--(#2@@2)--(#3@@)--(#2@@1);
\or% 9 = liaison Cram triangle \'evid\'e de #3 vers #1
\CF@create@normnodes{#3@@}{#2@@}{\CF@cram@basewidth/2}{}%
- \expandafter\draw\expandafter[\CF@current@tikz,line join=bevel](#3@@1)--(#3@@2)--(#2@@)--(#3@@1);
+ \expandafter\draw\expandafter[\CF@current@bondstyle,line join=bevel](#3@@1)--(#3@@2)--(#2@@)--(#3@@1);
\else
\errmessage{Package \CF@package@name\space Error: unknown bond type, this error should not occur^^JIf you think it's a bug, send a Minimal Example to the author}%
\fi
@@ -947,7 +924,7 @@
\let\CF@end@offset\@empty
}
-\CF@def\CF@draw@bond@i{\expandafter\draw\expandafter[\CF@current@tikz]}
+\CF@def\CF@draw@bond@i{\expandafter\draw\expandafter[\CF@current@bondstyle]}
\CF@def\CF@hook@drawall{% dessine tous les crochets contenus dansla sc \CF@hook@draw
\unless\ifx\CF@hook@drawlist\@empty
@@ -974,6 +951,9 @@
\CF@def\setnodestyle{\def\CF@node@style}
\setnodestyle{}
+\CF@def\setbondstyle{\def\CF@bond@style}
+\setbondstyle{}
+
\expandafter\CF@def\expandafter\CF@gobble@movearg\string @#1#2\@nil#3%
{%
\expandafter\def\csname atom@\number\CF@cnt@atomnumber\endcsname{#2}%
@@ -1011,7 +991,7 @@
\ifx\@empty#2\@empty%
\else
\ifnum#2<\@ne
- \immediate\write\CF@unused{Package \CF@package@name\space Warning: no atom found at position #2.^^JPershaps you mispelled the optional argument of the bond on input line \the\inputlineno.}%
+ \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.}%
\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.}%
@@ -1019,7 +999,7 @@
\fi
\fi
\edef\CF@hook@atomnumber{%
- \ifx\@empty#2\@empty%\relax
+ \ifx\@empty#2\@empty
\ifdim#1pt>90pt
\ifdim#1pt<270pt \number\CF@cnt@atomingroup\else1\fi
\else1%
@@ -1300,7 +1280,8 @@
\endgroup
}
-\CF@def\chembelow{\CF@save@catcode\CF@sanitize@catcode\@testopt\CF@chembelow{1.5pt}}
+\CF@def\chembelow{%
+ \@testopt\CF@chembelow{1.5pt}}
\CF@def\CF@chembelow[#1]#2#3{%
\setbox\CF@box@boxa\hbox{\printatom{#2}}\setbox\CF@box@boxb\hbox{\printatom{#3}}%
@@ -1314,10 +1295,10 @@
}%
\vskip-\dimexpr\ht\CF@box@boxb+\dp\CF@box@boxb+#1\relax
}%
- \CF@restore@catcode
}
-\CF@def\chemabove{\CF@save@catcode\CF@sanitize@catcode\@testopt\CF@chemabove{1.5pt}}
+\CF@def\chemabove{%
+ \@testopt\CF@chemabove{1.5pt}}
\CF@def\CF@chemabove[#1]#2#3{%
\setbox\CF@box@boxa\hbox{\printatom{#2}}\setbox\CF@box@boxb\hbox{\printatom{#3}}%
@@ -1330,7 +1311,6 @@
\hskip\dimexpr(\wd\CF@box@boxa-\wd\CF@box@boxb)/\tw@
}%
}%
- \CF@restore@catcode
}
%%%%%% les signes et les fl\`eches
@@ -1346,7 +1326,8 @@
\setchemrel{}{}{}
-\CF@def\chemrel{\CF@save@catcode\CF@sanitize@catcode\@testopt\CF@chemchemrel@i{}}
+\CF@def\chemrel{%
+ \@testopt\CF@chemchemrel@i{}}
\CF@def\CF@chemchemrel@i[#1]{\@testopt{\CF@chemchemrel@ii[#1]}{}}
@@ -1375,12 +1356,12 @@
\else\chemabove[\CF@chemrel@vsep]{\chembelow[\CF@chemrel@vsep]\CF@chemrel@stuff{\hbox{#2}}}{\hbox{#1}}%
\fi
\fi
- \CF@restore@catcode
}
\CF@def\CF@remove@equichars#1<>#2\@nil{#1#2}
-\CF@def\chemmove{\CF@save@catcode\CF@sanitize@catcode\@testopt\CF@chemmove{}}
+\CF@def\chemmove{%
+ \@testopt\CF@chemmove{}}
\CF@def\CF@chemmove[#1]#2{%
\ifx\@empty#2\@empty
@@ -1392,14 +1373,11 @@
{\z@[remember picture,overlay]}{\z@[remember picture,overlay,#1]}#2
\endtikzpicture
}%
- \CF@restore@catcode
}
\CF@def\chemnameinit#1{%
- \CF@save@catcode\CF@sanitize@catcode
\setbox\CF@stuff@box\hbox{#1}%
\edef\CF@dp@max{\the\dp\CF@stuff@box}%
- \CF@restore@catcode
}
\chemnameinit{}
@@ -1412,7 +1390,9 @@
\fi
}
-\CF@def\chemname{\CF@save@catcode\CF@sanitize@catcode\@testopt\CF@chemname{1.5ex}}
+\CF@def\chemname{%
+ \@testopt\CF@chemname{1.5ex}%
+}
\CF@def\CF@chemname[#1]#2#3{%
\setbox\CF@stuff@box\hbox{#2}%
@@ -1425,7 +1405,6 @@
\kern\dimexpr#1+\CF@dp@max-\CF@dp@stuffbox\relax
\CF@parse@molname#3\\\@nil
}%
- \CF@restore@catcode
}
\CF@savedcatcode
@@ -1446,7 +1425,7 @@ v0.2 2010/08/31
- Les espaces sont permis dans les mol\'ecules. Ils seront
ignor\'es par d\'efaut puisque les atomes sont compos\'es en
mode math par \printatom
- - Une paire de Lewis peut être repr\'esent\'ee ":".
+ - Une paire de Lewis peut \^etre repr\'esent\'ee ":".
- 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
@@ -1462,7 +1441,7 @@ v0.3 2010/11/21
- Le caract\`ere "|" force la fin d'un atome. Si on \'ecrit
"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 être suivi d'un argument entre parenth\`eses
+ 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
@@ -1504,4 +1483,13 @@ v0.4 2011/03/07
----------------------------------------------------------------------
v0.4a 2011/04/10
- Correction d'un bug concernant l'argument optionnel en d\'ebut
- de mol\'ecule. \ No newline at end of file
+ de mol\'ecule.
+----------------------------------------------------------------------
+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
+ 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 \ 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 13de61c03db..8f7d11e5ad7 100644
--- a/Master/texmf-dist/tex/generic/chemfig/t-chemfig.tex
+++ b/Master/texmf-dist/tex/generic/chemfig/t-chemfig.tex
@@ -1,9 +1,9 @@
% __________________________________________________________________
% | |
% | |
-% | chemfig v0.4a |
+% | chemfig v0.4b |
% | |
-% | April 10, 2011 |
+% | April 24, 2011 |
% | |
% |__________________________________________________________________|
%
@@ -39,6 +39,6 @@
%
% The Current Maintainer of this work is Christian Tellechea
% --------------------------------------------------------------------
-\usemodule[tikz]
+\usemodule[tikz]%
\input chemfig.tex
\endinput \ No newline at end of file