summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/chemfig/chemfig-en.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/generic/chemfig/chemfig-en.tex')
-rw-r--r--Master/texmf-dist/doc/generic/chemfig/chemfig-en.tex756
1 files changed, 394 insertions, 362 deletions
diff --git a/Master/texmf-dist/doc/generic/chemfig/chemfig-en.tex b/Master/texmf-dist/doc/generic/chemfig/chemfig-en.tex
index 7018d775488..7bcf1ac1688 100644
--- a/Master/texmf-dist/doc/generic/chemfig/chemfig-en.tex
+++ b/Master/texmf-dist/doc/generic/chemfig/chemfig-en.tex
@@ -105,16 +105,17 @@
\endgroup
}
-\newcommand\falseverb[1]{{\ttfamily\detokenize\expandafter{\string#1}}}
+\begingroup
+ \catcode`\<13 \catcode`\>13
+ \gdef\Verb{\relax\ifmmode\hbox\else\leavevmode\null\fi
+ \bgroup
+ \verb@eol@error \let\do\@makeother \dospecials
+ \verbatim@font\@noligs
+ \catcode`\<13 \catcode`\>13 \def<{\begingroup$\langle$\itshape}\def>{\/$\rangle$\endgroup}%
+ \@ifstar\@sverb\@verb}
+\endgroup
-\long\def\centerverb#1{%
- \def\centerverb@i##1#1{##1\hfill\null\par\egroup}
- \bgroup
- \ttfamily\@noligs
- \parskip3.5pt\par\hfill
- \let\do\@makeother\dospecials
- \@vobeyspaces
- \centerverb@i}
+\newcommand\falseverb[1]{{\ttfamily\detokenize\expandafter{\string#1}}}
\def\CFengdate@i#1/#2/#3\@nil{\number#3\relax\ifnum#3=1 \ier{}\fi\space \ifcase#2 \or january\or february\or march\or april\or may\or june\or july\or august\or september\or october\or november\or december\fi\space#1}
\edef\CFengdate{\expandafter\CFengdate@i\CFdate\@nil}
@@ -152,6 +153,7 @@
\titleformat{\part}[display]{\normalfont\filcenter\sffamily\bfseries}{}{0pt}{\Huge}
\begin{document}
+\topsep=3pt plus5pt minus2pt\relax
\begin{titlepage}
\catcode`!12
\begin{tikzpicture}[remember picture,overlay]
@@ -213,100 +215,47 @@
\setitemize{leftmargin=3em,topsep=0pt,parsep=0pt,itemsep=0pt}
\part{Introduction}
-\section{New in v1.3}
-\subsection{New in 1.33}
-\paragraph{Arguments for submols}
-As of version 1.33, submolecules defined with \verb|\definesubmol| can have arguments, see page~\pageref{definesubmolarg}.
+\section{New in v1.4}
+\subsection{Private char}
+In the code of \CF, the character used in the name of private macros is "\verb|_|" (underscore) and no longer "\verb|@|" (arobe): the prefix of private macros of \CF is "\verb|\CF_|". The majority of \CF users should not be affected by this change, but the development or maintenance of specific codes such as those presented in the "Arrow customization" section on page~\pageref{definearrow} which uses private macros should take this catcode change into account; this will require an \emph{update of macros names} for those who have used private macros from \CF. To allow "\verb|_|" in macro names, we must execute the order "\verb|\catcode`\_=11|" and then, to return to a normal state run "\verb|\catcode`\_=8|".
-\paragraph{Polymer delilmiters}
-The macro \verb|\polymerdelim| allows to draw delimiters on molecules drawn by \CF, see page~\pageref{polymerdelim}.
+\subsection{Char \#}
+All those who program in \TeX{} know the extreme precautions that must be taken before using the "\verb|#|" character. This character is allowed in the code representing the molecule, but for internal operating reasons at \TeX, it will be doubled if the command \verb|\chemfig| is in the argument of a macro (like \verb|\fbox| in the example below). To avoid this doubling, we can write \verb|\#| or use the macro \verb|\CFhash|:
-\subsection{New in 1.3}
-\paragraph{Key and values system}Given the large number of parameters and the number of macros used to specify them, standardization has become necessary, both to simplify the use of \CF and to facilitate the creation of new parameters.
+\exemple{Char \#}/\setchemfig{atom sep=5em}\fboxsep=1pt
+1) \chemfig{A#-B_#-C^#}\par
+2) \fbox{\chemfig{A#-B_#-C^#}}\par
+3) \fbox{\chemfig{A\#-B_\#-C^\#}}\par
+4) \fbox{\chemfig{A\CFhash-B_\CFhash-C^\CFhash}}/
-Most of the settings are now specified \emph{via} the macro \verb|\setchemfig| whose argument is a comma separated list of \chevrons{keys}${}={}$\chevrons{value}. Although still usable for the moment, all macros that specified one or more parameters are now obsolete.
-\begin{center}
- \color{red}
- \textbf{Warning}: all the following obsolete macros will be deleted in a future version.
-\end{center}
-\begingroup
-\spaceskip=0.75em plus7pt minus 7pt
-\verb-\setcrambond-, \verb-\setatomsep-, \verb-\enablefixedbondlength-, \verb-\disablefixedbondlength-, \verb-\setbondoffset-, \verb-\setdoublesep-, \verb-\setangleincrement-, \verb-\setnodestyle-, \verb-\setbondstyle-, \verb-\setlewis-, \verb-\setlewisdist-, \verb-\setstacksep-, \verb-\setcompoundstyle-, \verb-\setarrowdefault-, \verb-\setandsign-, \verb-\setarrowoffset-, \verb-\setcompoundsep-, \verb-\setarrowlabelsep-, \verb-\enablebondjoin-, \verb-\disablebondjoin-, \verb-\schemedebug-.%
-\endgroup
-
-Running them sends a warning message about their obsolescence in the log file.
+For the macro \verb|\definesubmol|, the character \verb|#| is also allowed, but its use is more complex because it covers several cases that are examined on page~\pageref{definesubmol}.
-\paragraph{The syntax of the \texttt{\textbackslash chemfig} macro}
+\subsection{Old macros and new syntax}
+Macros previously used to set the parameters of \CF are abandoned, are no longer defined and therefore, \emph{will result in a compilation error} if they are executed:
\begin{center}
- \color{red}
- The starred version of the macro \verb-\chemfig- is now obsolete and will no longer be supported in a future version.
-\end{center}
-To set a fixed bond length, use the key \CFkey{fixed length} and set it to \CFval{true}.
-
-On the other hand, the two optional arguments that the macro \verb-\chemfig- accepted, in order to specify parameters for tikz, are also obsolete. From now on, the two keys \CFkey{chemfig style} and \CFkey{atom style} must be preferred, see page~\pageref{arguments.optionnels}.
-
-The aim is that in the long run, the macro \verb-\chemfig- accepts only \emph{a single} optional argument containing a list of parameters set via \chevrons{key}${}={}$\chevrons{value}.
-\begin{center}
- \color{red}
- The two optional arguments that the macro \verb-\chemfig- accepts will be removed in a future version.
-\end{center}
+ \begin{tabular}{*3l}
+ \verb-\setcrambond-&\verb-\setatomsep-&\verb-\enablefixedbondlength-\\
+ \verb-\disablefixedbondlength-&\verb-\setbondoffset-&\verb-\setdoublesep-\\
+ \verb-\setangleincrement-&\verb-\setnodestyle-&\verb-\setbondstyle-\\
+ \verb-\setlewis-&\verb-\setlewisdist-&\verb-\setstacksep-\\
+ \verb-\setcompoundstyle-&\verb-\setarrowdefault-&\verb-\setandsign-\\
+ \verb-\setarrowoffset-&\verb-\setcompoundsep-&\verb-\setarrowlabelsep-\\
+ \verb-\enablebondjoin-&\verb-\disablebondjoin-&\verb-\schemedebug-
+ \end{tabular}
+ \end{center}
+Now, to set the parameters of \CF we have the choice:
+\begin{itemize}
+ \item the macro \Verb|\setchemfig{<keys>=<values>}| sets the parameters according to the key/value method for the rest of the document;
+ \item the macro \Verb|\chemfig[<keys>=<values>]| receives in its optional argument the parameters valid only for this molecule;
+ \item the macro \verb|\resetchemfig| restores the parameters to their default values.
+\end{itemize}
-\paragraph{Keys and their default value}
-The chemfig settings, identified by their \chevrons{keys} and default \chevrons{value} are:
-\begin{center}
-\begin{longtable}{rl}\hline
- \chevrons{clés} & \chevrons{valeurs} par défaut\\\hline\endhead
- \CFparam{chemfig style}
- \CFparam{atom style}
- \CFparam{bond join}
- \CFparam{fixed length}
- \CFparam{cram rectangle}
- \CFparam{cram width}
- \CFparam{cram dash width}
- \CFparam{cram dash sep}
- \CFparam{atom sep}
- \CFparam{bond offset}
- \CFparam{double bond sep}
- \CFparam{angle increment}
- \CFparam{node style}
- \CFparam{bond style}
- \CFparam{lewis | width}
- \CFparam{lewis sep}
- \CFparam{lewis length}
- \CFparam{lewis style}
- \CFparam{lewis dist}
- \CFparam{lewis radius}
- \CFparam{cycle radius coeff}
- \CFparam{stack sep}
- \CFparam{scheme debug}
- \CFparam{compound style}
- \CFparam{compound sep}
- \CFparam{arrow offset}
- \CFparam{arrow angle}
- \CFparam{arrow coeff}
- \CFparam{arrow style}
- \CFparam{arrow double sep}
- \CFparam{arrow double coeff}
- \CFparam{arrow double harpoon}
- \CFparam{arrow label sep}
- \CFparam{arrow head}
- \CFparam{+ sep left}
- \CFparam{+ sep right}
- \CFparam{+ vshift}\hline
-\end{longtable}
-\end{center}
+The complete list of parameters and their default values is shown page~\pageref{listeparametres}.
-The macro \verb|\resetchemfig| can be run at any time to reset all parameters to their default value.
+Starred syntax \verb|\chemfig*| is no longer allowed. To specify a constant length of bonds, use the key \CFkey{fixed length} and set it to \CFval{true}, see page~\pageref{longueur.liaison}.
-The following \chevrons{parameters} are new and are therefore accessible only \emph{via} the macro \verb|setchemfig|:
-\begin{enumerate}
- \item \CFkey{lewis radius} is the radius of a Lewis decoration disc;
- \item \CFkey{arrow double sep} is the vertical spacing between the double arrows in the reaction schemes;
- \item \CFkey{arrow double coeff} is the shrinkage coefficient of the small compared to the large one for the \verb|<->>| and \verb|<<->| arrows;
- \item \CFkey{arrow double harpoon} is a boolean that specifies whether double arrows should be "harpoon" or not;
- \item \CFkey{cycle radius coeff} represents the shrinkage coefficient of the circle or arc of a circle in the cycles;
- \item \CFkey{arrow head} is the default arrowhead style.
-\end{enumerate}
+\subsection{Macros \texttt{\textbackslash lewis} and \texttt{\textbackslash Lewis}}
+These two macros also have a slight syntax change. Their optional argument between brackets is no longer intended to receive the diagonal spacing coefficient, but \Verb|<<key>=values>| so that the parameters can be set for each macro call. See page~\pageref{lewis}.
\section{Presenting \protect\CF}
To use this package, start by adding the following code to the preamble:
@@ -318,14 +267,14 @@ To use this package, start by adding the following code to the preamble:
In all cases, the \TIKZ package, if not loaded before, is loaded by \CF.
-The most important command for drawing molecules is \verb|\chemfig{<code>}|. The argument \verb|code| is a set of characters describing the structure of the molecule according to the rules which are described in this manual.
+The most important command for drawing molecules is \Verb|\chemfig{<code>}|. The argument \verb|code| is a set of characters describing the structure of the molecule according to the rules which are described in this manual.
-Care has been taken to make it possible to draw the greatest possible number of molecular configurations, while maintaining a simple, flexible, and intuitive syntax. Despite this, the \verb-<code>- which describes the 2D structure of the molecule increases in complexity in proportion to that of the molecule being drawn.
+Care has been taken to make it possible to draw the greatest possible number of molecular configurations, while maintaining a simple, flexible, and intuitive syntax. Despite this, the \Verb-<code>- which describes the 2D structure of the molecule increases in complexity in proportion to that of the molecule being drawn.
The command \verb|\chemfig| draws a molecule using the commands provided by the \TIKZ package, placed inside a \verb|tikzpicture| environment. The choice of \TIKZ implies that:
\begin{itemize}
\item the user has a choice of compilation method: pdf\LaTeX{} can be used equally well in \falseverb{dvi mode} (tex $\longrightarrow$ dvi $\longrightarrow$ ps $\longrightarrow$ pdf) or in \falseverb{pdf mode} (tex $\longrightarrow$ pdf). In effect \TIKZ, via the underlying \falseverb{pgf}, gives identical graphical results in the two modes;
-\item the \falseverb{bounding box} is automatically calculated by \TIKZ and the user need not worry about any overlap with the text. However, care must be taken with alignment when the molecule is drawn in a paragraph. In the following example, we have drawn the \falseverb{bounding box} for the molecule: {\fboxsep0pt \fbox{\chemfig{H_3C-C(-[:-30]OH)=[:30]O}}}. \CF always places the first atom of the molecule on the \falseverb{baseline} of the preceding code.
+\item the \falseverb{bounding box} is automatically calculated by \TIKZ and the user need not worry about any overlap with the text. However, care must be taken with alignment when the molecule is drawn in a paragraph. In the following example, we have drawn the \falseverb{bounding box} for the molecule: {\fboxsep0pt \fbox{\chemfig{H_3C-C(-[:-30]OH)=[:30]O}}}.
\end{itemize}
\section{Acknowledgment}
@@ -337,6 +286,75 @@ I also want to warmly thank Theo \textsc{Hopman} for offering to translate this
\part{Operation of \protect\CF}
This part is devoted to describing the most common features of \CF. The user will find here explanations sufficient to draw most molecules. The presentation of features is done from a theoretical angle, and the goal of this part is not to draw real molecules but to give the user a formal description of the functionality of \CF. The ``Advanced usage'', page~\pageref{utilisation.avancee}, will be more practical and will illustrate advanced features for the most demanding uses. It will also highlight methods of building real molecules, page~\pageref{exemples.commentes}. Finally, the last part will give examples of molecules and the code used to draw them.
+\section{The \texttt{\textbackslash chemfig} macro}
+The macro \verb|\chemfig| has the following syntax
+\begin{center}
+ \Verb|\chemfig[list of <keys>=<values>]{<molecule code>}|
+\end{center}
+The optional argument in square brackets sets the parameters used for this molecule. It should be noted that the parameters are only modified for the current molecule and will be restored to their previous values after the macro has been executed. To permanently modify parameters, the macro \Verb|\setchemfig{<key>=<values>}| should be used.
+
+Here is the complete list of parameters as well as their default values\label{listeparametres}. It should be noted that the \chevrons{keys} from \CFkey{scheme debug} included to the end of the list concern reaction schemes and make no sense in the optional argument of the macro \verb|\chefig| where they are simply ignored:\par
+\leavevmode\hfill
+\begin{minipage}[t]{.45\linewidth}
+ \begin{longtable}{rl}\hline
+ \chevrons{keys} & default \chevrons{values}\\\hline\endhead
+ \CFparam{chemfig style}
+ \CFparam{atom style}
+ \CFparam{bond join}
+ \CFparam{fixed length}
+ \CFparam{cram rectangle}
+ \CFparam{cram width}
+ \CFparam{cram dash width}
+ \CFparam{cram dash sep}
+ \CFparam{atom sep}
+ \CFparam{bond offset}
+ \CFparam{double bond sep}
+ \CFparam{angle increment}
+ \CFparam{node style}
+ \CFparam{bond style}
+ \CFparam{lewis | width}
+ \CFparam{lewis sep}
+ \CFparam{lewis length}
+ \CFparam{lewis style}
+ \CFparam{lewis dist}\hline
+ \end{longtable}
+\end{minipage}\hfill
+\begin{minipage}[t]{.45\linewidth}
+ \begin{longtable}{rl}\hline
+ \chevrons{clés} & \chevrons{valeurs} par défaut\\\hline\endhead
+ \CFparam{lewis radius}
+ \CFparam{lewis diag coeff}
+ \CFparam{cycle radius coeff}
+ \CFparam{stack sep}
+ \CFparam{scheme debug}
+ \CFparam{compound style}
+ \CFparam{compound sep}
+ \CFparam{arrow offset}
+ \CFparam{arrow angle}
+ \CFparam{arrow coeff}
+ \CFparam{arrow style}
+ \CFparam{arrow double sep}
+ \CFparam{arrow double coeff}
+ \CFparam{arrow double harpoon}
+ \CFparam{arrow label sep}
+ \CFparam{arrow head}
+ \CFparam{+ sep left}
+ \CFparam{+ sep right}
+ \CFparam{+ vshift}\hline
+ \end{longtable}
+\end{minipage}\hfill\null\bigbreak
+
+The \Verb|<molecule code>| contains instructions for drawing the molecule according to a syntax that will be explained in this document. There are no restrictions on the characters accepted in the code:
+\begin{itemize}
+ \item all catcode 11 or 12 characters, i. e. upper and lower-case letters, numbers, mathematical operators (\texttt+ \texttt- \texttt* \texttt/ \texttt=), punctuation marks whether active or not (\verb|.| \verb|,| \verb|;| \verb|:| \verb|!| \verb|?| \verb|'| \verb|`| \verb|"| \verb-|-), parenthesis and brackets;
+ \item more special characters such as "\verb|~|", "\verb|#|"\footnote{To avoid that \texttt\# is doubled when the macro \texttt{\textbackslash chemfig} is in the argument of a macro, instead of \texttt\#, the macro \texttt{\textbackslash\#} or the macro \texttt{\textbackslash CFhash} can be used.} as well as "\verb|^|" and "\verb|_|" which have their normal mathematical mode properties;
+ \item spaces, but these are ignored by default because the atoms are composed in mathematical mode;
+ \item the "\verb|{|" and "\verb|}|" braces that have their normal behavior as group markers or macro argument delimiters;
+ \item macros.
+\end{itemize}
+
+In any case, \CF will place \emph{on the current baseline the first atom encountered}, whether it is empty or not. In the examples in this document, the baseline is drawn in light grey.
+
\section{Groups of atoms}
Drawing a molecule consists inherently of connecting groups of atoms with lines. Thus, in the molecule \chemfig{O=O}, there are two groups of atoms, each consisting of a single atom ``O''.
@@ -349,7 +367,7 @@ Therefore the first group of atoms ``$\mathrm{H_3C}$'' is split into two atoms:
\renewcommand*\printatom[1]{\fbox{\ensuremath{\mathrm{#1}}}}
\molht{H_3C-C(=[:30]O)(-[:-30]OH)}}
-A space is ignored when at the begining of a group of atoms.
+A space is ignored when at the beginning of a group of atoms.
\section{Different types of bonds}
For \CF, bonds between two atoms are one of nine types, represented by the characters \boxedfalseverb-, \boxedfalseverb=, \boxedfalseverb~, \boxedfalseverb>, \boxedfalseverb<, \boxedfalseverb{>:}, \boxedfalseverb{<:}, \boxedfalseverb{>|} and \boxedfalseverb{<|} :\label{types.liaisons}
@@ -368,27 +386,27 @@ Bond \#&Code &Result &Bond type\\\hline
9 &\verb+\chemfig{A<|B}+&\chemfig{A<|B}&left Cram, hollow\\\hline
\end{tabular}
\end{center}
-\label{double bond sep}The \chevrons{key} \verb-\double bond sep=<dim>- adjusts the spacing between the lines in double or triple bonds. This spacing is 2pt by default.
+\label{double bond sep}The \chevrons{key} \Verb-double bond sep=<dim>- adjusts the spacing between the lines in double or triple bonds. This spacing is 2pt by default.
-\label{longueur.liaison}We must understand that when a bond is made between two atoms, these atoms are contained within invisible rectangular boxes. The centres of these two rectangles are separated by an adjustable distance $\Delta$ called the ``interatomic distance''. Furthermore, bonds do not connect to the exact edges of the rectangles: a length $\delta$, also adjustable, separates the edges of the rectangles and the beginning and end of the bond line. The rectangular boxes are made visible in the diagram below to help understanding.
+\label{longueur.liaison}We must understand that when a bond is made between two atoms, these atoms are contained within invisible rectangular boxes. The centers of these two rectangles are separated by an adjustable distance $\Delta$ called the ``interatomic distance''. Furthermore, bonds do not connect to the exact edges of the rectangles: a length $\delta$, also adjustable, separates the edges of the rectangles and the beginning and end of the bond line. The rectangular boxes are made visible in the diagram below to help understanding.
\begin{center}
\begin{tikzpicture}[every node/.style={anchor=base,inner sep=1.5pt,outer sep=0pt,minimum size=0pt},baseline]
\node[draw] at(0,0)(aa){\huge A};
\node[draw]at(4,0)(bb){\huge B};
- \path[shorten <=5pt,shorten >=5pt,draw](aa)--(bb)coordinate[pos=0](al) coordinate[pos=1](bl);
+ \path[shorten <=10pt,shorten >=10pt,draw](aa)--(bb)coordinate[pos=0](al) coordinate[pos=1](bl);
\node[draw,circle,fill,blue,minimum size=1.5pt,inner sep=0pt]at(al){};
- \node[draw,circle,fill,blue,minimum size=1.5pt,inner sep=0pt]at([xshift=5pt]al){};
+ \node[draw,circle,fill,blue,minimum size=1.5pt,inner sep=0pt]at([xshift=10pt]al){};
\node[draw,circle,fill,blue,minimum size=1.5pt,inner sep=0pt]at(bl){};
- \node[draw,circle,fill,blue,minimum size=1.5pt,inner sep=0pt]at([xshift=-5pt]bl){};
+ \node[draw,circle,fill,blue,minimum size=1.5pt,inner sep=0pt]at([xshift=-10pt]bl){};
\draw[blue,dash pattern=on 1pt off 1pt](bl)--([yshift=0.7cm]bl);
- \draw[blue,dash pattern=on 1pt off 1pt]([xshift=-5pt]bl)--([xshift=-5pt,yshift=0.7cm]bl);
- \draw[<->]([yshift=0.6cm]bl.center)--([xshift=-5pt,yshift=0.6cm]bl.center) node [midway,above,draw=none]{$\delta$};
+ \draw[blue,dash pattern=on 1pt off 1pt]([xshift=-10pt]bl)--([xshift=-10pt,yshift=0.7cm]bl);
+ \draw[stealth-stealth]([yshift=0.6cm]bl.center)--([xshift=-10pt,yshift=0.6cm]bl.center) node [midway,above,draw=none]{$\delta$};
\draw[blue,dash pattern=on 1pt off 1pt](al)--([yshift=0.7cm]al);
- \draw[blue,dash pattern=on 1pt off 1pt]([xshift=5pt]al)--([xshift=5pt,yshift=0.7cm]al);
- \draw[<->]([yshift=0.6cm]al.center)--([xshift=5pt,yshift=0.6cm]al.center) node [midway,above,draw=none]{$\delta$};
+ \draw[blue,dash pattern=on 1pt off 1pt]([xshift=10pt]al)--([xshift=10pt,yshift=0.7cm]al);
+ \draw[stealth-stealth]([yshift=0.6cm]al.center)--([xshift=10pt,yshift=0.6cm]al.center) node [midway,above,draw=none]{$\delta$};
\node[draw,circle,fill,red,minimum size=2pt,inner sep=0pt]at(aa){};
\node[draw,circle,fill,red,minimum size=2pt,inner sep=0pt]at(bb){};
- \draw[<->]([yshift=1cm]aa.center)--([yshift=1cm]bb.center) node [midway,above,draw=none] {$\Delta$} ;
+ \draw[stealth-stealth]([yshift=1cm]aa.center)--([yshift=1cm]bb.center) node [midway,above,draw=none] {$\Delta$} ;
\draw[red,dash pattern=on 2pt off2pt](aa.center)--([yshift=1.1cm]aa.center);
\draw[red,dash pattern=on 2pt off2pt](bb.center)--([yshift=1.1cm]bb.center);
\end{tikzpicture}
@@ -396,21 +414,20 @@ Bond \#&Code &Result &Bond type\\\hline
\label{atom sep}The \chevrons{key} \CFkv{atom sep}{dim} adjusts the interatomic distance $\Delta$. This setting, like all other settings, affects all the following molecules.
-\exemple{Interatomic distance}|\setchemfig{atom sep=2em}\chemfig{A-B}\par
-\setchemfig{atom sep=50pt}\chemfig{A-B}|
+\exemple{Interatomic distance}|\chemfig[atom sep=2em]{A-B}\par
+\chemfig[atom sep=50pt]{A-B}|
\label{bond offset}The \chevrons{key} \CFkv{bond offset}{dim} sets the spacing $\delta$ between the bond line and the atom. Its default value is 2pt.
-\exemple{Trimming bonds}|\setchemfig{bond offset=0pt}\chemfig{A-B}\par
- \setchemfig{bond offset=5pt}\chemfig{A-B}|
+\exemple{Trimming bonds}|\chemfig[bond offset=0pt]{A-B}\par
+\chemfig[bond offset=5pt]{A-B}|
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{bond style}The \chevrons{key} \CFkv{bond style}{tikz code} sets the style for all the bonds drawn thereafter. The \CFval{tikz code} is empty by default. To custom a single bond, see page~\pageref{perso-liaisons}.
-\exemple{Style of bonds}/\setchemfig{bond style={line width=1pt,red}}
-\chemfig{A-B=C>|D<E>:F}/
+\exemple{Style of bonds}/\chemfig[bond style={line width=1pt,red}]{A-B=C>|D<E>:F}/
-\label{modif.retrait} The spacing $\delta$ for just one bond can be specified with the character \verb-#-. 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:
+\label{modif.retrait} The spacing $\delta$ for just one bond can be specified with the character \verb-#-. 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
\exemple{Fine adjustment of bond shortening}/\setchemfig{bond offset=4pt}
@@ -432,10 +449,9 @@ There are settings specifically for Cram bonds:
Here is an example where the three dimensions are changed:
-\exemple{Modified Cram bonds}-\setchemfig{cram width=10pt,
- cram dash width=0.4pt,
- cram dash sep=1pt}
-\chemfig{A>B>:C>|D}-
+\exemple{Modified Cram bonds}-\chemfig[cram width=10pt,
+ cram dash width=0.4pt,
+ cram dash sep=1pt]{A>B>:C>|D}-
\section{Bond angle}
Each bond takes an optional argument in brackets. This optional argument can adjust every aspect of a bond, and consists of five optional fields separated by commas. The first of these fields defines the bond angle. Angles increase counterclockwise, and are relative to the horizontal. If the angle field is empty, the angle takes its default value of 0\degres. We will see later how to change this default.
@@ -453,21 +469,20 @@ For those who find this "ugly\footnote{See \texttt{\detokenize{http://tex.stacke
\exemple{Connecting bonds}/\setchemfig{bond style={line width=3pt}}
\chemfig{-[1]-[7]} et
-\setchemfig{bond join=true}\chemfig{-[1]-[7]}/
+\chemfig[bond join=true]{-[1]-[7]}/
\label{angle increment}The \chevrons{key} \CFkv{angle increment}{angle} sets the default angle used to calculate the angle of a bond:
\exemple{Set the predefined angle}/Default (45) : \chemfig{-[1]-[-1]-[1]-[-1]}
-\setchemfig{angle increment=30}
-Angle of 30 : \chemfig{-[1]-[-1]-[1]-[-1]}/
+Angle of 30 : \chemfig[angle increment=30]{-[1]-[-1]-[1]-[-1]}/
\subsection{Absolute angles}
-If one wishes to specify an angle in degrees relative to the horizontal, then the optional angle field must take this form: \verb-[:<absolute angle>]-. If necessary, the \verb-<absolute angle>- is reduced to the interval $[0,360)$:
+If one wishes to specify an angle in degrees relative to the horizontal, then the optional angle field must take this form: \Verb-[:<absolute angle>]-. If necessary, the \Verb-<absolute angle>- is reduced to the interval $[0,360)$:
\exemple{Absolute angles}/\chemfig{A-[:30]B=[:-75]C-[:10]D-[:90]>|[:60]-[:-20]E-[:0]~[:-75]F}/
\subsection{Relative angles}\label{angle.relatif}
-It is often useful to specify a bond angle relative to the preceding bond. This syntax must be then be used: \verb-[::<relative angle>]-. The sign of the \verb-<relative angle>- can be omitted if it is a \verb-+-.
+It is often useful to specify a bond angle relative to the preceding bond. This syntax must be then be used: \Verb-[::<relative angle>]-. The sign of the \Verb-<relative angle>- can be omitted if it is a \verb-+-.
Here is a molecule where the first bond has an absolute angle of $-5\degres$, and the rest of the bond angles are incremented by 20\degres:
\exemple{Result of relative angles}|\chemfig{A-[:-5]-[::+20]-[::20]B-[::+20]-[::20]C-[::20]}|
@@ -493,20 +508,20 @@ It is possible to change the behavior of \CF about the interatomic spacing. Inde
\begin{tikzpicture}[every node/.style={anchor=base,inner sep=1.5pt,outer sep=0pt,minimum size=0pt},baseline]
\node[draw] at(0,0)(aa){\huge A};
\node[draw]at(4,0)(bb){\huge B};
- \path[shorten <=5pt,shorten >=5pt,draw](aa)--(bb)coordinate[pos=0](al) coordinate[pos=1](bl);
+ \path[shorten <=10pt,shorten >=10pt,draw](aa)--(bb)coordinate[pos=0](al) coordinate[pos=1](bl);
\node[draw,circle,fill,blue,minimum size=1.5pt,inner sep=0pt]at(al){};
- \node[draw,circle,fill,blue,minimum size=1.5pt,inner sep=0pt]at([xshift=5pt]al){};
+ \node[draw,circle,fill,blue,minimum size=1.5pt,inner sep=0pt]at([xshift=10pt]al){};
\node[draw,circle,fill,blue,minimum size=1.5pt,inner sep=0pt]at(bl){};
- \node[draw,circle,fill,blue,minimum size=1.5pt,inner sep=0pt]at([xshift=-5pt]bl){};
+ \node[draw,circle,fill,blue,minimum size=1.5pt,inner sep=0pt]at([xshift=-10pt]bl){};
\draw[blue,dash pattern=on 1pt off 1pt](bl)--([yshift=0.7cm]bl);
- \draw[blue,dash pattern=on 1pt off 1pt]([xshift=-5pt]bl)--([xshift=-5pt,yshift=0.7cm]bl);
- \draw[<->]([yshift=0.6cm]bl.center)--([xshift=-5pt,yshift=0.6cm]bl.center) node [midway,above,draw=none]{$\delta$};
+ \draw[blue,dash pattern=on 1pt off 1pt]([xshift=-10pt]bl)--([xshift=-10pt,yshift=0.7cm]bl);
+ \draw[stealth-stealth]([yshift=0.6cm]bl.center)--([xshift=-10pt,yshift=0.6cm]bl.center) node [midway,above,draw=none]{$\delta$};
\draw[blue,dash pattern=on 1pt off 1pt](al)--([yshift=0.7cm]al);
- \draw[blue,dash pattern=on 1pt off 1pt]([xshift=5pt]al)--([xshift=5pt,yshift=0.7cm]al);
- \draw[<->]([yshift=0.6cm]al.center)--([xshift=5pt,yshift=0.6cm]al.center) node [midway,above,draw=none]{$\delta$};
+ \draw[blue,dash pattern=on 1pt off 1pt]([xshift=10pt]al)--([xshift=10pt,yshift=0.7cm]al);
+ \draw[stealth-stealth]([yshift=0.6cm]al.center)--([xshift=10pt,yshift=0.6cm]al.center) node [midway,above,draw=none]{$\delta$};
\node[draw,circle,fill,red,minimum size=2pt,inner sep=0pt]at(aa){};
\node[draw,circle,fill,red,minimum size=2pt,inner sep=0pt]at(bb){};
- \draw[<->]([yshift=1cm]aa.center)--([yshift=1cm]bb.center) node [midway,above,draw=none] {$\Delta$} ;
+ \draw[stealth-stealth]([yshift=1cm]aa.center)--([yshift=1cm]bb.center) node [midway,above,draw=none] {$\Delta$} ;
\draw[red,dash pattern=on 2pt off2pt](aa.center)--([yshift=1.1cm]aa.center);
\draw[red,dash pattern=on 2pt off2pt](bb.center)--([yshift=1.1cm]bb.center);
\end{tikzpicture}
@@ -514,28 +529,28 @@ It is possible to change the behavior of \CF about the interatomic spacing. Inde
\begin{tikzpicture}[every node/.style={anchor=base,inner sep=1.5pt,outer sep=0pt,minimum size=0pt},baseline]
\node[draw] at(0,0)(aa){\huge A};
\node[draw]at(5,0)(bb){\huge B};
- \path[shorten <=5pt,shorten >=5pt,draw](aa)--(bb)coordinate[pos=0](al) coordinate[pos=1](bl);
+ \path[shorten <=10pt,shorten >=10pt,draw](aa)--(bb)coordinate[pos=0](al) coordinate[pos=1](bl);
\node[draw,circle,fill,blue,minimum size=1.5pt,inner sep=0pt]at(al){};
- \node[draw,circle,fill,blue,minimum size=1.5pt,inner sep=0pt]at([xshift=5pt]al){};
+ \node[draw,circle,fill,blue,minimum size=1.5pt,inner sep=0pt]at([xshift=10pt]al){};
\node[draw,circle,fill,blue,minimum size=1.5pt,inner sep=0pt]at(bl){};
- \node[draw,circle,fill,blue,minimum size=1.5pt,inner sep=0pt]at([xshift=-5pt]bl){};
+ \node[draw,circle,fill,blue,minimum size=1.5pt,inner sep=0pt]at([xshift=-10pt]bl){};
\draw[blue,dash pattern=on 1pt off 1pt](bl)--([yshift=0.7cm]bl);
- \draw[blue,dash pattern=on 1pt off 1pt]([xshift=-5pt]bl)--([xshift=-5pt,yshift=0.7cm]bl);
- \draw[<->]([yshift=0.6cm]bl.center)--([xshift=-5pt,yshift=0.6cm]bl.center) node [midway,above,draw=none]{$\delta$};
+ \draw[blue,dash pattern=on 1pt off 1pt]([xshift=-10pt]bl)--([xshift=-10pt,yshift=0.7cm]bl);
+ \draw[stealth-stealth]([yshift=0.6cm]bl.center)--([xshift=-10pt,yshift=0.6cm]bl.center) node [midway,above,draw=none]{$\delta$};
\draw[blue,dash pattern=on 1pt off 1pt](al)--([yshift=0.7cm]al);
- \draw[blue,dash pattern=on 1pt off 1pt]([xshift=5pt]al)--([xshift=5pt,yshift=0.7cm]al);
- \draw[<->]([yshift=0.6cm]al.center)--([xshift=5pt,yshift=0.6cm]al.center) node [midway,above,draw=none]{$\delta$};
- \draw[<->]([yshift=1cm]al)--([yshift=1cm]bl) node [midway,above,draw=none] {$\Delta$} ;
+ \draw[blue,dash pattern=on 1pt off 1pt]([xshift=10pt]al)--([xshift=10pt,yshift=0.7cm]al);
+ \draw[stealth-stealth]([yshift=0.6cm]al.center)--([xshift=10pt,yshift=0.6cm]al.center) node [midway,above,draw=none]{$\delta$};
+ \draw[stealth-stealth]([yshift=1cm]al)--([yshift=1cm]bl) node [midway,above,draw=none] {$\Delta$} ;
\draw[red,dash pattern=on 2pt off2pt](al)--([yshift=1.1cm]al);
\draw[red,dash pattern=on 2pt off2pt](bl)--([yshift=1.1cm]bl);
\end{tikzpicture}
\end{tabular}
\end{center}
-In rings, even when \CFkv{fixed length}{true}, the default behaviour is restored for the bonds of the cylce, in order to draw regular polygons.
+In rings, even when \CFkv{fixed length}{true}, the default behavior is restored for the bonds of the cycle, in order to draw regular polygons.
\exemple{Fixed length bonds}/\chemfig{Cl-Cl}\par
-\setchemfig{fixed length=true}\chemfig{Cl-Cl}/
+\chemfig[fixed length=true]{Cl-Cl}/
Especially with the default behavior, to avoid too short bonds, it is sometimes necessary to increase (or perhaps reduce) the interatomic distance. For this, the optional argument to bonds is actually made up of several comma-separated fields. As we have seen, the first field specifies the angle. The second field, if it is not empty, is a coefficient which multiplies the default interatomic distance $\Delta$. Thus, writing \verb+-[,2]+ asks that this bond have the default angle (first field is empty) and that the atoms it connects be separated by twice the default distance.
\exemple{Modified bond length}/\chemfig{A^{++}_{2}-[,2]B^{-}_3}\par
@@ -565,20 +580,21 @@ In the following examples, the angles are in the interval $[90,270]$ and so the
\chemfig{ABCD-[5]EFG}|
One may sometimes want the bond partners to be atoms other than those determined by \CF. The departure and arrival atoms can be set with the optional bond argument by writing:
-\centerverb/[,,<integer 1>,<integer 2>]/
-\smallskip
-
-where \verb-<integer 1>- and \verb-<integer 2>- are the numbers of the desired departure and arrival atoms. These atoms must exist, otherwise an error message will be given.
+\begin{center}
+ \Verb/[,,<integer 1>,<integer 2>]/
+\end{center}
+where \Verb-<integer 1>- and \Verb-<integer 2>- are the numbers of the desired departure and arrival atoms. These atoms must exist, otherwise an error message will be given.
\exemple{Specified atom connections}|\chemfig{ABCD-[:75,,2,3]EFG}\qquad
\chemfig{ABCD-[:75,,,2]EFG}\qquad
\chemfig{ABCD-[:75,,3,2]EFG}|
\section{Customization of bonds}\label{perso-liaisons}
There is a fifth and last optional argument for bonds which is found after the fourth comma:
-\centerverb/[,,,,<tikz code>]/
-\smallskip
+\begin{center}
+ \Verb/[,,,,<tikz code>]/
+\end{center}
-This \verb-<tikz code>- is passed directly to \TIKZ when the bond is drawn. There one can put characteristics such as colour (\verb-red-), dash type (\verb-dash pattern=on 2pt off 2pt-), thickness (\verb-line width=2pt-), or even decoration if the \TIKZ decoration library has been loaded. A bond can be made invisible by writing ``\verb-draw=none-''. To set several attributes, the syntax of \TIKZ is used, separating them by a comma:
+This \Verb-<tikz code>- is passed directly to \TIKZ when the bond is drawn. There one can put characteristics such as colour (\verb-red-), dash type (\verb-dash pattern=on 2pt off 2pt-), thickness (\verb-line width=2pt-), or even decoration if the \TIKZ decoration library has been loaded. A bond can be made invisible by writing ``\verb-draw=none-''. To set several attributes, the syntax of \TIKZ is used, separating them by a comma:
\exemple{Passing tikz code}|\chemfig{A-[,,,,red]B}\par
\chemfig{A-[,,,,dash pattern=on 2pt off 2pt]B}\par
\chemfig{A-[,,,,line width=2pt]B}\par
@@ -594,13 +610,14 @@ At the beginning of each molecule, the default values for the optional arguments
\begin{itemize}
\item 0\degres{} for the bond angle;
\item 1 for the length multiplication coefficient;
- \item \verb-<empty>- for the numbers of the departure and arrival atoms, which lets \CF calculate these based on the bond angle;
- \item \verb-<empty>- for the parameters passed to \TIKZ.
+ \item \Verb-<empty>- for the numbers of the departure and arrival atoms, which lets \CF calculate these based on the bond angle;
+ \item \Verb-<empty>- for the parameters passed to \TIKZ.
\end{itemize}
These default values can be changed for the whole molecule by beginning the molecule code with
-\centerverb/[<angle>,<coeff>,<n1>,<n2>,<tikz code]/
-\smallskip
+\begin{center}
+ \Verb/[<angle>,<coeff>,<n1>,<n2>,<code tikz>]/
+\end{center}
Thus, if the code of a molecule begins with \verb-[:20,1.5]-, then all the bonds will be at angle of 20\degres{} by default, and the interatomic distances will have a length 1.5 times the default length. These default values can be overridden at any time by giving an optional argument, such as for the bond which follows atom ``C'' in this example:
\exemple{Overriding default values}|\chemfig{[:20,1.5]A-B-C-[:-80,0.7]D-E-F}|
@@ -610,7 +627,7 @@ If something odd like \verb-[1,1.5,2,2,red,thick]- is written, then unless other
\section{Branches}
\subsection{Principle}
-Up to now, all the molecules have been linear, which is rare. A sub-molecule can be attached to an atom by following the atom with \verb-<code>- in parentheses. This \verb-<code>- is the code of the submolecule which will be attached to the atom.
+Up to now, all the molecules have been linear, which is rare. A sub-molecule can be attached to an atom by following the atom with \Verb-<code>- in parentheses. This \Verb-<code>- is the code of the sub-molecule which will be attached to the atom.
In this example, the sub-molecule ``\verb/-[1]W-X/'' will be attached to atom ``B'':
\exemple{A branch}|\chemfig{A-B(-[1]W-X)-C}|
@@ -656,16 +673,16 @@ We could connect other atoms to X by following them with \verb-?-. Here it's the
\exemple{Several distant bonds}|\chemfig{A-B(-[1]W-X?)(-[7]Y-Z?)-C?}|
Now imagine if we were to leave the distant bonds \verb/X-C/ and \verb/X-Z/while adding another: \verb/A-W/. We must therefore ask for two \emph{different} hooks, one on \verb/A/ and the other on \verb/X/. Fortunately the character \verb/?/ has an optional argument:
-\centerverb/?[<name>,<bond>,<tikz>]/
-\smallskip
-
+\begin{center}
+ \Verb/?[<name>,<bond>,<tikz>]/
+\end{center}
where each field takes its default value if it is empty:
\begin{itemize}
- \item The \verb-<name>- is the name of the hook: all alphanumeric characters (a\dots z, A\dots Z, 0\dots 9) are allowed\footnote{This is not exactly right. Actually all the characters that can be put between \texttt{\string\csname...\string\endcsname} are allowed.}. The name is \verb-a- by default. In the first occurrence of the hook with this name, only this field is used.
- \item \verb-<bond>- specifies how the atom with the current occurrence of the named hook is to be bonded to the atom with the first occurrence of the hook. There are two ways this can be done. First, this field can be an integer representing the desired bond type: 1=single bond, 2=double bond, etc. (See the table on page~\pageref{types.liaisons} for the bond codes.)
+ \item The \Verb-<name>- is the name of the hook: all alphanumeric characters (a\dots z, A\dots Z, 0\dots 9) are allowed\footnote{This is not exactly right. Actually all the characters that can be put between \texttt{\string\csname...\string\endcsname} are allowed.}. The name is \verb-a- by default. In the first occurrence of the hook with this name, only this field is used.
+ \item \Verb-<bond>- specifies how the atom with the current occurrence of the named hook is to be bonded to the atom with the first occurrence of the hook. There are two ways this can be done. First, this field can be an integer representing the desired bond type: 1=single bond, 2=double bond, etc. (See the table on page~\pageref{types.liaisons} for the bond codes.)
Second, the field can be one of the bond character codes, provided that this character is \emph{between braces}.
- \item \verb-<tikz>- will be passed directly to \TIKZ as we have seen with regular bonds.
+ \item \Verb-<tikz>- will be passed directly to \TIKZ as we have seen with regular bonds.
\end{itemize}
Here is our molecule with the required distant bonds, then with the bond \verb/A-W/ and \verb/X-C/ customized:
@@ -683,11 +700,11 @@ Then we must do this:
The preceding example shows how to draw a regular polygon, but the method used is tedious because the angles depend on the number of sides of the polygon.
\subsection{Syntax}
-\CF can easily draw regular polygons. The idea is to attach a ring to an \verb/<atom>/ outside the ring with this syntax:
-\centerverb/<atom>*<n>(<code>)/
-\smallskip
-
-\verb/<n>/ is the number of sides of the polygon and the \verb/<code>/ describes the bonds and groups of atoms which make up its edges and vertices. This code \emph{must} begin with a bond because the atom is outside the ring.
+\CF can easily draw regular polygons. The idea is to attach a ring to an \Verb/<atom>/ outside the ring with this syntax:
+\begin{center}
+ \Verb/<atom>*<n>(<code>)/
+\end{center}
+\Verb/<n>/ is the number of sides of the polygon and the \Verb/<code>/ describes the bonds and groups of atoms which make up its edges and vertices. This code \emph{must} begin with a bond because the atom is outside the ring.
Here is a 5-ring, attached to the atom ``\verb/A/'':
\exemple{5-ring}|\chemfig{A*5(-B=C-D-E=)}|
@@ -701,13 +718,13 @@ If a ring has a code which contains too many bonds and atom groups for the given
\exemple{Truncated 5-ring}|\chemfig{A*5(-B=C-D-E=F-G=H-I)}|
It is possible to draw a circle or an arc in the inside of a ring. To do so, the following syntax is used:
-\centerverb/<atom>**[<angle 1>,<angle 2>,<tikz>]<n>(<code>)/
-\smallskip
-
+\begin{center}
+ \Verb/<atom>**[<angle 1>,<angle 2>,<tikz>]<n>(<code>)/
+\end{center}
where each field of the optional argument takes its default value if it is empty:
\begin{itemize}
- \item \verb/<angle 1>/ and \verb/<angle 2>/ are the absolute angles of the start and finish of the arc. These default to 0\degres{} and 360\degres{} respectively so that a circle is drawn by default;
- \item \verb/<tikz>/ is the code that will be passed to \TIKZ for drawing the arc.
+ \item \Verb/<angle 1>/ and \Verb/<angle 2>/ are the absolute angles of the start and finish of the arc. These default to 0\degres{} and 360\degres{} respectively so that a circle is drawn by default;
+ \item \Verb/<tikz>/ is the code that will be passed to \TIKZ for drawing the arc.
\end{itemize}
\exemple{Rings and arcs}|\chemfig{**6(------)}\quad
@@ -736,10 +753,10 @@ The rule remains valid, whatever the angle of the preceding bond:
\subsection{Branches on a ring}
To have branches attached to the vertices of a ring, we use the syntax we have already seen:
-\centerverb/<atom>(<code>)/
-\smallskip
-
-where the \verb/<code>/ is that of the sub-molecule and the \verb-<atom>- is at the vertex. Unique to rings, the default angle of the sub-molecule is not 0\degres{} but is calculated so that it will bisect the sides leaving the vertex:
+\begin{center}
+ \Verb/<atom>(<code>)/
+\end{center}
+where the \Verb/<code>/ is that of the sub-molecule and the \Verb-<atom>- is at the vertex. Unique to rings, the default angle of the sub-molecule is not 0\degres{} but is calculated so that it will bisect the sides leaving the vertex:
\exemple{Branch on a ring}|\chemfig{X*6(-=-(-A-B=C)=-=-)}|
A sub-molecule can be attached to the first vertex of a ring, just like the other vertices:
@@ -764,7 +781,7 @@ Note that the ring which is going to be attached to the main ring has an angular
It is quite possible to glue multiple rings together:
\exemple{Multiple nested rings}|\chemfig{*5(--*6(-*4(-*5(----)--)----)---)}|
-There is a case where a trick must be used. It can be seen in this example that the fourth side of the second 5-ring just passes through the centre of atom ``\verb-E-''.
+There is a case where a trick must be used. It can be seen in this example that the fourth side of the second 5-ring just passes through the center of atom ``\verb-E-''.
\exemple{Flawed drawing}|\chemfig{A-B*5(-C-D*5(-X-Y-Z-)-E-F-)}|
This is normal because the second 5-ring (which is attached to atom ``\verb-D-'') is drawn \emph{before} \CF knows about atom ``\verb-E-''. In this case, it is necessary to use two hooks to draw the bond \verb/Z-E/:
@@ -781,18 +798,19 @@ In order for the ring to have a regular shape, it is necessary to override the \
\exemple{Forced departure and arrival atoms}|\chemfig{AB*5(-CDE-[,,1]F-[,,,1]GH-I-)}|
\section{Representing electron movements}\label{mecanismes-reactionnels}
-Starting with \CF version 0.3, we can represent the movement of electrons in mesomeric effects or reaction mechanisms. This is done by marking the departure and arrival points of the electron movement arrow using the syntax ``\verb-@{<argument>}-''. This syntax allows a \TIKZ node to be placed and makes this node accessible outside the argument of the \verb-\chemfig- command thanks to the ``\texttt{remember picture}'' option which is passed to all the ``\falseverb{tikzpicture}'' environments. It is assumed that the viewer supports ``\falseverb{picture remembering}'' and that the compilation is done twice.
+Starting with \CF version 0.3, we can represent the movement of electrons in mesomeric effects or reaction mechanisms. This is done by marking the departure and arrival points of the electron movement arrow using the syntax ``\Verb-@{<argument>}-''. This syntax allows a \TIKZ node to be placed and makes this node accessible outside the argument of the \verb-\chemfig- command thanks to the ``\texttt{remember picture}'' option which is passed to all the ``\falseverb{tikzpicture}'' environments. It is assumed that the viewer supports ``\falseverb{picture remembering}'' and that the compilation is done twice.
Two types of diagrams can arise, so we can ask for:
\begin{itemize}
- \item a zero size node on a bond using the syntax ``\verb-@{<name>,<coeff>}-'' placed at the beginning of the optional argument of the relevant bond, without being followed by a comma if there is a first optional argument. In this case, the node takes the name ``\verb-<name>-'' and the \verb-<coeff>-, which must be between 0 and 1, determines where the node is located on the bond. If ``\verb-@{<name>}-'' is used, the \verb-<coeff>- is set to 0.5 by default, which means that the node is placed halfway along the bond;
- \item a node on an atom using the syntax ``\verb-@{<name>}-'' immediately before the relevant atom. In this case, the node has exactly the same footprint as the atom, but may be empty and therefore have zero dimensions.
+ \item a zero size node on a bond using the syntax ``\Verb-@{<name>,<coeff>}-'' placed at the beginning of the optional argument of the relevant bond, without being followed by a comma if there is a first optional argument. In this case, the node takes the name ``\Verb-<name>-'' and the \Verb-<coeff>-, which must be between 0 and 1, determines where the node is located on the bond. If ``\Verb-@{<name>}-'' is used, the \Verb-<coeff>- is set to 0.5 by default, which means that the node is placed halfway along the bond;
+ \item a node on an atom using the syntax ``\Verb-@{<name>}-'' immediately before the relevant atom. In this case, the node has exactly the same footprint as the atom, but may be empty and therefore have zero dimensions.
\end{itemize}
-Once the \falseverb{\chemfig} command has drawn the molecule(s) and has placed the nodes with the syntax described above, we can connect these nodes to each other with \TIKZ instructions. These instructions are placed in the argument of the command \verb-\chemmove-\footnote{Actually, the \texttt{\string\chemmove} command puts its argument in a ``\falseverb{tikzpicture}'' environment with the options ``\texttt{remember picture, overlay}''.} and has the following syntax if (for example) we need to connect a node named ``\verb-<name1>-'' to the node named ``\verb-<name2>-'':
-\centerverb|\chemmove[<opt>]{\draw[<tikz opt>](<name1>)<tikz link>(<name2>);}|
-\smallskip
+Once the \falseverb{\chemfig} command has drawn the molecule(s) and has placed the nodes with the syntax described above, we can connect these nodes to each other with \TIKZ instructions. These instructions are placed in the argument of the command \verb-\chemmove-\footnote{Actually, the \texttt{\string\chemmove} command puts its argument in a ``\falseverb{tikzpicture}'' environment with the options ``\texttt{remember picture, overlay}''.} and has the following syntax if (for example) we need to connect a node named ``\Verb-<name1>-'' to the node named ``\Verb-<name2>-'':
+\begin{center}
+ \Verb|\chemmove[<opt>]{\draw[<tikz opt>](<name1>)<tikz link>(<name2>);}|
+\end{center}
-The optional argument \verb-<opt>- of the \verb-\chemmove- command will be added to the argument of the \falseverb{tikzpicture} environment in which the links between the nodes will be drawn. The \verb-<tikz opt>- and \verb-<tikz link>- instructions are describe in detail in the documentation of the \TIKZ package.
+The optional argument \Verb-<opt>- of the \verb-\chemmove- command will be added to the argument of the \falseverb{tikzpicture} environment in which the links between the nodes will be drawn. The \Verb-<tikz opt>- and \Verb-<tikz link>- instructions are describe in detail in the documentation of the \TIKZ package.
\subsection{Mesomeric effects}
To make these concepts concrete, let's take the example of a mesomeric effect involving a double bond and non-bonding lone pair conjugate. Let's begin with the possible delocalization of electrons from the double bond. We will place a node named ``db'' (double bond) in the middle of the double bond and a node named ``a1'' on the end of the double bond.
@@ -810,8 +828,9 @@ Les macros \verb|\schemestart|, \verb|\schemestop|, \verb|\arrow| et \verb|\+| s
As noted above, there is no comma after the node placed in the optional arguments of a bond; we write ``\verb|=_[@{db}::30]|'' and not ``\verb|=_[@{db},::30]|'' as one might be tempted to do.
To link the nodes ``db'' and ``a1'' we have used the following syntax:
-\centerverb|\chemmove{\draw(db)..controls +(80:8mm) and +(145:8mm)..(a1);}|
-\medskip
+\begin{center}
+ \Verb|\chemmove{\draw(db)..controls +(80:8mm) and +(145:8mm)..(a1);}|
+\end{center}
For arrows in \verb|\chemmove|, the default tip is ``CF''.In this example we ask for an arrow (\verb/[->]/) and we use two \falseverb{control points}\footnote{To find all the ways of connecting two nodes with \TIKZ, read the documentation for that package.}. These will be located using polar coordinates at 80\degres{} and 8~mm from ``db'' for the first and at 145\degres{} and 8~mm from ``a1'' for the second. Though this syntax may seem complicated at first reading, one need not be alarmed because its use will usually be a matter of copying and pasting. Only the names and coordinates of the control points need be changed, as can be verified from the example below, where an arrow has been added from the lone pair (node ``dnl'' to the single bond (node ``sb'').
\exemple{Mesomeric effect 2}/\schemestart
@@ -859,7 +878,7 @@ In the following example, we'll see how to indicate the position of the departur
\chemmove{\draw[shorten >=4pt]
(x1).. controls +(90:1cm) and +(90:1cm).. (x2);}/
-Note that the tail of the arrow does not leave correctly from our electrons; it leaves from the middle of the upper edge of the node. Indeed, we chose a departure angle of 90~\degres{} and so \TIKZ makes the arrow leave from the anchor ``x1.90'' which corresponds to the intersection of the ray leaving from the centre of node ``x1'' at a 90\degres{} angle relative to the horizontal and of the edge of the rectangular node. To get the arrow departure angle that we want, we must specify its position. After some trial and error, it is ``x1.57'':
+Note that the tail of the arrow does not leave correctly from our electrons; it leaves from the middle of the upper edge of the node. Indeed, we chose a departure angle of 90~\degres{} and so \TIKZ makes the arrow leave from the anchor ``x1.90'' which corresponds to the intersection of the ray leaving from the center of node ``x1'' at a 90\degres{} angle relative to the horizontal and of the edge of the rectangular node. To get the arrow departure angle that we want, we must specify its position. After some trial and error, it is ``x1.57'':
\exemple{Departure or arrival anchor point 2}/\chemfig{@{x1}\lewis{1:,X}}
\hspace{2cm}
\chemfig{@{x2}\lewis{2|,X}}
@@ -888,7 +907,7 @@ Thanks to the option \verb|remenber picture| which is passed to all the ``tikzpi
\draw(dnl)..controls +(90:1cm)and+(north:1cm)..(atoc);
\draw[shorten >=6pt](db)..controls +(north:5mm)and+(100:1cm)..(atoh);}/
-The use of the \verb|\chemabove{<code>}{<materiel>}| command does not change the dimensions of the \falseverb{bounding box} of \verb|<code>|. For this reason we can run into some difficulty in pointing to the symbol representing the charge carried ($\oplus$ or $\ominus$). In the example above the solution is to create a control point with an angle of 110\degres{} at 1~cm from ``atoh'' and to shorten the arrow by 6pt. In the following example, the second step of the esterification reaction, we can see that the arrow can take more complicated forms without complicating the code.
+The use of the \Verb|\chemabove{<code>}{<materiel>}| command does not change the dimensions of the \falseverb{bounding box} of \Verb|<code>|. For this reason we can run into some difficulty in pointing to the symbol representing the charge carried ($\oplus$ or $\ominus$). In the example above the solution is to create a control point with an angle of 110\degres{} at 1~cm from ``atoh'' and to shorten the arrow by 6pt. In the following example, the second step of the esterification reaction, we can see that the arrow can take more complicated forms without complicating the code.
\exemple{Esterification: step 2}/\setchemfig{atom sep=7mm}
\chemfig{R-O-C(-[2]R)(-[6]OH)-@{dnl}\lewis{26,O}H}\hspace{1cm}
\chemfig{@{atoh}\chemabove{H}{\scriptstyle\oplus}}
@@ -900,10 +919,11 @@ The rest is left as an exercise to the reader\dots.
\section{Writing a name under a molecule}\label{chemname}
For convenience, \CF can write the name of a molecule underneath it with the command
-\centerverb/\chemname[<dim>]{\chemfig{<code of the molecule>}}{<name>}/
-\smallskip
+\begin{center}
+ \Verb/\chemname[<dim>]{\chemfig{<code of the molecule>}}{<name>}/
+\end{center}
-The \verb-<dim>-, which is 1.5ex by default, will be inserted between the \falseverb{baseline} of the molecule and the top of the letters of the \verb-<name>-. The \verb-<name>- will be centred relative to the molecule, but the \verb-<name>- may not contain multiple paragraphs. As we see in this example: \chemname{\chemfig{H-O-H}}{\scriptsize\bfseries The water molecule: $\mathrm{\mathbf{H_2O}}$}, the \verb-<name>- which is displayed under the molecule is taken into account only for the vertical size of the bounding box. The horizontal size of \verb-<name>- is always zero.
+The \Verb-<dim>-, which is 1.5ex by default, will be inserted between the \falseverb{baseline} of the molecule and the top of the letters of the \Verb-<name>-. The \Verb-<name>- will be centered relative to the molecule, but the \Verb-<name>- may not contain multiple paragraphs. As we see in this example: \chemname{\chemfig{H-O-H}}{\scriptsize\bfseries The water molecule: $\mathrm{\mathbf{H_2O}}$}, the \Verb-<name>- which is displayed under the molecule is taken into account only for the vertical size of the bounding box. The horizontal size of \Verb-<name>- is always zero.
Here is a reaction with the names under the molecules:
\exemple*{Displaying names of molecules}/\schemestart
@@ -929,9 +949,9 @@ There are some limitations to this command. Suppose we switch the acid and the a
\schemestop
\chemnameinit{}/
-In fact, to draw the \verb-<name>- the command \falseverb{\chemname} inserts 1.5ex${}+{}$\emph{the largest of the depths\footnote{In \TeX{} terms, the depth is the dimension which extends vertically below the baseline.} of the molecules thus far} below the baseline of each molecule (light grey for the examples in this manual). The command \falseverb{\chenameinit}\verb-{<stuff>}- initializes this largest depth with the \verb-<stuff>-. Therefore one should:
+In fact, to draw the \Verb-<name>- the command \falseverb{\chemname} inserts 1.5ex${}+{}$\emph{the largest of the depths\footnote{In \TeX{} terms, the depth is the dimension which extends vertically below the baseline.} of the molecules thus far} below the baseline of each molecule (light gray for the examples in this manual). The command \falseverb{\chenameinit}\Verb-{<stuff>}- initializes this largest depth with the \Verb-<stuff>-. Therefore one should:
\begin{itemize}
- \item write \verb-\chemnameinit{<deepest molecule>}- before using the \verb-\chemname- command in a reaction, unless the reaction begins with the deepest molecule;
+ \item write \Verb-\chemnameinit{<deepest molecule>}- before using the \verb-\chemname- command in a reaction, unless the reaction begins with the deepest molecule;
\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}
@@ -948,7 +968,7 @@ Thus the correct code uses \falseverb{\chemnameinit} before and after the reacti
\schemestop
\chemnameinit{}/
-Finally, to write a name on multiple lines, the command \verb-\\- encountered in a \verb-<name>- causes a line break\footnote{Conversely, the command \texttt{\textbackslash par} is forbidden and causes a compilation error.}:
+Finally, to write a name on multiple lines, the command \verb-\\- encountered in a \Verb-<name>- causes a line break\footnote{Conversely, the command \texttt{\textbackslash par} is forbidden and causes a compilation error.}:
\exemple*{Name on 2 lines}/\schemestart
\chemname{\chemfig{R-C(-[:-30]OH)=[:30]O}}{Carboxilic\\Acid}
\+
@@ -960,7 +980,7 @@ Finally, to write a name on multiple lines, the command \verb-\\- encountered in
\schemestop
\chemnameinit{}/
-If \verb|\chemname*{<nom>}| is written, the macro does not take into account the previous names.
+If \Verb|\chemname*{<name>}| is written, the macro does not take into account the previous names.
\newpage
\part{Advanced usage}\label{utilisation.avancee}
@@ -1000,7 +1020,7 @@ Here is how to redefine it to use the ``sf'' font family of math mode:
\section{Arguments given to tikz}\label{arguments.optionnels}
The \chevrons{key} \CFkey{chemfig style} contains \TIKZ instructions which will be passed to the \falseverb{tikzpicture} environment in which the molecule is drawn. On the other hand, the The \chevrons{key} \CFkey{atom style} contains \TIKZ instructions which will be executed when each node; these instructions are added to the end of \texttt{every node/.style\{<argument>\}}, i.e. after the fhe following instructions: ``{\ttfamily anchor=base,inner sep=0pt,outer sep=0pt,minimum size=0pt}''.
-With the use of the first optional argument one can, for example, choose the global colour or thickness of lines:
+With the use of the first optional argument one can, for example, choose the global color or thickness of lines:
\exemple{Style choice}/\chemfig{A-B-[2]C}\par\medskip
\setchemfig{chemfig style={line width=1.5pt}}\chemfig{A-B-[2]C}\par\medskip
\setchemfig{chemfig style=red}\chemfig{A-B-[2]C}/
@@ -1088,21 +1108,21 @@ Shifted bonds are particularly useful in drawing skeleton diagrams of molecules
\chemfig{-[:30]=_[:-30]-[:30]=_[:-30]-[:30]}/
\section{Delocalized double bonds}
-It is sometimes necessary to draw a double bond so that one line would be full and the other dashed. This feature is not hard-coded in \CF since \TIKZ, with its ``decorations.markings'' librairy makes it possible.
+It is sometimes necessary to draw a double bond so that one line would be full and the other dashed. This feature is not hard-coded in \CF since \TIKZ, with its ``decorations.markings'' library makes it possible.
-\exemple*{Delocalized bonds}|\catcode`\@=11
+\exemple*{Delocalized bonds}|\catcode`\_=11
\tikzset{
ddbond/.style args={#1}{
draw=none,
decoration={%
markings,
mark=at position 0 with {
- \coordinate (CF@startdeloc) at (0,\dimexpr#1\CF@double@sep/2)
- coordinate (CF@startaxis) at (0,\dimexpr-#1\CF@double@sep/2);
+ \coordinate (CF@startdeloc) at (0,\dimexpr#1\CF_doublesep/2)
+ coordinate (CF@startaxis) at (0,\dimexpr-#1\CF_doublesep/2);
},
mark=at position 1 with {
- \coordinate (CF@enddeloc) at (0,\dimexpr#1\CF@double@sep/2)
- coordinate (CF@endaxis) at (0,\dimexpr-#1\CF@double@sep/2);
+ \coordinate (CF@enddeloc) at (0,\dimexpr#1\CF_doublesep/2)
+ coordinate (CF@endaxis) at (0,\dimexpr-#1\CF_doublesep/2);
\draw[dash pattern=on 2pt off 1.5pt] (CF@startdeloc)--(CF@enddeloc);
\draw (CF@startaxis)--(CF@endaxis);
}
@@ -1110,25 +1130,26 @@ It is sometimes necessary to draw a double bond so that one line would be full a
postaction={decorate}
}
}
-\catcode`\@=12
+\catcode`\_=8
\chemfig{A-[,,,,ddbond={+}]B-[,,,,ddbond={-}]C}|
\section{Saving a sub-molecule}\label{definesubmol}
-\CF is capable of saving a \verb-<code>- as an alias for reuse in a more compact form in the code of a molecule. This is particularly useful when the \verb-<code>- appears several times.
+\CF is capable of saving a \Verb-<code>- as an alias for reuse in a more compact form in the code of a molecule. This is particularly useful when the \Verb-<code>- appears several times.
To do this, one gives the command
-\centerverb|\definesubmol{<name>}{<code>}|
-\smallskip
-
-which saves the \verb/<code>/ for recall in the code of the molecule via the shortcut ``\verb/!{name}/''. This \verb-<name>- can be:
+\begin{center}
+ \Verb|\definesubmol{<name>}{<code>}|
+\end{center}
+which saves the \Verb/<code>/ for recall in the code of the molecule via the shortcut ``\verb/!{name}/''. This \Verb-<name>- can be:
\begin{itemize}
\item a sequence of characters: all the alphanumeric characters able to be between \texttt{\string\csname} and \texttt{\string\endcsname} are accepted;
\item a control sequence.
\end{itemize}
In all cases, if the alias is already defined you should not overwrite it with a new definition using \falseverb{\definesubmol}. A warning will be issued to the user that the old alias will be overwritten by the new one. To override the definition of an alias made previously, use:\label{redefinesubmol}
-\centerverb|\redefinesubmol{<name>}{<code>}|
-\smallskip
+\begin{center}
+ \Verb|\redefinesubmol{<name>}{<code>}|
+\end{center}
Here is a code which draws the pentane molecule. An alias ``\verb/xy/'' was defined beforehand for the code \verb/CH_2/:
\exemple{Pentane}|\definesubmol{xy}{CH_2}
@@ -1141,34 +1162,45 @@ But in certain cases, this feature saves a lot of space in the code of the molec
\chemfig{[:15]H-!\xx-!\xx-!\xx-!\xx-H}|
The \falseverb{\definesubmol} command takes an optional argument; its syntax is as follows:
-\centerverb/\definesubmol{<name>}[<code1>]{code2}/
-\medskip
+\begin{center}
+ \Verb/\definesubmol{<name>}[<code1>]{code2}/
+\end{center}
-When the optional argument is present, the alias ``\verb-!<name>-'' will be replaced by \verb'<code1>' if the bond which arrives at the alias comes from the right, i.e., if the angle which the arriving bond makes is between but is not equal to 90\degres{} and 270\degres{}. For all the other cases where the bond arrives from the left of vertically, the alias will be replaced by \verb-<code2>-.
+When the optional argument is present, the alias ``\Verb-!<name>-'' will be replaced by \Verb'<code1>' if the bond which arrives at the alias comes from the right, i.e., if the angle which the arriving bond makes is between but is not equal to 90\degres{} and 270\degres{}. For all the other cases where the bond arrives from the left of vertically, the alias will be replaced by \Verb-<code2>-.
We will define a control sequence \verb-\Me- pour ``methyl'' so that the alias ``\verb-!\Me-'' will be replaced by ``\verb-H_3C-'' when the bond arrives from the right and by ``\verb-CH_3-'' when it arrives from the left. We can observe in the example that with this alias we need no longer worry about the angle:
\exemple{Dual alias}/\definesubmol\Me[H_3C]{CH_3}
\chemfig{*6((-!\Me)=(-!\Me)-(-!\Me)=(-!\Me)-(-!\Me)=(-!\Me)-)}/
-\label{definesubmolarg}The submolecule saved with a \verb|<name>| does not admit an argument when it is called after "\verb|!||". To define a submolecule admitting one or more arguments, place this \verb|<number>| of arguments just after the \verb|<name>|. And the full syntax of \verb|\definesubmol| is:
-
-\centerverb/\definesubmol<number>{<name>}[<code1>]{<code2>}/
+\label{definesubmolarg}The sub-molecule saved with a \Verb|<name>| does not admit an argument when it is called after "\verb|!||". To define a sub-molecule admitting one or more arguments, place this \Verb|<number>| of arguments just after the \Verb|<name>|. And the full syntax of \verb|\definesubmol| is:
+\begin{center}
+ \Verb/\definesubmol{<name>}<number>[<code1>]{<code2>}/
+\end{center}
-In the \verb|<codes>|, the arguments must appear in their usual form "\verb|#<n>|" where \verb|<n>| is the argument number.
+In the \Verb|<codes>|, the arguments must appear in their usual form "\Verb|#<n>|" where \Verb|<n>| is the argument number.
-\exemple{\texttt{\string\definesubmol} avecwith arguments}/\definesubmol\X1{-[,-0.3,,,draw=none]\footnotesize#1}
+\exemple{\texttt{\string\definesubmol} with arguments}/\definesubmol\X1{-[,-0.2,,,draw=none]{\scriptstyle#1}}
\chemfig{*6((!\X A)-(!\X B)-(!\X C)-(!\X D)-(!\X E)-(!\X F)-)}
\definesubmol{foo}3[#3|\textcolor{#1}{#2}]{\textcolor{#1}{#2}|#3}
\chemfig{A(-[:135]!{foo}{red}XY)-B(-[:45]!{foo}{green}{W}{zoo})}/
+It should be noted that if the \Verb|<number>| of arguments is incorrect (negative or greater than 9), an error message will be issued and \CF will consider that the sub molecule does not admit an argument.
+
+Except in cases where the character "\verb|#|" is followed by a number between 1 and \Verb|<number>| in which case it represents an argument, "\verb|#|" are allowed in the sub-molecule codes.
+
+\exemple{Use of \#}/\definesubmol\X2{#1-#2-#2-#3-###(3pt,3pt)#4}
+\chemfig{A-!\X{M}{N}-B}/
+
+In this example, only \verb|#1| and \verb|#2| are understood as the arguments of the sub molecule \verb|\X|. The other "\verb|#|" are displayed as they are in the molecule (case of \verb|#3| and \verb|#4|) or understood as the character specifying the fine adjustment of the offset of the bonds.
+
\section{Decorations}
\subsection{Lewis diagrams}\label{lewis}
The macro \falseverb{\lewis} allows placement of pairs of electrons, of single electrons, or of empty slots. This syntax is used:
-\centerverb|\lewis{<n1><n2>...<ni>,<atom>}|
-\smallskip
-
-where the \verb-<n1>-\dots\verb-<ni>- represent the desired positions (in multiples of 45\degres) around the \verb-<atom>-. These whole numbers must be between 0 and 7.
+\begin{center}
+ \Verb|\lewis{<n1><n2>...<ni>,<atom>}|
+\end{center}
+where the \Verb-<n1>-\dots\Verb-<ni>- represent the desired positions (in multiples of 45\degres) around the \Verb-<atom>-. These whole numbers must be between 0 and 7.
This command can also be used inside the argument of \verb-\chemfig-:
\exemple{The \string\lewis\ macro}|\lewis{0246,A}\par\medskip
@@ -1197,23 +1229,36 @@ This can be seen more clearly by drawing an \verb-\fbox- around decorated atoms:
\item \CFkv{lewis sep}{dim} is the distance between the bounding box and the decoration. It is 0.2ex by default;
\item \CFkv{lewis length}{dim} is the length of the line segment representing a pair of electrons. It is 1.5ex by default;
\item \CFkv{lewis style}{code tikz} is code which is passed directly to \TIKZ. This code is empty by default.
- \item \CFkv{lewis dist}{dim}: is the distance between 2 discs drawn with "\string:. This distance is set to \CFval{0.3em} by default.
- \item \CFkv{lewis radius}{dim}: is the radius of the disc drawn with "." or "\string:". Its default value is \CFval{0.15ex}.
+ \item \CFkv{lewis dist}{dim}: is the distance between 2 discs drawn with "\string:. This distance is set to \CFval{0.3em} by default;
+ \item \CFkv{lewis radius}{dim}: is the radius of the disc drawn with "." or "\string:". Its default value is \CFval{0.15ex};
+ \item \CFkv{lewis diag coeff}{decimal}: is the diagonal spacing factor and its default value is \CFval{1}.
+\end{itemize}
+
+It should be noted that the parameters specific to Lewis decorations can be passed by
+\begin{itemize}
+ \item \Verb|\setchemfig{<keys>=<values>}| so that they last for the rest of the document;
+ \item \Verb|\chemfig[<keys>=<values>]| and in this case, the settings are effective in the current molecule;
+ \item \Verb|\lewis[<keys>=<values>]| so that the parameters are specific to this execution of the macro \verb|\lewis|.
\end{itemize}
+The last way, of course, allows individual settings, but must be used with caution when the macro \verb|\lewis| is in the argument of \verb|\chemfig|. Indeed, the signs \verb-=- of the \Verb|<key>=<values>| should not be interpreted as a double bond and to do so, the macro \verb|\lewis|, its optional and mandatory argument \emph{must} be inside braces:
+
+\exemple{Optional argument of \string\lewis}/\chemfig{{\lewis[lewis style=red]{1:3:5:7:,X}}-{\lewis[lewis style=blue]{0:2:4:6:,Y}}}/
+
+Here are some examples of customization:
+
\exemple{Parameters for the \string\lewis\ macro}*\setchemfig{lewis sep=4pt,lewis length=1.5em,lewis style=red}
\chemfig{A-\lewis{26,B}-C}\bigbreak
-\setchemfig{lewis style={line width=0.4pt}}
-\chemfig{A-\lewis{2|,B}-C}\bigbreak
+\chemfig[lewis style={line width=0.4pt}]{A-\lewis{2|,B}-C}\bigbreak
\Lewis{1:3:5:7:,X}\qquad\Lewis{0:2:4:6:,X}\bigbreak
-\setchemfig{lewis dist=0.2em}
-\Lewis{1:3:5:7:,X}\qquad\Lewis{0:2:4:6:,X}\bigbreak
+\Lewis[lewis dist=0.2em]{1:3:5:7:,X}\qquad
+\Lewis[lewis dist=0.2em]{0:2:4:6:,X}\bigbreak
-\setchemfig{lewis dist=4pt,lewis radius=1.5pt}
-\Lewis{1:3:5:7:,X}\qquad\Lewis{0:2:4:6:,X}*
+\Lewis[lewis dist=4pt,lewis radius=1.5pt]{1:3:5:7:,X}\qquad
+\Lewis[lewis dist=4pt,lewis radius=1.5pt]{0:2:4:6:,X}*
A problem sometimes occurs with the decorations of Lewis in the odd directions. In the example below with the atom ``O'', the decoration in position 1 seems farther from the atom than the decoration in position 4:
\exemple{Odd directions}/\huge
@@ -1225,20 +1270,22 @@ However, it is not the case as shown below by drawing the bounding box of the at
\Lewis{1|4|,O}/
\label{opt.lewis}The impression of greater distance is due to the shape of the letter ``O'' which is farther from the one of the bounding box in the corners, that is to say, in odd directions.
-To move nearer (or farther) the Lewis drawings in odd directions, the \verb-\lewis- and \verb-\Lewis- accept an optional argument that contains a factor which multiplies the gap between the bounding box and decoration Lewis set with the \falseverb{\setlewis} command. For the letter ``O'', it semms that 0.5 is the appropriated value:
+To move nearer (or farther) the Lewis drawings in odd directions, the \chevrons{clé} \CFkv{lewis diag coeff}{decimal} sets the factor which multiplies the gap between the bounding box and decoration Lewis. For the letter ``O'', it seems that 0.5 is the appropriated value:
\exemple*{Optional argument of \string\lewis}/\huge
-\Lewis{1|4|,O}\quad \Lewis[0.5]{1|4|,O}
+\Lewis{1|4|,O}\quad \Lewis[lewis diag coeff=0.5]{1|4|,O}
-\Lewis{0:3:,O}\quad \Lewis[2]{0:5:,O}\quad \Lewis[0]{0:5:,O}\quad \Lewis[0.5]{0:5:,O}/
+\Lewis{0:5:,O}\quad \Lewis[lewis diag coeff=2]{0:5:,O}\quad \Lewis[lewis diag coeff=0.5]{0:5:,O}/
\subsection{Stacking characters}
The macros\label{chemabove}
-\centerverb|\chemabove[<dim>]{<code>}{<stuff>}|
+\begin{center}
+ \Verb|\chemabove[<dim>]{<code>}{<stuff>}|
+\end{center}
and
-\centerverb|\chembelow[<dim>]{<code>}{<stuff>}|
-\smallskip
-
-place the \verb-<stuff>- above and below the \verb-<code>- respectively at a vertical distance \verb-<dim>-, without changing the \falseverb{bounding box} of \verb-<code>-. The optional argument allows, if written, to specify this dimension at each call. If the optional argument is not used, a default size will be taken: its value is \CFval{1.5pt} but it can be modified with the \chevrons{key} \CFkv{stack sep}{dim}.
+\begin{center}
+ \Verb|\chembelow[<dim>]{<code>}{<stuff>}|
+\end{center}
+place the \Verb-<stuff>- above and below the \Verb-<code>- respectively at a vertical distance \Verb-<dim>-, without changing the \falseverb{bounding box} of \Verb-<code>-. The optional argument allows, if written, to specify this dimension at each call. If the optional argument is not used, a default size will be taken: its value is \CFval{1.5pt} but it can be modified with the \chevrons{key} \CFkv{stack sep}{dim}.
These commands are independent of the macro \verb-\chemfig- and can be used either inside or outside its argument.
@@ -1248,7 +1295,7 @@ They are especially useful in rings, if care is taken to put braces around the l
They are sometimes useful for placing pseudo-exponents which do not change the bounding box of the atoms, so that the bonds do not end up being too short:
\exemple{Hydronium ion}*\chemfig{H-\chemabove{\lewis{5|7,O}}{\quad\scriptstyle+}(-[2]H)-H}*
-\label{Chemabove}The \falseverb{\Chemabove} and \falseverb{\Chembelow} commands work in the same way, except that the bounding box takes into account the \verb-<stuff>- placed above or below.
+\label{Chemabove}The \falseverb{\Chemabove} and \falseverb{\Chembelow} commands work in the same way, except that the bounding box takes into account the \Verb-<stuff>- placed above or below.
\section{Using {\protect\ttfamily\protect\textbackslash chemfig} in the {\protect\ttfamily tikzpicture} environment}
It is possible to call the \falseverb{\chemfig} inside a {\ttfamily\falseverb{tikzpicture}} environment:
@@ -1368,19 +1415,16 @@ Now we simply add the branches inside parentheses. The angles are chosen to give
\subsubsection{Haworth projection}
The goal is to depict this D-glucopyranose molecule:
-{\setchemfig{cram width=2pt}
-\chemfig{HO-[2,0.5,2]?<[7,0.7](-[2,0.5]OH)-[,,,,line width=2pt](-[6,0.5]OH)>[1,0.7](-[6,0.5]OH)-[3,0.7]O-[4]?(-[2,0.3]-[3,0.5]OH)}}
+\chemfig[cram width=2pt]{HO-[2,0.5,2]?<[7,0.7](-[2,0.5]OH)-[,,,,line width=2pt](-[6,0.5]OH)>[1,0.7](-[6,0.5]OH)-[3,0.7]O-[4]?(-[2,0.3]-[3,0.5]OH)}
First of all we will choose the longest chain, which starts at the ``HO'' group on the left and continues through fives sides of the ring. The ring will be closed with a hook. For the vertical bond which leaves from the first ``HO'' group, we need to specify that it will leave from the second atom using the optional argument. Furthermore, it will be shortened with a coefficient of 0.5. Its optional argument will thus be ``\verb/[2,0.5,2]/''.
Next, to give the impression of perspective to the ring, the diagonal bonds will be shortened by a coefficient of 0.7. For the bold diagonal lines we will use Cram bonds, having redefined the base of the triangles to be 2pt. The bold horizontal bond needs to be drawn with a thickness of 2pt, and so its optional argument will be ``\verb/[0,,,,line width=2pt]/''. Here is the skeleton of the molecule:
-\exemple{Structure}|\setchemfig{cram width=2pt}
-\chemfig{HO-[2,0.5,2]?<[7,0.7]-[,,,,
+\exemple{Structure}|\chemfig[cram width=2pt]{HO-[2,0.5,2]?<[7,0.7]-[,,,,
line width=2pt]>[1,0.7]-[3,0.7]O-[4]?}|
All that needs to be done now is to add the branches at the correct places, giving the right absolute angles and sometimes reducing the length to better give the illusion of perspective:
-\exemple{Haworth projection}|\setchemfig{cram width=2pt}
-\chemfig{HO-[2,0.5,2]?<[7,0.7](-[2,0.5]OH)-[,,,,
+\exemple{Projection de Haworth}|\chemfig[cram width=2pt]{HO-[2,0.5,2]?<[7,0.7](-[2,0.5]OH)-[,,,,
line width=2pt](-[6,0.5]OH)>[1,0.7](-[6,0.5]OH)-[3,0.7]
O-[4]?(-[2,0.3]-[3,0.5]OH)}|
@@ -1446,7 +1490,7 @@ Since the package \verb-xcolor- is loaded by \TIKZ, itself loaded by \CF, we can
\exemple{Colors}/\chemfig{C\color{blue}H_3-C(=[1]O)-[7]O\color{red}H}/
-This code does not work, because of the rule used to separate atoms: here, the first atom sarts at ``\verb-C-'' and spreads to the next uppercase letter. Therefore, this atom is ``\verb-C\color{blue}-'' and the color change occurs at the end of atom and has no effect. We need to force \CF to cut the first atom just after ``\verb-C-'' with the character ``\verb-|-'' and then include \verb-\color{blue}H_3- between braces so that \CF does not stop the atom 2 before the uppercase ``\verb-H-'' which would leave the color change alone and therefore ineffective in an atom:
+This code does not work, because of the rule used to separate atoms: here, the first atom starts at ``\verb-C-'' and spreads to the next uppercase letter. Therefore, this atom is ``\verb-C\color{blue}-'' and the color change occurs at the end of atom and has no effect. We need to force \CF to cut the first atom just after ``\verb-C-'' with the character ``\verb-|-'' and then include \verb-\color{blue}H_3- between braces so that \CF does not stop the atom 2 before the uppercase ``\verb-H-'' which would leave the color change alone and therefore ineffective in an atom:
\exemple{Colors}/\chemfig{C|{\color{blue}H_3}-C(=[1]O)-[7]O|{\color{red}H}}/
@@ -1493,9 +1537,10 @@ For more flexibility, you can also define nodes using the character ``\verb-@-''
++(20:2em) ..controls +(210:3em) and +(-120:4em) ..(b);}/
\subsection{Draw a ploymer element}\label{polymerdelim}
-The macro \verb|\polymerdelim|, until now undocumented and in the test phase, becomes officialy released in \CF with version 1.33. Its syntax is as follows:
-
-\centerverb|\polymerdelim[<keys>=<values>]{<node1>}<node2>}|
+The macro \verb|\polymerdelim|, until now undocumented and in the test phase, becomes officially released in \CF with version 1.33. Its syntax is as follows:
+\begin{center}
+ \Verb|\polymerdelim[<keys>=<values>]{<node1>}<node2>}|
+\end{center}
The effect, after possibly \emph{two} compilations, is to place vertical delimiters at the specified nodes. The parameters are specified via the \chevrons{keys} and \chevrons{values}, which are listed below, default values and actions.
\begin{center}
@@ -1506,7 +1551,7 @@ The effect, after possibly \emph{two} compilations, is to place vertical delimit
\CFdelimparam{depth} & Defines the depth (below the node) of the delimiters. If the \chevrons{value} is empty, then the depth is equal to the height.\\
\CFdelimparam{open xshift}& Defines the horizontal offset of the opening delimiter.\\
\CFdelimparam{close xshift}& Defines the horizontal offset of the closing delimiter. If the \chevrons{value} is empty, then this offset becomes opposite to the offset of the opening delimiter.\\
- \CFdelimparam{indice} & Defines the indice that will be placed at the right bottom of the closing delimiter.\\\hline
+ \CFdelimparam{indice} & Defines the indices that will be placed at the right bottom of the closing delimiter.\\\hline
\end{tabular}
\end{center}
\exemple*{Polymers}|Polyethylen:
@@ -1524,8 +1569,8 @@ Nylon 6:
\polymerdelim[height = 30pt, depth = 5pt, indice = {}]{op}{cl}
\bigskip
-Polycaprolactame:\setchemfig{atom sep = 2em}
-\chemfig{[:-30]-[@{left,.75}]N(-[6]H)-[:30](=[2]O)--[:30]--[:30]--[@{right,0.25}:30]}
+Polycaprolactame
+\chemfig[atom sep = 2em]{[:-30]-[@{left,.75}]N(-[6]H)-[:30](=[2]O)--[:30]--[:30]--[@{right,0.25}:30]}
\polymerdelim[height = 5pt, indice = \!\!n]{left}{right}
\bigskip
@@ -1591,32 +1636,32 @@ Water molecule rotated 30\textdegree: \chemfig{[:30]@1H-[::37.775,2]@2O-[::-75.5
\arclabel{0.5cm}{1}{2}{3}{\footnotesize104.45\textdegree}|
\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.
+In some very special cases, it is sometimes necessary to position Lewis diagrams to the nearest degree and no longer to multiples of 45 degrees.
-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.
+For this, it is relatively easy to write a macro \verb-\mylewis-, admitting an optional argument (the length of the doublet) which is 2ex and two mandatory arguments; the first being the name of the atom and the second being the list of angles separated by commas.
-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 :
+The trick is to create an invisible circular node that contains the atom and draw the dipoles at the desired angles so that they are tangent to this circle:
-\exemple*{Doublets au degrés prés}|\makeatletter
+\exemple*{Doublets au degrés prés}|\catcode`\_11
\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,}%
+ \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
+ \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
+ (\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
+\def\grab_angle#1,#2\_nil{\def\current_angle{#1}\def\list_angle{#2}}
+\catcode`\_8
Essai : \mylewis{Cl}{15}\qquad \mylewis[3ex]{Cl}{-60}\qquad \mylewis[1.5ex]{Cl}{60,120,240,300}
\bigskip
@@ -1624,25 +1669,25 @@ Essai : \mylewis{Cl}{15}\qquad \mylewis[3ex]{Cl}{-60}\qquad \mylewis[1.5ex]{Cl}{
(-[:144]Cl)(-[:-144]Cl)-\mylewis{Cl}{0,90,-90}}|
\subsection{Dessiner des liaisons multiples}
-Again, the ``decorations.markings'' librairy allows to draw multiple bonds:
+Again, the ``decorations.markings'' library allows to draw multiple bonds:
-\exemple*{Liaisons multiples}|\catcode`\@=11
+\exemple*{Liaisons multiples}|\catcode`_=11
\tikzset{nbond/.style args={#1}{%
draw=none,%
decoration={%
markings,%
mark=at position 0 with {\coordinate (CFstart@) at (0,0);},
mark=at position 1 with {%
- \foreach\CF@i in{0,1,...,\number\numexpr#1-1}{%
- \pgfmathsetmacro\CF@nbondcoeff{\CF@i-0.5*(#1-1)}%
- \draw ([yshift=\CF@nbondcoeff\CF@double@sep]CFstart@)--(0,\CF@nbondcoeff\CF@double@sep);
+ \foreach\CF_i in{0,1,...,\number\numexpr#1-1}{%
+ \pgfmathsetmacro\CF_nbondcoeff{\CF_i-0.5*(#1-1)}%
+ \draw ([yshift=\CF_nbondcoeff\CF_doublesep]CFstart@)--(0,\CF_nbondcoeff\CF_doublesep);
}%
}
},
postaction={decorate}
}
}
-\catcode`\@=12
+\catcode`\_=8
\chemfig{A-[1,,,,nbond=4]B-[:-30,,,,nbond=5]C-[6,,,,nbond=6]D}|
\part{Reaction schemes}\label{schemas}
@@ -1736,7 +1781,7 @@ In order to locally modify one or all of these default values, the \falseverb{\s
\schemestart[0,1,black] A\arrow B\arrow C\schemestop/
-Regarding style, the rule is: the style specified in the argument in brackets applies \emph{after} the default style, without overwrting it! This is why only the ``black'' color attribute is able to overwrite the `` blue'' default style.
+Regarding style, the rule is: the style specified in the argument in brackets applies \emph{after} the default style, without overwriting it! This is why only the ``black'' color attribute is able to overwrite the `` blue'' default style.
Finally, the \falseverb{\arrow} command accepts an optional argument in brackets in the form \verb-[angle,coeff,style]- to change the feature of that given arrow. As above, style applies \emph{after} the default style and \emph{after} the style possibly-specified in the optional argument of the \verb-\schemestart- command, again without overwrting them.
\exemple[50]{Arrows features}/\schemestart
@@ -1764,7 +1809,7 @@ Names are optional, and the argument can be either \verb/(n1--)/ and \verb/(--n2
A\arrow(aa--)B\arrow(bb--)C\arrow(cc--dd)D\arrow E
\schemestop/
Note that both methods are equivalent. Therefore, compounds can either be named by arrows preceding or following them. However, when a \falseverb{compound} is surrounded by two arrows specifying its name, the first name is ignored and a warning message is generated:
-\exemple[50]{Overful naming}/\setchemfig{scheme debug=true}
+\exemple[50]{Overfull naming}/\setchemfig{scheme debug=true}
\schemestart
A\arrow(--foo)B\arrow(bar--)C
\schemestop/
@@ -1857,7 +1902,7 @@ Like forn names, if specific styles are given to one compound by arrows arrivin
A\arrow(--foo[yshift=5mm])B
\schemestop/
-\label{setcompoundstyle}The macro \falseverb\setcompoundstyle\verb-{<code tikz>}- allows to globally define the style of compounds displayed thereafter. Entering an empty argument results in the absence of style, which corresponds to the default case.
+\label{setcompoundstyle}The macro \falseverb\setcompoundstyle\Verb-{<code tikz>}- allows to globally define the style of compounds displayed thereafter. Entering an empty argument results in the absence of style, which corresponds to the default case.
Here a style is defined with round corner-shaped boxes and semitransparent background:
\exemple[50]{Global styles}/\setchemfig{compound style={draw,line width=0.8pt,
@@ -1897,7 +1942,7 @@ One may wish to have ``Y'' and ``XX'' on the same horizontal line. To achieve th
\schemestop/
\section{Subscheme}\label{subscheme}
-A fraction of the reaction scheme can be defined within a single bounding box, so that \CF treats it as a \falseverb{compound}. The reaction scheme fraction is defined inside the compulsory argument between braces of the \falseverb{\subscheme} command so it is subsequently reagarded as a single entity. When \falseverb{\subscheme} is located after an arrow, the command labels this subscheme as a \falseverb{compound} named ``c<n+1>'':
+A fraction of the reaction scheme can be defined within a single bounding box, so that \CF treats it as a \falseverb{compound}. The reaction scheme fraction is defined inside the compulsory argument between braces of the \falseverb{\subscheme} command so it is subsequently regarded as a single entity. When \falseverb{\subscheme} is located after an arrow, the command labels this subscheme as a \falseverb{compound} named ``c<n+1>'':
\exemple[50]{Subscheme}/\setchemfig{scheme debug=true}
\schemestart
A\arrow
@@ -1913,15 +1958,17 @@ Although this is not clearly seen because of labels overlap, the box around the
\arrow
D
\schemestop/
-Note that since ``\falseverb\subscheme\verb-{<scheme>}-'' is only a convenient shortcut for
+Note that since ``\falseverb\subscheme\Verb-{<scheme>}-'' is only a convenient shortcut for
\begin{center}
-\falseverb\schemestart\verb-<scheme>-\falseverb\schemestop
+\falseverb\schemestart\Verb-<scheme>-\falseverb\schemestop
\end{center}
Consequently, it can be used with the same optional arguments as \falseverb\schemestart.
\label{chemleft}\CF provides the \falseverb{\chemleft} and \falseverb{\chemright} command pair. These allow to set expandable delimiters on either side of a material. The commands must be followed by delimiters, just like in the case of \TeX{} primitive commands \verb-\left- and \verb-\right-:
-\centerverb/\chemleft<car1><material>\chemright<car2>/
-where \verb-<car1>- and \verb-<car2>- can be ``('' et ``)'' or ``['' and ``]'', or any other expandable delimiter consistent with the \verb-\left- et \verb-\right- commands.
+\begin{center}
+ \Verb/\chemleft<car1><material>\chemright<car2>/
+\end{center}
+where \Verb-<car1>- and \Verb-<car2>- can be ``('' et ``)'' or ``['' and ``]'', or any other expandable delimiter consistent with the \verb-\left- et \verb-\right- commands.
\exemple{The \string\chemleft\ and \string\chemright macros}/\chemleft\lfloor\chemfig{A-[1]B}\chemright)
\chemleft\{\chemfig{A-[1,1.25]B-[6,1.25]C}\chemright|
@@ -1935,7 +1982,9 @@ The code of the reaction scheme discussed above including \falseverb{\chemleft}
D
\schemestop/
\label{chemup}By analogy, the macros \falseverb{\chemup} and \falseverb{\chemdown} can be used to draw expandable delimiters above and below the material, respectively:
-\centerverb/\chemup<car1><material>\chemdown<car2>/
+\begin{center}
+ \Verb/\chemup<car1><material>\chemdown<car2>/
+\end{center}
For example:
\exemple{The \string\chemup\ and \string\chemdown macros}/\schemestart[-90]
X\arrow
@@ -1985,7 +2034,7 @@ Subschemes should be used with care, undesired results are sometimes observed. I
\arrow(@c1--@c5){}
\arrow(@c1--@c4){}
\schemestop/
-The center of the subscheme is exactly located on the same vertical lign as the center of compound "A". This is because the two entities are connected by an invisible arrow with a $-90 $ angle. However, the arrow between the two pre-existing compounds ``A'' and ``tsoin'' is \emph{not} vertical because ``tsoin'' is not on the center of the subscheme since "tagada" is wider than "end". If this arrow is to be vertical within the use of the \falseverb{\subscheme} command, one must find a correct angle for the arrival anchor of the invisible arrow by try-and-error.
+The center of the subscheme is exactly located on the same vertical line as the center of compound "A". This is because the two entities are connected by an invisible arrow with a $-90 $ angle. However, the arrow between the two pre-existing compounds ``A'' and ``tsoin'' is \emph{not} vertical because ``tsoin'' is not on the center of the subscheme since "tagada" is wider than "end". If this arrow is to be vertical within the use of the \falseverb{\subscheme} command, one must find a correct angle for the arrival anchor of the invisible arrow by try-and-error.
A much simpler method is to use a branch instead of a subscheme: draw a \emph{visible} arrow between ``A'' and ``tsoin'', and then draw horizontal arrows on both sides of ``tsoin'', with a branch for the right-hand side arrows.
\exemple[50]{Subscheme}/\setchemfig{scheme debug=true}
@@ -2038,7 +2087,7 @@ A problem arises for vertical arrows:
\exemple[50]{Vertical arrows}/\schemestart
A\arrow{->[up][down]}[-90]B
\schemestop/
-For the sake of clarity, one may prefer to have the ``above'' and ``below'' labels written horizontally. Label angles can be specified, while default is the same angle as that of the arrow. To choose a specific angle, \verb-*{<angle>}- can be written at the beginning of the optional arguments:
+For the sake of clarity, one may prefer to have the ``above'' and ``below'' labels written horizontally. Label angles can be specified, while default is the same angle as that of the arrow. To choose a specific angle, \Verb-*{<angle>}- can be written at the beginning of the optional arguments:
\exemple[55]{Choice of angles}/\setchemfig{scheme debug=true}
\schemestart A\arrow{->[*{0}up][*{0}down]}[90]B\schemestop
\qquad
@@ -2052,7 +2101,7 @@ The default position of the label anchor can lead to undesired results:
\schemestart
A\arrow{->[*{0}on top of][*{0}underneath]}[45,2]B
\schemestop/
-To counter this, the anchoring position can be specified as well to override the one selected by \CF by default. The syntax for this is: \verb-*{<angle>.<ancre>}-.
+To counter this, the anchoring position can be specified as well to override the one selected by \CF by default. The syntax for this is: \Verb-*{<angle>.<ancre>}-.
\exemple[50]{Anchors}/\setchemfig{scheme debug=true}
\schemestart
A\arrow{->[*{0.0}on top of][*{0.180}underneath]}[45,2]B
@@ -2094,51 +2143,51 @@ This section is quite technical and requires some knowledge of \TIKZ. It is targ
The \falseverb{\definearrow} command allows to build custom arrows. Its syntax is:
-\hfill\verb-\definearrow{<number>}{<arrow name>}{<code>}-\hfill\null
+\hfill\Verb-\definearrow{<number>}{<arrow name>}{<code>}-\hfill\null
-where \verb-<number>- is the number of optional arguments that will be used in the \verb-<code>-, with the usual syntax \verb-#1-, \verb-#2-, etc. These optional arguments cannot accept default values; if no value is specified upon using the macro \verb-\arrow-, the arguments will remain empty.
+where \Verb-<number>- is the number of optional arguments that will be used in the \Verb-<code>-, with the usual syntax \verb-#1-, \verb-#2-, etc. These optional arguments cannot accept default values; if no value is specified upon using the macro \verb-\arrow-, the arguments will remain empty.
-Before going further, let's examine the available internal macros when drawing arrows. Since these macros include the \verb-@- character in their name, they can only be accessed through the \falseverb{\makeatletter} and \falseverb{\makeatother} commands.
+Before going further, let's examine the available internal macros when drawing arrows. Since these macros include the "\verb-@-" character in their name, they can only be accessed between \verb|\catcode`\_=11| and \verb|\catcode`\_=8| commands.
\begin{itemize}
- \item \falseverb{\CF@arrow@start@name} and \falseverb{\CF@arrow@end@name} include the names of the compounds (considered as nodes by \TIKZ) between which the arrow is drawn;
- \item \falseverb{\CF@arrow@start@node} and \falseverb{\CF@arrow@end@node} include the node names where arrow ends will be located. After these names, user-defined anchors can be specified in the argument between brackets of the \falseverb\arrow command, unless the field is left empty;
- \item \falseverb{\CF@arrow@current@style} and \falseverb{\CF@arrow@current@angle} contain the style and the angle of the arrow to be drawn;
- \item \falseverb{\CF@arrow@shift@nodes}\verb-{<dim>}- shifts the nodes ``\falseverb{\CF@arrow@start@node}'' and ``\falseverb{\CF@arrow@end@node}'' perpendicularly relative to the arrow by a dimension specified in the argument;
- \item \falseverb{\CF@arrow@display@label}\verb/{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}/ is the most complex one. It gives the labels position with the following arguments:
+ \item \falseverb{\CF_arrowstartname} and \falseverb{\CF_arrowendname} include the names of the compounds (considered as nodes by \TIKZ) between which the arrow is drawn;
+ \item \falseverb{\CF_arrowstartnode} and \falseverb{\CF_arrowendnode} include the node names where arrow ends will be located. After these names, user-defined anchors can be specified in the argument between brackets of the \falseverb\arrow command, unless the field is left empty;
+ \item \falseverb{\CF_arrowcurrentstyle} and \falseverb{\CF_arrowcurrentangle} contain the style and the angle of the arrow to be drawn;
+ \item \falseverb{\CF_arrowshiftnodes}\Verb-{<dim>}- shifts the nodes ``\falseverb{\CF_arrowstartnode}'' and ``\falseverb{\CF_arrowendnode}'' perpendicularly relative to the arrow by a dimension specified in the argument;
+ \item \falseverb{\CF_arrowdisplaylabel}\verb/{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}/ is the most complex one. It gives the labels position with the following arguments:
\begin{itemize}
\item \verb-#1- and \verb-#5- are the labels to be written;
\item \verb-#2- and \verb-#6- are real numbers between 0 and 1. They specify the location of the labels on the arrow. 0 is the beginning of the arrow and 1 is its end, assuming a \emph{straight} arrow;
\item \verb-#3- and \verb-#7- are the ``+'' or ``-'' characters. ``+'' displays the label above the arrow, while ``-'' does it below it;
\item \verb-#4- and \verb-#8- are the names of the nodes corresponding to the beginning and the end of the arrow.
\end{itemize}
- \item arrow heads are absed on ``\verb-CF-'' for a full arrow and have the ``harpoon'' option for half arrows.
+ \item arrow heads are based on ``\verb-CF-'' for a full arrow and have the ``harpoon'' option for half arrows.
\end{itemize}
\subsection{First arrow}
As an example, assume we want to make an arrow with a circle on its center. Let's call it ``\verb/-.>/''. This arrow will accept four optional arguments. Like for previously-defined arrows, the first and second arguments will be the labels to be located above and below the arrow. The third one will define the perpendicular shift relative to the arrow direction. Finally, the 4th argument will define the circle size. If this last argument is absent the default circle size will be equal to 2pt.
-Let's start with \verb/\definearrow{4}{-.>}/ to declare that the arrow will have 4 optional arguments and that it will be called \verb/-.>/. First, the position of the nodes between which the arrow is to be drawn must be modified in order to take the third-argument shift into account. This is made with the macro \falseverb{\CF@arrow@shift@nodes}, so the code of the arrow will start with: \falseverb{\CF@arrow@shift@nodes}\verb-{#3}%-. Then, one must plot the arrow itself, while taking the opportunity to set a node on the center of the segment, which will be called "\verb-mid@point-". Finally, the circle is defined with its center on that node. The whole \TIKZ code is:
+Let's start with \verb/\definearrow{4}{-.>}/ to declare that the arrow will have 4 optional arguments and that it will be called \verb/-.>/. First, the position of the nodes between which the arrow is to be drawn must be modified in order to take the third-argument shift into account. This is made with the macro \falseverb{\CF_arrowshiftnodes}, so the code of the arrow will start with: \falseverb{\CF_arrowshiftnodes}\verb-{#3}%-. Then, one must plot the arrow itself, while taking the opportunity to set a node on the center of the segment, which will be called "\verb-mid@point-". Finally, the circle is defined with its center on that node. The whole \TIKZ code is:
-{\hskip2em\verb-\edef\pt@radius{\ifx\@empty#4\@empty 2pt\else #4\fi}% circle radius-\par\parskip0pt
-\hskip2em\verb/\expandafter\draw\expandafter[\CF@arrow@current@style,-CF]/\par
-\hskip4em\verb/(\CF@arrow@start@node)--(\CF@arrow@end@node)coordinate[midway](mid@point);/\par
-\hskip2em\verb-\filldraw(mid@point)circle(\pt@radius);%-}
+{\hskip2em\verb-\edef\pt_radius{\ifx\empty#4\empty 2pt\else #4\fi}% circle radius-\par\parskip0pt
+\hskip2em\verb/\expandafter\draw\expandafter[\CF_arrowcurrentstyle,-CF]/\par
+\hskip4em\verb/(\CF_arrowstartnode)--(\CF_arrowendnode)coordinate[midway](mid@point);/\par
+\hskip2em\verb-\filldraw(mid@point)circle(\pt_radius);%-}
The last step is to enter the labels, if any, with the folwing line:
-\hskip2em\verb/\CF@arrow@display@label{#1}{0.5}{+}{\CF@arrow@start@node}{#2}{0.5}{-}{\CF@arrow@end@node}/
+\hskip2em\verb/\CF_arrowdisplaylabel{#1}{0.5}{+}{\CF_arrowstartnode}{#2}{0.5}{-}{\CF_arrowendnode}/
Here is the completed arrow:
-\exemple*{Arrow ``-.>''}/\makeatletter
+\exemple*{Arrow ``-.>''}/\catcode`\_11
\definearrow4{-.>}{%
- \edef\pt@radius{\ifx\@empty#4\@empty 2pt\else #4\fi}% dot radius
- \CF@arrow@shift@nodes{#3}%
- \expandafter\draw\expandafter[\CF@arrow@current@style,-CF](\CF@arrow@start@node)--(\CF@arrow@end@node)
+ \edef\pt_radius{\ifx\empty#4\empty 2pt\else #4\fi}% dot radius
+ \CF_arrowshiftnodes{#3}%
+ \expandafter\draw\expandafter[\CF_arrowcurrentstyle,-CF](\CF_arrowstartnode)--(\CF_arrowendnode)
coordinate[midway](mid@point);
- \filldraw(mid@point)circle(\pt@radius);%
- \CF@arrow@display@label{#1}{0.5}{+}{\CF@arrow@start@node}{#2}{0.5}{-}{\CF@arrow@end@node}
+ \filldraw(mid@point)circle(\pt_radius);%
+ \CF_arrowdisplaylabel{#1}{0.5}{+}{\CF_arrowstartnode}{#2}{0.5}{-}{\CF_arrowendnode}
}
-\makeatother
+\catcode`\_8
\schemestart
A \arrow{-.>} B \arrow{-.>[above][below][][1pt]} C \arrow{-.>[][below]}[30] D \arrow{-.>[above][][5pt][1.5pt]} E
\schemestop/
@@ -2146,27 +2195,29 @@ A \arrow{-.>} B \arrow{-.>[above][below][][1pt]} C \arrow{-.>[][below]}[30] D \a
\subsection{Curved arrow}
How about a curved arrow? To make things as simple as possible, assume it will have one single optional argument with the \TIKZ code that will specify the point(s) of control. If this argument is empty, a ``\verb/-CF/'' type arrow will be plotted.
-If \verb-#1- is not empty, attention should not be drawn to ``\falseverb{\CF@arrow@start@node}'' and ``\falseverb{\CF@arrow@end@node}'' which contain the node names of arrow ends positions, because the location of these nodes is already determined by the anchors calculated for \emph{straight} arrows! Instead we will use \falseverb{\CF@arrow@start@name} and \falseverb{\CF@arrow@end@name} which contain the names of the compound (which are nodes for \TIKZ), since the arrow must be plotted between them. Here's the \TIKZ code to draw the curved arrow between the two compounds:
+If \verb-#1- is not empty, attention should not be drawn to ``\falseverb{\CF_arrowstartnode}'' and ``\falseverb{\CF_arrowendnode}'' which contain the node names of arrow ends positions, because the location of these nodes is already determined by the anchors calculated for \emph{straight} arrows! Instead we will use \falseverb{\CF_arrowstartname} and \falseverb{\CF_arrowendname} which contain the names of the compound (which are nodes for \TIKZ), since the arrow must be plotted between them. Here's the \TIKZ code to draw the curved arrow between the two compounds:
-{\verb/\draw[shorten <=\CF@arrow@offset,shorten >=\CF@arrow@offset,\CF@arrow@current@style,-CF,/\par\parskip0pt
-\verb/(\CF@arrow@start@name).. controls #1 ..(\CF@arrow@end@name);%/}
+{\verb/\draw[shorten <=\CF_arrowoffset,shorten >=\CF_arrowoffset,\CF_arrowcurrentstyle,-CF,/\par\parskip0pt
+\verb/(\CF_arrowstartname).. controls #1 ..(\CF_arrowendname);%/}
-One must add a \TIKZ code to shorten the arrowby an amount \falseverb{\CF@arrow@offset} defined by \falseverb{\setarrowoffset}. Indeed, the nodes ar not the same as those for straight arrows (\falseverb{\CF@arrow@start@node} and \falseverb{\CF@arrow@end@node}). So before \falseverb{\CF@arrow@current@style}, the follwing code must be added:
-\centerverb/shorten <=\CF@arrow@offset, shorten >=\CF@arrow@offset/
+One must add a \TIKZ code to shorten the arrow by an amount \falseverb{\CF_arrowoffset} defined by \falseverb{\setarrowoffset}. Indeed, the nodes ar not the same as those for straight arrows (\falseverb{\CF_arrowstartnode} and \falseverb{\CF_arrowendnode}). So before \falseverb{\CF_arrowcurrentstyle}, the following code must be added:
+\begin{center}
+ \verb/shorten <=\CF_arrowoffset, shorten >=\CF_arrowoffset/
+\end{center}
this is the role the two lines after \verb-\else-.
So here is our curved arrow:
-\exemple*{Curved arrow}/\makeatletter
+\exemple*{Curved arrow}/\catcode`\_11
\definearrow1{s>}{%
-\ifx\@empty#1\@empty
- \expandafter\draw\expandafter[\CF@arrow@current@style,-CF](\CF@arrow@start@node)--(\CF@arrow@end@node);%
+\ifx\empty#1\empty
+ \expandafter\draw\expandafter[\CF_arrowcurrentstyle,-CF](\CF_arrowstartnode)--(\CF_arrowendnode);%
\else
- \def\curvedarrow@style{shorten <=\CF@arrow@offset,shorten >=\CF@arrow@offset,}%
- \CF@expadd@tocs\curvedarrow@style\CF@arrow@current@style
- \expandafter\draw\expandafter[\curvedarrow@style,-CF](\CF@arrow@start@name)..controls#1..(\CF@arrow@end@name);
+ \def\curvedarrow_style{shorten <=\CF_arrowoffset,shorten >=\CF_arrowoffset,}%
+ \CF_eaddtomacro\curvedarrow_style\CF_arrowcurrentstyle
+ \expandafter\draw\expandafter[\curvedarrow_style,-CF](\CF_arrowstartname)..controls#1..(\CF_arrowendname);
\fi
}
-\makeatother
+\catcode`\_8
\schemestart
A\arrow{s>}
B\arrow{s>[+(0.5cm,0.5cm)]}
@@ -2194,7 +2245,7 @@ The syntax follows with:
\hfill\verb/\merge{dir}(n1.a1)(n2.a2)(...)(ni.ai)--(n.a[s])/\hfill\null
-where the ``\verb-ni-'' names before the double dash are those already-defined compounds from which outcoming arrows will merge into a single one. One can also specify the ``\verb-ai-'' anchor, when the default one is not convenient. Like for the \falseverb\arrow command, the command ``\verb-n.a[s]-'' includes the name, the anchor and the style of the target compound.
+where the ``\verb-ni-'' names before the double dash are those already-defined compounds from which out coming arrows will merge into a single one. One can also specify the ``\verb-ai-'' anchor, when the default one is not convenient. Like for the \falseverb\arrow command, the command ``\verb-n.a[s]-'' includes the name, the anchor and the style of the target compound.
\exemple[50]{The \string\merge command}/\schemestart
ABC\arrow[30]EFGHIJ\arrow[45]KLM\arrow[60]NO
@@ -2244,7 +2295,7 @@ Finally, it is possible to write labels above or below the merged arrow. For thi
\hfill\verb/\merge{dir}[labelup][labeldow](n1.a1)(n2.a2)(...)(ni.ai)--(n.a[s])[c1,c2,c,style]/\hfill\null
-All the features introduced before for arrow labelling can be implemented here as well, i.e. rotation angle and anchoring with the syntax \verb-*{angle.anchor}- entered just before the content of the label.
+All the features introduced before for arrow labeling can be implemented here as well, i.e. rotation angle and anchoring with the syntax \verb-*{angle.anchor}- entered just before the content of the label.
\exemple*{Labels of the \string\merge command}/\schemestart
ABC\arrow{<=>}[90]DEF\merge>[above][below](c1)(c2)--()[0.25,1,0.75]GHIJ
@@ -2268,10 +2319,10 @@ ABC\arrow{<=>}DEF\merge v[*{0}above][*{0}below](c1)(c2)--()[0.25,1,0.75]GHIJ
\schemestop/
\section{The + sign}\label{signe+}
-The use of a ``\falseverb\+'' macro that displays a ${}+{}$ sign is available between the commands \falseverb{\schemestart} and \falseverb{\schemestop}. This macro accepts an optional argument in braces with 3 dimensions in the form \verb-{<dim1>,<dim2>,<dim3>}-, where:
+The use of a ``\falseverb\+'' macro that displays a ${}+{}$ sign is available between the commands \falseverb{\schemestart} and \falseverb{\schemestop}. This macro accepts an optional argument in braces with 3 dimensions in the form \Verb-{<dim1>,<dim2>,<dim3>}-, where:
\begin{itemize}
- \item \verb-<dim1>- and \verb-<dim2>- are the dimensions to be inserted before and after the ${}+{}$ sign;
- \item \verb-<dim3>- is the vertical offset of the sign.
+ \item \Verb-<dim1>- and \Verb-<dim2>- are the dimensions to be inserted before and after the ${}+{}$ sign;
+ \item \Verb-<dim3>- is the vertical offset of the sign.
\end{itemize}
These dimensions can also be set, for all the following ${}+{}$ signs with the \chevrons{keys} \CFkv{+ sep left}{dim}, \CFkv{+ sep right}{dim} et \CFkv{+ vshift}{dim}. The default values are 0.5em for the two first and 0pt for the third.
@@ -2336,9 +2387,8 @@ The commands created by \CF are:
\begin{center}
\begin{longtable}{>\footnotesize l>\footnotesize p{9cm}}\\\hline
\hfill\normalsize Commands\hfill\null &\hfill\normalsize Description\hfill\null\\\hline
-\falseverb\chemfig\verb-<code>-& draws the molecule whose design is described by the \verb-<code>-\\
-\falseverb\chemfig\verb-*<code>-&same as above but bonds have fixed lengths\\
-\verb|\setchemfig|& sets the parameters with the syntax \chevrons{key}${}={}$\chevrons{value}. Here is the full list of keys with the default values:
+\Verb-\chemfig[<settings>]{<code>}-& draws the molecule whose design is described by the \Verb-<code>-\\
+\Verb|\setchemfig{<settings>}|& sets the parameters with the syntax \chevrons{key}${}={}$\chevrons{value}. Here is the full list of keys with the default values:
\begin{itemize}
\item \CFkv{chemfig style} {{}}: style given to \TIKZ
\item \CFkv{atom style} {{}}: style of \TIKZ nodes (atoms)
@@ -2360,6 +2410,7 @@ The commands created by \CF are:
\item \CFkv{lewis style} {{}}: style of Lewis decorations
\item \CFkv{lewis dist} {0.3em}: space between discs of the ":" Lewis decoration
\item \CFkv{lewis radius} {0.15ex}: radius of discs for Lewis decorations
+ \item \CFkv{lewis diag coeff} {1}: factor that multiplies the distance to Lewis decorations in odd directions
\item \CFkv{cycle radius coeff} {0.75}: shrinkage ratio of the circle or arc inside cycles
\item \CFkv{stack sep} {1.5pt}: vertical gap between arguments of \verb-\chemabove- and \verb-\chembelow- macros
\item \CFkv{compound style} {{}}: style of compounds
@@ -2368,9 +2419,9 @@ The commands created by \CF are:
\item \CFkv{arrow angle} {0}: angle of the reaction arrow
\item \CFkv{arrow coeff} {1}: length ratio of arrows
\item \CFkv{arrow style} {{}}: style of arrows
- \item \CFkv{arrow double sep} {2pt}: space between double arroxs
+ \item \CFkv{arrow double sep} {2pt}: space between double arrows
\item \CFkv{arrow double coeff} {0.6}: shrinkage ratio for the little arrow in "<->>" and "<<->"
- \item \CFkv{arrow double harpoon}{true}: booléen for double harpoon arrows
+ \item \CFkv{arrow double harpoon}{true}: boolean for double harpoon arrows
\item \CFkv{arrow label sep} {3pt}: space between arrow and its label
\item \CFkv{arrow head} {-CF}: style of arrow head
\item \CFkv{+ sep left} {0.5em}: space before the $+$ sign
@@ -2378,31 +2429,33 @@ The commands created by \CF are:
\item \CFkv{+ vshift} {0pt}: vertical shift of the $+$ sign
\end{itemize}
\\
+\verb|\resetchemfig|&Reset the parameters to their default values\\
\falseverb\printatom& displays the atoms within the molecules. It can be redefined to customize the output. See page~\pageref{perso.affichage}\\
\falseverb\hflipnext&the next molecule will be horizontally flipped\\
\falseverb\vflipnext&the next molecule will be vertically flipped\\
-\falseverb\definesubmol\verb-{<nom>}[code1]{<code2>}- & 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}\\
+\Verb-\definesubmol{<name>}<n>[<code1>]{<code2>}- & creates an alias \Verb-!<name>- 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}\\
\falseverb\chemskipalign& tells the vertical alignment mechanism to ignore the current group of atoms. See page~\pageref{chemskipalign}.\\
-\falseverb\redefinesubmol\verb-{<nom>}{<code>}- & replaces a preexisting alias \verb-!<name>- with the new \verb-<code>-. See page~\pageref{redefinesubmol}\\[2ex]\hline
+\Verb-\redefinesubmol{<name>}<n>[<code1>]{<code2>}- & replaces a preexisting alias \Verb-!<name>- with the new \Verb-<code>-. See page~\pageref{redefinesubmol}\\[2ex]\hline
&\\
-\falseverb\lewis\verb-[coeff]{<codes>,<atome>}-& displays the \verb-<atom>- and places Lewis dot decorations as specified in the \verb-<code>-. The dots drawn do not change the bounding box. See page~\pageref{lewis}\\
-\falseverb\Lewis\verb-[coeff]{<codes>,<atome>}-& displays the \verb-<atom>- and places Lewis dot decorations as specified in the \verb-<code>-. See page~\pageref{lewis}\\
-\falseverb\chemmove\verb-[<tikz options>]<tikz code>-& Makes a \verb-tikzpicture- environment, adding to it the \verb-<tikz options>-. Uses the \verb-<tikz code>- to join the nodes specified in the molecules with the help pf the ``\verb-@-'' character. See page~\pageref{mecanismes-reactionnels}.\\[2ex]\hline
+\Verb-\lewis[coeff]{<codes>,<atom>}-& displays the \Verb-<atom>- and places Lewis dot decorations as specified in the \Verb-<code>-. The dots drawn do not change the bounding box. See page~\pageref{lewis}\\
+\Verb-\Lewis[coeff]{<codes>,<atom>}-& displays the \Verb-<atom>- and places Lewis dot decorations as specified in the \Verb-<code>-. See page~\pageref{lewis}\\
+\Verb-\chemmove[<tikz options>]<tikz code>-& Makes a \verb-tikzpicture- environment, adding to it the \verb-<tikz options>-. Uses the \Verb-<tikz code>- to join the nodes specified in the molecules with the help pf the ``\verb-@-'' character. See page~\pageref{mecanismes-reactionnels}.\\[2ex]\hline
&\\
-\falseverb\chemabove\verb-[<dim>]{<txt1>}{txt2}- & writes \verb-<txt1>- and places \verb-<txt2>- above, leaving \verb-<dim>- of vertical space. This command does not change the bounding box of \verb-<txt1>-. See page~\pageref{chemabove}\\
-\falseverb\chembelow\verb-[<dim>]{<txt1>}{txt2}- & writes \verb-{txt1}- and places \verb-<txt2>- below, leaving \verb-<dim>- of vertical space. This command does not change the bounding box of \verb-<txt1>-. See page~\pageref{chemabove}\\
-\falseverb\Chemabove\verb-[<dim>]{<txt1>}{txt2}- & writes \verb-<txt1>- and places \verb-<txt2>- above, leaving \verb-<dim>- of vertical space. See page~\pageref{chemabove}\\
-\falseverb\Chembelow\verb-[<dim>]{<txt1>}{txt2}- & writes \verb-{txt1}- and places \verb-<txt2>- below, leaving \verb-<dim>- of vertical space. See page~\pageref{chemabove}\\
-\falseverb\chemname\verb-[<dim>]{<molecule>}{<name>}- & Places \verb-<name>- under the \verb-<molecule>-\\
+\Verb-\chemabove[<dim>]{<txt1>}{txt2}- & writes \Verb-<txt1>- and places \Verb-<txt2>- above, leaving \Verb-<dim>- of vertical space. This command does not change the bounding box of \Verb-<txt1>-. See page~\pageref{chemabove}\\
+\Verb-\chembelow[<dim>]{<txt1>}{txt2}- & writes \Verb-{txt1}- and places \Verb-<txt2>- below, leaving \Verb-<dim>- of vertical space. This command does not change the bounding box of \Verb-<txt1>-. See page~\pageref{chemabove}\\
+\Verb-\Chemabove[<dim>]{<txt1>}{txt2}- & writes \Verb-<txt1>- and places \Verb-<txt2>- above, leaving \Verb-<dim>- of vertical space. See page~\pageref{chemabove}\\
+\Verb-\Chembelow[<dim>]{<txt1>}{txt2}- & writes \Verb-{txt1}- and places \Verb-<txt2>- below, leaving \Verb-<dim>- of vertical space. See page~\pageref{chemabove}\\
+\Verb-\chemname[<dim>]{<molecule>}{<name>}- & Places \Verb-<name>- under the \Verb-<molecule>-\\
\falseverb\chemnameinit & Initializes the greatest molecule depth to ensure correct alignment of the names of the following molecules.\\[2ex]\hline
&\\
\falseverb\schemestart\dots\falseverb\schemestop& commands between which a reaction scheme is drawn. See page~\pageref{schemestart}.\\
\falseverb\arrow& draws an arrow in a reaction scheme (this command is only defined inside a reaction scheme). See page~\pageref{arrow}.\\
\falseverb\+ & prints a $+$ sign in a reaction scheme (this command is only defined inside a reaction scheme). See page~\pageref{signe+}.\\
-\falseverb\subscheme\verb-{<code>}- & draws a subscheme (this command is only defined inside a reaction scheme). Voir~\pageref{subscheme}.\\
+\falseverb\subscheme\Verb-{<code>}- & draws a subscheme (this command is only defined inside a reaction scheme). See~\pageref{subscheme}.\\
\falseverb\definearrow & defines an arrow. See page~\pageref{definearrow}.\\
-\falseverb\chemleft\verb-<car1><stuff>-\falseverb\chemright\verb-<car1>-& draws expandable delimiters defined with \verb-<car1>- and \verb-<car2>- on the left and on the right of the \verb-<stuffl>-, see page~\pageref{chemleft}.\\
-\falseverb\chemup\verb-<car1><matériel>-\falseverb\chemdown\verb-<car1>-& draws expandable delimiters defined with \verb-<car1>- and \verb-<car2>- above and below the \verb-<stuff>-, voir page~\pageref{chemup}.\\\hline
+\Verb-\chemleft<car1><stuff>-\falseverb\chemright\Verb-<car1>-& draws expandable delimiters defined with \Verb-<car1>- and \Verb-<car2>- on the left and on the right of the \Verb-<stuff>-, see page~\pageref{chemleft}.\\
+\Verb-\chemup<car1><stuff>-\falseverb\chemdown\Verb-<car1>-& draws expandable delimiters defined with \Verb-<car1>- and \Verb-<car2>- above and below the \Verb-<stuff>-, see page~\pageref{chemup}.\\
+\Verb|\polymerdelim[<settings]{<node1>}{node2>}|& draws delimiters at specified nodes, see page~\pageref{polymerdelim}\\\hline
\end{longtable}
\end{center}
\newpage
@@ -2410,7 +2463,7 @@ The commands created by \CF are:
\part{Gallery}
This manual concludes with drawings of molecules of varying complexity.
-The curious user can look at the \verb-<code>- of each molecule, though it does become less attractive the more complex the molecule gets. Indeed, beyond a certain level of complexity, though it it is fairly easy to write \verb-<code>-, it becomes much harder to read the \verb-<code>- to analyze it afterwards. We quickly reached the limits of immediate readability of the code of a complex drawing.
+The curious user can look at the \Verb-<code>- of each molecule, though it does become less attractive the more complex the molecule gets. Indeed, beyond a certain level of complexity, though it it is fairly easy to write \Verb-<code>-, it becomes much harder to read the \Verb-<code>- to analyze it afterwards. We quickly reached the limits of immediate readability of the code of a complex drawing.
Anyway, I hope that this package will help all \LaTeX{} users wishing to draw molecules. Although \CF has been thoroughly tested and although its version number is now greater than 1.0, I hope that you will be forgiving with bugs you encounter and send me an \href{mailto:unbonpetit@netc.fr}{\texttt{\textbf{email}}} to let me know of any malfunctions or suggestions for improvement.
@@ -2769,27 +2822,6 @@ $\star\quad\star$
\chemnameinit{}/
\endgroup
-\exemple*{Crystallography}/\newcommand\disk{\tikz\draw[fill=black,overlay](0,0)circle(2pt);}
-\setchemfig{atom sep=20pt,bond offset=2pt}
-\renewcommand\printatom[1]{#1}
-\definesubmol{hat}{-[:40,1.5]\disk-[::-30,2]\disk-[::-30,2]\disk-[::-120,2]\disk-[::-30,2]\disk}
-\definesubmol{motif}{-[:40,1.5]\disk(-[2,3])-[::-30,2]\disk
-(-[2,3])-[::-30,2]\disk(-[2,3])-[::-120,2]\disk(-[2,3])-[::-30,2]\disk}
-\chemfig{\disk?[a](-[2,3]\disk?[b](-[2,3]\disk?[c]!{hat}?[c])!{motif}?[b](-[2,3]))!{motif}?[a](-[2,3])}
-\qquad
-\redefinesubmol{motif}{\disk(-[2,3])(-[:42,3.6,,,draw=none]\disk)-[:30,2.6]\disk
-(-[2,3])-[0,3]\disk(-[2,3])-[:-150,2.6]\disk(-[4,3])-[2,3]-[4,3]}
-\redefinesubmol{hat}{\disk-[:30,2.6]\disk-[0,3]\disk-[:-150,2.6]\disk-[4,3]}
-\chemfig{!{motif}!{motif}!{hat}}
-\qquad
-\redefinesubmol{motif}{(-[2,3])(-[:25,2.75,,,white]-[2,1.5,,,white]\disk)-[:50,3]\disk
-(-[2,3])-[::-50,3]\disk(-[2,3])-[::-130,3]\disk-[2,3]-[4,3]\disk}
-\redefinesubmol{hat}{-[:50,3]\disk-[::-50,3]\disk-[::-130,3]\disk}
-\chemfig{-[4,3]\disk!{motif}(-[:25,2.75,,,draw=none]\disk?[uat]?[dat](-[::0,2.75]?[uat1]?[dat1]
--[::-90,1.3]\disk?[uat2]?[dat2])-[::-90,1.3]-[:25,2.75])!{hat}?[uat3]?[dat3]-[:50,1.5]
-(-[6,1.5,,,draw=none]\disk?[dat,,,blue]?[dat1,,,blue]?[dat2,,,blue]?[dat3,,,blue])
--[2,1.5,,,draw=none]\disk?[uat,,,red]?[uat1,,,red]?[uat2,,,red]?[uat3,,,red]}/
-
\exemple*{Taxotere}/\chemfig{-[::-30](-[5])(-[7])-[::+60]-[::-60]O-[::+60](=[::-45]O)-[::+90]HN>:[::-60](-[::+60]**6(------))
-[::-30](<:[2]OH)-[::-60](=[6]O)-[::+60]O>:[::-60]*7(---?(<[::-120]OH)-(<|[1]CH_3)(<:[::-90]CH_3)
-(-[1](<[::+80]HO)-[0](=[::+60]O)-[7](<|[::+130]CH_3)(-[::+75](<|[2]OH)-[::-60]-[::-60](<[::+30]O-[::-90])