-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfiguration-chimie.tex
37 lines (34 loc) · 1.01 KB
/
configuration-chimie.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
% Author: Julien Cubizolles
% Public domain
\RequirePackage{chemfig}
\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{#3}}
$};
}%
}
% À utiliser comme suit:
% \setpolymerdelim()
% \chemfig{
% CH_2=[:-30]CH-[:30]C(=[:90]O)-[:-30]O
% -[@{op,.75}]CH_2CH_2-[@{cl,.25}]
% O-[:30]C(=[:90]O)-[:-30]CH=[:30]CH_2
% }
% \makebraces(5pt,5pt){$\!\!n$}{op}{cl}
%\makebraces(<dim up>,<dim down>){<subscript>}{<opening node name>}{<closing node name>}
\RequirePackage{chemmacros,chemformula}
% \RequirePackage{ghsystem}
% \ghssetup{language=french}