diff options
author | Karl Berry <karl@freefriends.org> | 2011-01-09 23:39:20 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-01-09 23:39:20 +0000 |
commit | 44fc5185821d64f484a051cbb7a3bc2de7b3c282 (patch) | |
tree | e75ad1e1ef937bfa973a63ccbee1662224b4b34b /Master/texmf-dist/tex/latex/chemfig | |
parent | abf529e246ee5dabd71cb45b0b38fdae95cdfef1 (diff) |
chemfig 0.3a (9jan11)
git-svn-id: svn://tug.org/texlive/trunk@20994 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/chemfig')
-rw-r--r-- | Master/texmf-dist/tex/latex/chemfig/chemfig.sty | 90 |
1 files changed, 65 insertions, 25 deletions
diff --git a/Master/texmf-dist/tex/latex/chemfig/chemfig.sty b/Master/texmf-dist/tex/latex/chemfig/chemfig.sty index 97aedb5067a..a6b34c1241c 100644 --- a/Master/texmf-dist/tex/latex/chemfig/chemfig.sty +++ b/Master/texmf-dist/tex/latex/chemfig/chemfig.sty @@ -1,9 +1,9 @@ % __________________________________________________________________ % | | % | | -% | chemfig v0.3 | +% | chemfig v0.3a | % | | -% | November 21, 2010 | +% | January 8, 2011 | % | | % |__________________________________________________________________| % @@ -14,7 +14,7 @@ % 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 -% Copyright : Christian Tellechea 2010 +% Copyright : Christian Tellechea 2010-2011 % % The "chemfig" package consists of the 6 following files: % chemfig.sty (this file) @@ -37,10 +37,10 @@ % % The Current Maintainer of this work is Christian Tellechea % -------------------------------------------------------------------- -\newcommand*\CF@ver {0.3} -\newcommand*\CF@date {2010/11/21} -\newcommand*\CF@fr@date {21 novembre 2010} -\newcommand*\CF@en@date {November 21, 2010} +\newcommand*\CF@ver {0.3a} +\newcommand*\CF@date {2011/01/08} +\newcommand*\CF@fr@date {8 Janvier 2011} +\newcommand*\CF@en@date {January 08, 2011} \newcommand*\CF@package@name{chemfig} \ProvidesPackage\CF@package@name[\CF@date\space v\CF@ver\space Draw molecule with an easy syntax] @@ -103,13 +103,37 @@ \newcommand*\definesubmol{\@CF@definesubmoltrue\CF@def@submol} \newcommand*\redefinesubmol{\@CF@definesubmolfalse\CF@def@submol} -\newcommand*\CF@def@submol[1]{\@ifnextchar[{\CF@def@submol@i{#1}}{\CF@def@submol@i{#1}[]}} +\newcommand*\CF@def@submol[1]{% + \begingroup + \def\CF@tmp@str{#1}% + \catcode`[\@ne\catcode`]\tw@ + \futurelet\CF@toks@a\CF@test@nxttok +} + +\newcommand*\CF@test@nxttok{% + \if[\noexpand\CF@toks@a + \expandafter\expandafter\expandafter\CF@grab@optalias\expandafter\expandafter\expandafter{\expandafter\CF@tmp@str\expandafter}% + \else + \CF@swap@fi + \expandafter\endgroup + \expandafter\CF@def@submol@i\expandafter{\CF@tmp@str}{}% + \fi +} + +\newcommand*\CF@grab@optalias[2]{% + \endgroup + \begingroup + \everyeof{\@nil}\endlinechar\m@ne + \expandafter\assign@tonil\expandafter\CF@tmp@str\scantokens{#2}% + \CF@expand@second{\endgroup\CF@def@submol@i{#1}}\CF@tmp@str +} -\def\CF@def@submol@i#1[#2]#3% -{% #1 nom, #2 = code si liaison arrive de droite , #3 = code si liaison arrive de gauche +\newcommand*\CF@def@submol@i[3]{% #1 nom, #2 = code si liaison arrive de droite , #3 = code si liaison arrive de gauche \ifcat\relax\expandafter\noexpand\@car#1\@nil% si #1 est une séquence de contrôle \expandafter\ifdefined\@car#1\@nil - \if@CF@definesubmol\PackageWarning\CF@package@name{The macro \expandafter\string\@car#1\@nil\space is already defined, the previous definition is lost.}\fi + \if@CF@definesubmol + \PackageWarning\CF@package@name{The macro \expandafter\string\@car#1\@nil\space is already defined, the previous definition is lost.}% + \fi \fi \ifx\@empty#2\@empty \expandafter\def\@car#1\@nil{\@empty#3}% @@ -129,10 +153,12 @@ \fi \else \ifcsname CF@@#1\endcsname - \if@CF@definesubmol\PackageWarning\CF@package@name{The submol "#1" is already defined, the previous definition is lost.}\fi + \if@CF@definesubmol + \PackageWarning\CF@package@name{The submol "#1" is already defined, the previous definition is lost.}% + \fi \fi \ifx\@empty#2\@empty - \expandafter\def\csname CF@@#1\endcsname{\@empty#3}%\@empty car sera 1-développé lorsque rencontrée + \expandafter\def\csname CF@@#1\endcsname{\@empty#3}% "\@empty" car tout ça sera 1-développé lorsque rencontrée \else \expandafter\def\csname CF@@#1\endcsname{% \romannumeral% donnera le développement souhaité en 1 coup @@ -480,6 +506,7 @@ \newcommand*\CF@chemfig@i[1]{% \CF@chemfig@ii{#1}% \endtikzpicture + \let\CF@split@state\z@ } \newcommand*\CF@chemfig@ii[1]{% #1 est le code de la molécule @@ -574,7 +601,7 @@ {\let\CF@next@action\endgroup \CF@draw@bond\CF@bond@type{\CF@bond@outnode}{\CF@hook@cycle}\CF@previous@atomgroup\CF@hook@atomgroup }% - {\node[at=(\CF@bond@outnode),shift=(\CF@current@angle:\CF@current@length*\CF@atom@sep)](CF@node){}; + {\node[at=(\CF@bond@outnode),shift=(\ifcase\CF@split@state\or180-\or-\fi\CF@current@angle:\CF@current@length*\CF@atom@sep)](CF@node){}; \let\CF@previous@angle\CF@current@angle \let\CF@last@action\tw@ }% @@ -871,14 +898,19 @@ \ifx\@empty#2\@empty\let\CF@node@strut\@empty\fi }% +\newcommand*\hflipnext{\let\CF@split@state\@ne} + +\newcommand*\vflipnext{\let\CF@split@state\tw@} +\let\CF@split@state\z@ + \newcommand*\CF@draw@atomgroup[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 - \else - @empty% - \fi + \ifdefined\CF@bond@outnode + atom@\expandafter\CF@extract@atom\CF@bond@outnode\@nil + \else + @empty% + \fi \endcsname \global\advance\CF@cnt@groupnumber\@ne \let\CF@current@atom\@empty @@ -932,7 +964,7 @@ \expandafter\node\expandafter[\CF@opt@string](n\number\CF@cnt@groupnumber-\number\CF@cnt@atomnumber){\CF@node@content};% \let\CF@node@strut\@empty \advance\CF@cnt@atomnumber\@ne - \edef\CF@opt@string{anchor=base west,at=(n\number\CF@cnt@groupnumber-\number\numexpr\CF@cnt@atomnumber-1.base east),\CF@node@style}% + \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 @@ -943,7 +975,7 @@ \loop \ifnum\CF@cnt@atomnumber>\@ne \advance\CF@cnt@atomnumber\m@ne - \edef\CF@opt@string{anchor=base east,at=(n\number\CF@cnt@groupnumber-\number\numexpr\CF@cnt@atomnumber+1.base west),\CF@node@style}% + \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}% \expandafter\expandafter\expandafter\futurelet\expandafter\expandafter\expandafter\CF@toks@a\expandafter\expandafter\expandafter \CF@gobble@tonil\csname atom@\number\CF@cnt@atomnumber\endcsname\@nil \expandafter\ifx\string @\CF@toks@a% l'atome courant commence par un "@" @@ -1033,7 +1065,8 @@ {\ifx|\CF@toks@a\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi {\expandafter\let\csname atom@\number\CF@cnt@atomingroup\endcsname\CF@current@atom \let\CF@current@atom\@empty - \CF@swap@fi\expandafter\CF@draw@atomgroup@i\expandafter{\@gobble#1}}% + \CF@swap@fi\expandafter\CF@draw@atomgroup@i\expandafter{\@gobble#1}% + }% {\ifx\@sptoken\CF@toks@a\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi {\CF@add@tocs\CF@current@atom{ }% \CF@swap@fi\expandafter\CF@draw@atomgroup@iii\expandafter{\CF@after@space#1\@nil}% @@ -1051,7 +1084,7 @@ {\expandafter\CF@if@firsttokmatch\expandafter{\@gobble#1}[% un crochet après le "?" {\expandafter\CF@grab@optarg\@gobble#1\@nil\CF@after@hook}% {\expandafter\CF@grab@optarg\expandafter[\expandafter]\@gobble#1\@nil\CF@after@hook}% - \CF@expand@second{\CF@expand@second\CF@if@instr\CF@hook@list}{\expandafter(\CF@hook@currentname)}% crochet déjà défini ? + \CF@expand@second{\CF@expand@second\CF@if@instr\CF@hook@list}{\expandafter(\CF@hook@currentname)}% crochet déjà défini ? {\expandafter\CF@hook@parselist\expandafter{\CF@hook@currentname}% va 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}}% @@ -1121,7 +1154,7 @@ \def\CF@remove@singlehook#1?#2\@nil{#1#2} \newcommand*\setlewis[4][0.3ex]{% - \def\CF@lewis@widthdouble{#1}% TODO à renseigner dans la doc (oublié dans la version 0.3) + \def\CF@lewis@widthdouble{#1}% \ifx\@empty#2\@empty\def\CF@lewis@offset{0.4ex}\else\def\CF@lewis@offset{#2}\fi \ifx\@empty#3\@empty\def\CF@lewis@length{1.5ex}\else\def\CF@lewis@length{#3}\fi \ifx\@empty#4\@empty\def\CF@lewis@style{}\else\def\CF@lewis@style{#4}\fi @@ -1346,4 +1379,11 @@ v0.3 2010/11/21 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.
\ No newline at end of file + police. +---------------------------------------------------------------------- +v0.3a 2011/01/08 + - Correction d'un bug dans l'argument optionnel de \definesubmol + lorsque celui-ci comporte des crochets. + - Mise à jour du manuel en anglais. + - Ajout de \vflipnext et \hflipnext pour retourner + horizontalement ou verticalement la prochaine molécule.
\ No newline at end of file |