summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/chemfig/chemfig_doc_en.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/generic/chemfig/chemfig_doc_en.tex')
-rw-r--r--Master/texmf-dist/doc/generic/chemfig/chemfig_doc_en.tex38
1 files changed, 36 insertions, 2 deletions
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 218c768a3ea..b878c81c67d 100644
--- a/Master/texmf-dist/doc/generic/chemfig/chemfig_doc_en.tex
+++ b/Master/texmf-dist/doc/generic/chemfig/chemfig_doc_en.tex
@@ -3,7 +3,7 @@
% | |
% | ChemFig Documentation |
% | |
-% | January 13, 2012 |
+% | February 24, 2012 |
% | |
% |__________________________________________________________________|
%
@@ -15,7 +15,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-2011
+% Copyright : Christian Tellechea 2010-2012
%
% The "chemfig" package consists of the 8 following files:
% chemfig.tex (the code of the package)
@@ -1701,6 +1701,40 @@ Water molecule rorated 30\si\degree: \chemfig{[:30]@1H-[::37.775,2]@2O-[::-75.55
\namebond12{\footnotesize0.9584\si\angstrom}
\namebond23{\footnotesize0.9584\si\angstrom}
\arclabel{0.5cm}{1}{2}{3}{\footnotesize104.45\si\degree}|
+
+\subsection{Schéma de Lewis à l'angle près}
+Pour quelques cas très particuliers, il est parfois nécessaire de positionner des schémas de Lewis au degrés près et non plus à des multiples de 45 degrés.
+
+Pour cela, il est relativement facile d'écrire une macro \verb-\mylewis-, admettant un argument optionnel (la longueur du doublet) qui vaut ici 2ex et deux arguments obligatoires; le premier étant le nom de l'atome et le second étant la liste des angles séparés par des virgules.
+
+L'astuce consiste à créer un n\oe ud invisible circulaire qui contient l'atome et tracer les doublets aux angles désirés de façon à ce qu'ils soient tangents à ce cercle :
+
+\exemple*{Doublets au degrés prés}|\makeatletter
+\newcommand\mylewis[3][2ex]{% #1=longueur, #2=atome #3=liste des angles
+ \tikzpicture[baseline,anchor=base]%
+ \node[inner sep=0pt,outer sep=1pt,circle,overlay](atom@@)at(0,0){\phantom{#2}};%
+ \node[inner sep=0pt,outer sep=0pt]at(0,0){#2};%
+ \def\list@angle{#3,}%
+ \loop
+ \expandafter\grab@angle\list@angle\@nil
+ \pgfextractx\CF@dim{\pgfpointanchor{atom@@}\current@angle}\edef\CF@dimax{\the\CF@dim}%
+ \pgfextracty\CF@dim{\pgfpointanchor{atom@@}\current@angle}\edef\CF@dimay{\the\CF@dim}%
+ \pgfmathparse{#1*sin(\current@angle)/2}\let\offset@xx\pgfmathresult
+ \pgfmathparse{#1*cos(\current@angle)/2}\let\offset@yy\pgfmathresult
+ \draw[line width=.4pt,overlay]
+ (\CF@dimax-\offset@xx,\CF@dimay+\offset@yy)--(\CF@dimax+\offset@xx,\CF@dimay-\offset@yy);%
+ \unless\ifx\@empty\list@angle
+ \repeat
+ \endtikzpicture
+}
+\def\grab@angle#1,#2\@nil{\def\current@angle{#1}\def\list@angle{#2}}
+\makeatother
+Essai : \mylewis{Cl}{15}\qquad \mylewis[3ex]{Cl}{-60}\qquad \mylewis[1.5ex]{Cl}{60,120,240,300}
+\bigskip
+
+\chemfig{P(-[:72]\mylewis{Cl}{-18,72,162})(-[:-72]Cl)
+(-[:144]Cl)(-[:-144]Cl)-\mylewis{Cl}{0,90,-90}}|
+
\newpage
\part{Reaction schemes}\label{schemas}