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.tex85
1 files changed, 51 insertions, 34 deletions
diff --git a/Master/texmf-dist/doc/generic/chemfig/chemfig-en.tex b/Master/texmf-dist/doc/generic/chemfig/chemfig-en.tex
index 7c4ef73e9ea..7018d775488 100644
--- a/Master/texmf-dist/doc/generic/chemfig/chemfig-en.tex
+++ b/Master/texmf-dist/doc/generic/chemfig/chemfig-en.tex
@@ -143,6 +143,7 @@
\newcommand*\CFval[1]{{\color{teal}\textlangle\textit{#1}\textrangle}}
\newcommand*\CFkv[2]{\CFkey{#1}{\color{teal}${}={}$}\CFval{#2}}
\newcommand*\CFparam[1]{\CFkey{#1}&\ifcat\relax\detokenize\expandafter\expandafter\expandafter{\useKV[chemfig]{#1}}\relax \textlangle\textit{empty}\textrangle\else\texttt{\detokenize\expandafter\expandafter\expandafter{\useKV[chemfig]{#1}}}\fi\\}
+\newcommand*\CFdelimparam[1]{\CFkey{#1}&\ifcat\relax\detokenize\expandafter\expandafter\expandafter{\useKV[CFdelimiters]{#1}}\relax \textlangle\textit{vide}\textrangle\else\texttt{\detokenize\expandafter\expandafter\expandafter{\useKV[CFdelimiters]{#1}}}\fi}
\usepackage[plainpages=false,pdfpagelabels,bookmarks=true,bookmarksopen=true,colorlinks=true,hyperfootnotes=false,filecolor=black,linkcolor=blue,urlcolor=magenta,pdfauthor={Christian TELLECHEA},pdftitle={ChemFig},pdfsubject={Draw 2D molecule with LaTeX},pdfkeywords={ChemFig},pdfcreator={LaTeX}]{hyperref}
@@ -213,8 +214,15 @@
\setitemize{leftmargin=3em,topsep=0pt,parsep=0pt,itemsep=0pt}
\part{Introduction}
\section{New in v1.3}
-\subsection{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.
+\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}.
+
+\paragraph{Polymer delilmiters}
+The macro \verb|\polymerdelim| allows to draw delimiters on molecules drawn by \CF, see page~\pageref{polymerdelim}.
+
+\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.
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}
@@ -228,7 +236,7 @@ Most of the settings are now specified \emph{via} the macro \verb|\setchemfig| w
Running them sends a warning message about their obsolescence in the log file.
-\subsection{The syntax of the \texttt{\textbackslash chemfig} macro}
+\paragraph{The syntax of the \texttt{\textbackslash chemfig} macro}
\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.
@@ -243,7 +251,7 @@ The aim is that in the long run, the macro \verb-\chemfig- accepts only \emph{a
The two optional arguments that the macro \verb-\chemfig- accepts will be removed in a future version.
\end{center}
-\subsection{Keys and their default value}
+\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
@@ -1142,6 +1150,18 @@ We will define a control sequence \verb-\Me- pour ``methyl'' so that the alias `
\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>}/
+
+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}
+\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})}/
+
\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:
@@ -1472,56 +1492,53 @@ For more flexibility, you can also define nodes using the character ``\verb-@-''
\chemmove{\draw[-](a)..controls +(60:3em) and +(30:1em)..
++(20:2em) ..controls +(210:3em) and +(-120:4em) ..(b);}/
-\subsection{Draw a ploymer element}
-The difficulty lies in the display of delimiters (parentheses or brackets) on bond. For this, we will again use the character ``\verb-@-'' to define global nodes that will be used later as anchors for delimiters.
-
-We will write a simple macro \verb-\setpolymerbracket-, followed by two characters which define the opening delimiter and closing delimiter.
-
-Then, the macro \verb-\makebraces- has an argument of the form ``\verb-[<dim up>,<dim down>]-''. These two dimensions are the height and depth of the delimiters from the baseline. The following arguments are the subscript located at the right bottom of the closing delimiter and the names of the 2 nodes at which the opening and closing delimiters will be drawn.
-
-\exemple*{Polymers}|\newcommand\setpolymerdelim[2]{\def\delimleft{#1}\def\delimright{#2}}
-\def\makebraces[#1,#2]#3#4#5{%
- \edef\delimhalfdim{\the\dimexpr(#1+#2)/2}%
- \edef\delimvshift{\the\dimexpr(#1-#2)/2}%
- \chemmove{%
- \node[at=(#4),yshift=(\delimvshift)]
- {$\left\delimleft\vrule height\delimhalfdim depth\delimhalfdim
- width0pt\right.$};%
- \node[at=(#5),yshift=(\delimvshift)]
- {$\left.\vrule height\delimhalfdim depth\delimhalfdim
- width0pt\right\delimright_{\rlap{$\scriptstyle#3$}}$};}}
-\setpolymerdelim()
-Polyéthylène:
+\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 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}
+\begin{tabular}{rlp{8cm}}\hline
+ \chevrons{keys} & default \chevrons{values} & Action\\\hline
+ \CFdelimparam{delimiters} & Defines the delimiters. If these delimiters are brackets, write \verb|delimiters={[]}|.\\
+ \CFdelimparam{height} & Defines the height (above the node) of the delimiters.\\
+ \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
+\end{tabular}
+\end{center}
+\exemple*{Polymers}|Polyethylen:
\chemfig{\vphantom{CH_2}-[@{op,.75}]CH_2-CH_2-[@{cl,0.25}]}
-\makebraces[5pt,5pt]{\!\!n}{op}{cl}
+\polymerdelim[height = 5pt, indice = \!\!n]{op}{cl}
\bigskip
Polyvinyl chloride:
-\chemfig{\vphantom{CH_2}-[@{op,.75}]CH_2-CH(-[6]Cl)-[@{cl,0.25}]}
-\makebraces[5pt,25pt]{\!\!\!n}{op}{cl}
+\chemfig{\vphantom{CH_2}-[@{op,1}]CH_2-CH(-[6]Cl)-[@{cl,0}]}
+\polymerdelim[height = 5pt, depth = 25pt, open xshift = -10pt, indice = \!\!n]{op}{cl}
\bigskip
Nylon 6:
\chemfig{\phantom{N}-[@{op,.75}]{N}(-[2]H)-C(=[2]O)-{(}CH_2{)_5}-[@{cl,0.25}]}
-\makebraces[30pt,5pt]{}{op}{cl}
+\polymerdelim[height = 30pt, depth = 5pt, indice = {}]{op}{cl}
\bigskip
-Polycaprolactame:\setchemfig{atom sep=2em}
+Polycaprolactame:\setchemfig{atom sep = 2em}
\chemfig{[:-30]-[@{left,.75}]N(-[6]H)-[:30](=[2]O)--[:30]--[:30]--[@{right,0.25}:30]}
-\makebraces[5pt,25pt]{\!\!\!n}{left}{right}
+\polymerdelim[height = 5pt, indice = \!\!n]{left}{right}
\bigskip
-\setpolymerdelim[]
Polyphénylène sulfide:
\chemfig{\vphantom{S}-[@{op,.75}]S-(**6(---(-[@{cl,0.25}])---))}
-\makebraces[15pt,15pt]{}{op}{cl}
+\polymerdelim[delimiters = (), height = 15pt, indice = {}]{op}{cl}
\bigskip
\chemfig{-CH_2-CH([6]-CO-NH-CH_2-NH-CO-CH([4]-CH_2-)([0]-[@{downleft,0.8},2]CH_2
-CH([2]-CO-NH_2)-[@{downright,0.3},2]CH_2-[,1.5]C?H-))-[@{upleft,0.8},2]CH_2
-CH([6]-CO-NH_2)-[@{upright,0.3},2]CH_2-[,1.5]CH([6]-CO-NH-CH_2-NH-C?O)-}
-\makebraces[5pt,40pt]{n}{upleft}{upright}
-\makebraces[38pt,7pt]{n}{downleft}{downright}|
+\polymerdelim[delimiters ={[]}, height = 5pt, depth = 40pt, indice = n]{upleft}{upright}
+\polymerdelim[delimiters ={[]}, height = 40pt, depth = 5pt, indice = n]{downleft}{downright}|
\subsection{Draw the symmetrical of a molecule}\label{retournement}
The two commands \falseverb{\hflipnext} and \falseverb{\vflipnext} allow to draw the symmetrical of the next molecule about a horizontal or vertical axis. If we want to draw more symmetrical molecules, we need to write these commands before each molecule involved.