summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/chemfig
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-09-19 23:35:24 +0000
committerKarl Berry <karl@freefriends.org>2011-09-19 23:35:24 +0000
commitd8afb0f4b2b72dc375d1f7024702a7186f994d8c (patch)
tree12599486181695385823eff23964d15c0eb5b768 /Master/texmf-dist/tex/generic/chemfig
parentc75ce8f37f0b2732f40be147e85aa43b195e7180 (diff)
chemfig 1.0a (18sep11)
git-svn-id: svn://tug.org/texlive/trunk@24018 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/chemfig')
-rw-r--r--Master/texmf-dist/tex/generic/chemfig/chemfig.sty4
-rw-r--r--Master/texmf-dist/tex/generic/chemfig/chemfig.tex95
-rw-r--r--Master/texmf-dist/tex/generic/chemfig/t-chemfig.tex4
3 files changed, 59 insertions, 44 deletions
diff --git a/Master/texmf-dist/tex/generic/chemfig/chemfig.sty b/Master/texmf-dist/tex/generic/chemfig/chemfig.sty
index 27a0fbe14de..cb79c8bf454 100644
--- a/Master/texmf-dist/tex/generic/chemfig/chemfig.sty
+++ b/Master/texmf-dist/tex/generic/chemfig/chemfig.sty
@@ -1,9 +1,9 @@
% __________________________________________________________________
% | |
% | |
-% | chemfig v1.0 |
+% | chemfig v1.0a |
% | |
-% | June 15, 2011 |
+% | September 18, 2011 |
% | |
% |__________________________________________________________________|
%
diff --git a/Master/texmf-dist/tex/generic/chemfig/chemfig.tex b/Master/texmf-dist/tex/generic/chemfig/chemfig.tex
index c1385494eba..c04f6155137 100644
--- a/Master/texmf-dist/tex/generic/chemfig/chemfig.tex
+++ b/Master/texmf-dist/tex/generic/chemfig/chemfig.tex
@@ -1,9 +1,9 @@
% __________________________________________________________________
% | |
% | |
-% | chemfig v1.0 |
+% | chemfig v1.0a |
% | |
-% | June 15, 2011 |
+% | September 18, 2011 |
% | |
% |__________________________________________________________________|
%
@@ -62,10 +62,10 @@
\def#1%
}
-\CF@def\CF@ver {1.0}
-\CF@def\CF@date {2011/06/15}
-\CF@def\CF@fr@date {15 juin 2011}
-\CF@def\CF@en@date {June 15, 2011}
+\CF@def\CF@ver {1.0a}
+\CF@def\CF@date {2011/09/18}
+\CF@def\CF@fr@date {18 septembre 2011}
+\CF@def\CF@en@date {September 18, 2011}
\CF@def\CF@package@name{chemfig}
\expandafter\ifx\csname @latexerr\endcsname\relax% on n'utilise pas LaTeX ?
@@ -1215,22 +1215,27 @@
\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
}
-
\setlewis{}{}{}
-\CF@def\Lewis{%
- \tikzpicture[every node/.style={anchor=base,inner sep=\z@,outer sep=\z@,minimum size=\z@},baseline]%
- \@makeother;\@makeother:%
- \CF@lewis@i{}}
+\CF@def\setlewisdist#1{%
+ \def\CF@lewis@dist{#1}\ifx\@empty\CF@lewis@dist\def\CF@lewis@dist{0.2em}\fi
+}
+\setlewisdist{0.3em}
-\CF@def\lewis{%
- \tikzpicture[every node/.style={anchor=base,inner sep=\z@,outer sep=\z@,minimum size=\z@},baseline]%
- \@makeother;\@makeother:%
- \CF@lewis@i{overlay}}
+\CF@def\Lewis{\@testopt{\CF@lewis@i{}}{1}}
+
+\CF@def\lewis{\@testopt{\CF@lewis@i{,overlay}}{1}}
-\CF@def\CF@lewis@i#1#2{\CF@lewis@ii#2\@nil{#1}}
+\CF@def\CF@lewis@i#1[#2]{%
+ \def\CF@lewis@diagcoeff{#2}%
+ \ifx\@empty\CF@lewis@diagcoeff\def\CF@lewis@diagcoeff{1}\fi
+ \CF@lewis@ii{#1}}
-\CF@def\CF@lewis@ii#1,#2\@nil#3{%
+\CF@def\CF@lewis@ii#1#2{\CF@lewis@iii#2\@nil{#1}}
+
+\CF@def\CF@lewis@iii#1,#2\@nil#3{%
+ \tikzpicture[every node/.style={anchor=base,inner sep=\z@,outer sep=\z@,minimum size=\z@},baseline]%
+ \@makeother;\@makeother:%
\setbox\CF@lewis@box\hbox{\printatom{#2}}%
\node(CF@lewis@anchor){};
\def\CF@lewis@remainpos{#1}%
@@ -1239,39 +1244,45 @@
\unless\ifx\CF@lewis@remainpos\@empty
\edef\CF@lewis@currentpos{\expandafter\@car\CF@lewis@remainpos\@nil}%
\edef\CF@lewis@remainpos{\expandafter\@gobble\CF@lewis@remainpos}%
- \pgfmathparse{\wd\CF@lewis@box/2+\ifcase\CF@lewis@currentpos\space1\or1\or0\or-1\or-1\or-1\or0\or1\fi*(\wd\CF@lewis@box/2+\CF@lewis@offset)}%
+ \pgfmathparse{\wd\CF@lewis@box/2+\ifcase\CF@lewis@currentpos\space1\or1\or0\or-1\or-1\or-1\or0\or1\fi*(\wd\CF@lewis@box/2)}%
\let\CF@lewis@x\pgfmathresult
- \pgfmathparse{\ht\CF@lewis@box/2+\ifcase\CF@lewis@currentpos\space0\or1\or1\or1\or0\or-1\or-1\or-1\fi*(\ht\CF@lewis@box/2\ifnum\CF@lewis@currentpos>4 +\dp\CF@lewis@box\fi+\CF@lewis@offset)}%
+ \pgfmathparse{\ht\CF@lewis@box/2+\ifcase\CF@lewis@currentpos\space0\or1\or1\or1\or0\or-1\or-1\or-1\fi*(\ht\CF@lewis@box/2\ifnum\CF@lewis@currentpos>4 +\dp\CF@lewis@box\fi)}%
\let\CF@lewis@y\pgfmathresult
- \edef\CF@lewis@xoffset{\ifcase\CF@lewis@currentpos\space
- 0\or0.70711\or1\or0.70711\or0\or-0.70711\or-1\or-0.70711\fi}%
- \edef\CF@lewis@yoffset{\ifcase\CF@lewis@currentpos\space
- -1\or-0.70711\or0\or0.70711\or1\or0.70711\or0\or-0.70711\fi}%
- \pgfmathparse{veclen(\CF@lewis@xoffset,\CF@lewis@yoffset)}\let\CF@len@normvec\pgfmathresult
- \edef\CF@lewis@diagmul{\ifcase\CF@lewis@currentpos\space1\or0\or1\or0\or1\or0\or1\or0\fi}% annule l'offset pour les diagonales
+ \edef\CF@lewis@xoffset{\ifcase\CF@lewis@currentpos\space1\or0.70711\or0\or-0.70711\or-1\or-0.70711\or0\or0.70711\fi}%
+ \edef\CF@lewis@yoffset{\ifcase\CF@lewis@currentpos\space0\or0.70711\or1\or0.70711\or0\or-0.70711\or-1\or-0.70711\fi}%
+ \ifodd\CF@lewis@currentpos\relax
+ \pgfmathparse{\CF@lewis@offset*\CF@lewis@diagcoeff}\let\CF@lewis@current@offset\pgfmathresult
+ \else
+ \let\CF@lewis@current@offset\CF@lewis@offset
+ \fi
\if.\expandafter\@car\CF@lewis@remainpos\relax\@nil
\edef\CF@lewis@remainpos{\expandafter\@gobble\CF@lewis@remainpos}%
- \draw[fill,black,#3]
- (\CF@lewis@x pt-\CF@lewis@yoffset*\CF@lewis@diagmul*0.1ex,
- \CF@lewis@y pt+\CF@lewis@xoffset*\CF@lewis@diagmul*0.1ex)circle(0.15ex);%
+ \CF@expand@afterfirst{\draw[fill,black,}{\CF@lewis@style#3]}%
+ (\CF@lewis@x pt+\CF@lewis@xoffset*\CF@lewis@current@offset,\CF@lewis@y pt+\CF@lewis@yoffset*\CF@lewis@current@offset)circle(0.15ex);%
\else
\if|\expandafter\@car\CF@lewis@remainpos\relax\@nil
\edef\CF@lewis@remainpos{\expandafter\@gobble\CF@lewis@remainpos}%
- \expandafter\draw\expandafter[\CF@lewis@style,#3]%
- (\CF@lewis@x-\CF@lewis@length*\CF@lewis@xoffset/2 pt,\CF@lewis@y-\CF@lewis@length*\CF@lewis@yoffset/2 pt)--
- ([xshift=-\CF@lewis@yoffset*\CF@lewis@widthdouble,yshift=\CF@lewis@xoffset*\CF@lewis@widthdouble]\CF@lewis@x-\CF@lewis@xoffset*\CF@lewis@length/2 pt,\CF@lewis@y-\CF@lewis@yoffset*\CF@lewis@length/2 pt)--
- ([xshift=-\CF@lewis@yoffset*\CF@lewis@widthdouble,yshift=\CF@lewis@xoffset*\CF@lewis@widthdouble]\CF@lewis@x+\CF@lewis@length*\CF@lewis@xoffset/2 pt,\CF@lewis@y+\CF@lewis@length*\CF@lewis@yoffset/2 pt)--
- (\CF@lewis@x+\CF@lewis@length*\CF@lewis@xoffset/2 pt,\CF@lewis@y+\CF@lewis@length*\CF@lewis@yoffset/2 pt)--cycle;%
+ \pgfmathparse{\CF@lewis@x pt+\CF@lewis@xoffset*\CF@lewis@current@offset}\let\CF@lewis@x\pgfmathresult
+ \pgfmathparse{\CF@lewis@y pt+\CF@lewis@yoffset*\CF@lewis@current@offset}\let\CF@lewis@y\pgfmathresult
+ \expandafter\draw\expandafter[\CF@lewis@style#3]%
+ (\CF@lewis@x pt+\CF@lewis@length*\CF@lewis@yoffset/2 pt,\CF@lewis@y-\CF@lewis@length*\CF@lewis@xoffset/2 pt)--
+ (\CF@lewis@x pt+\CF@lewis@length*\CF@lewis@yoffset/2 pt+\CF@lewis@xoffset*\CF@lewis@widthdouble,\CF@lewis@y-\CF@lewis@length*\CF@lewis@xoffset/2 pt+\CF@lewis@yoffset*\CF@lewis@widthdouble)--
+ (\CF@lewis@x pt-\CF@lewis@length*\CF@lewis@yoffset/2 pt+\CF@lewis@xoffset*\CF@lewis@widthdouble,\CF@lewis@y+\CF@lewis@length*\CF@lewis@xoffset/2 pt+\CF@lewis@yoffset*\CF@lewis@widthdouble)--
+ (\CF@lewis@x pt-\CF@lewis@length*\CF@lewis@yoffset/2 pt,\CF@lewis@y+\CF@lewis@length*\CF@lewis@xoffset/2 pt)--cycle;%
\else
\if:\expandafter\@car\CF@lewis@remainpos\relax\@nil
\edef\CF@lewis@remainpos{\expandafter\@gobble\CF@lewis@remainpos}%
- \draw[fill,black,#3]
- (\CF@lewis@x pt-\CF@lewis@yoffset*\CF@lewis@diagmul*0.2ex-.2em*\CF@lewis@xoffset/\CF@len@normvec,\CF@lewis@y pt+\CF@lewis@xoffset*\CF@lewis@diagmul*0.2ex-.2em*\CF@lewis@yoffset/\CF@len@normvec)circle(0.15ex)%
- (\CF@lewis@x pt-\CF@lewis@yoffset*\CF@lewis@diagmul*0.2ex+.2em*\CF@lewis@xoffset/\CF@len@normvec,\CF@lewis@y pt+\CF@lewis@xoffset*\CF@lewis@diagmul*0.2ex+.2em*\CF@lewis@yoffset/\CF@len@normvec)circle(0.15ex);%
+ \pgfmathparse{\CF@lewis@x pt+\CF@lewis@xoffset*\CF@lewis@current@offset}\let\CF@lewis@x\pgfmathresult
+ \pgfmathparse{\CF@lewis@y pt+\CF@lewis@yoffset*\CF@lewis@current@offset}\let\CF@lewis@y\pgfmathresult
+ \CF@expand@afterfirst{\draw[fill,black,}{\CF@lewis@style#3]}%
+ (\CF@lewis@x pt+\CF@lewis@dist*\CF@lewis@yoffset/2 pt,\CF@lewis@y-\CF@lewis@dist*\CF@lewis@xoffset/2 pt)circle(0.15ex)%
+ (\CF@lewis@x pt-\CF@lewis@dist*\CF@lewis@yoffset/2 pt,\CF@lewis@y+\CF@lewis@dist*\CF@lewis@xoffset/2 pt)circle(0.15ex);%
\else
- \expandafter\draw\expandafter[\CF@lewis@style,#3]%
- (\CF@lewis@x-\CF@lewis@length*\CF@lewis@xoffset/2 pt,\CF@lewis@y-\CF@lewis@length*\CF@lewis@yoffset/2 pt)--%
- (\CF@lewis@x+\CF@lewis@length*\CF@lewis@xoffset/2 pt,\CF@lewis@y+\CF@lewis@length*\CF@lewis@yoffset/2 pt);%
+ \pgfmathparse{\CF@lewis@x pt+\CF@lewis@xoffset*\CF@lewis@current@offset}\let\CF@lewis@x\pgfmathresult
+ \pgfmathparse{\CF@lewis@y pt+\CF@lewis@yoffset*\CF@lewis@current@offset}\let\CF@lewis@y\pgfmathresult
+ \expandafter\draw\expandafter[\CF@lewis@style#3]%
+ (\CF@lewis@x pt+\CF@lewis@length*\CF@lewis@yoffset/2 pt,\CF@lewis@y-\CF@lewis@length*\CF@lewis@xoffset/2 pt)--%
+ (\CF@lewis@x pt-\CF@lewis@length*\CF@lewis@yoffset/2 pt,\CF@lewis@y+\CF@lewis@length*\CF@lewis@xoffset/2 pt);%
\fi
\fi
\fi
@@ -2119,4 +2130,8 @@ v1.0 2011/06/15
- \Lewis modifie la boite englobante
- les macros \chemleft, \chemright, \chemup et \chemdown
affichent des d\'elimiteurs extensibles \`a gauche, \`a droite,
- au dessus et au dessous d'un mat\'eriel. \ No newline at end of file
+ au dessus et au dessous d'un mat\'eriel.
+----------------------------------------------------------------------
+v1.0a 2011/09/18
+ - les macros \Lewis et \lewis admettent un argument optionnel
+ - la macro \setlewisdist r\`egle la distance entre les 2 \'electrons \ 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 f0299a0abde..623d72a1df0 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 v1.0 |
+% | chemfig v1.0a |
% | |
-% | June 15, 2011 |
+% | September 18, 2011 |
% | |
% |__________________________________________________________________|
%