2

I just started to work with chemfig. I was able to create my molecule with the following code.

\documentclass{article}
\usepackage{chemfig}
\begin{document} 
\setchemfig{atom sep=2em}
\schemestart
\chemfig{C(-[2]F)(-[4]F)(-[6]F)-C(-[2]F)(-[6]F)-C(-[2]F)(-[6]F)-C(-[2]F)(-[6]F)-C(-[2]F)(-[6]F)-C(-[2]F)(-[6]F)-C(-[2]F)(-[6]F)-C(-[2]F)(-[6]F)-[:0,1.5]S(=[2]O)(=[6]O)(-[8]OH)}
\schemestop
\end{document}

But now, I would love to "label" the different parts with curly braces and some text (as indicated below):

enter image description here

Is this somehow possible? In the documentation (page 54) I saw that curly braces in that way are possible but couldn't figure out how to implement it for my purposes.

(Since I am new to this, I hope all the necessary information for you to understand my problem is given, if not please tell me.)

1 Answer 1

4

Chemfig is based on TikZ and you can remember the nodes with the @{...} syntax. Note that on my 2017 TeXLive distribution \setchemfig{atom sep=2em} causes an error. Do you have a newer/different version?

enter image description here

\documentclass{article}
\usepackage{chemfig}
\usetikzlibrary{decorations.pathreplacing}
\tikzset{brace/.style = { decorate, decoration={brace, amplitude=5pt} },}
\begin{document} 
%\setchemfig{atom sep=2em} %<- caused an error
\setatomsep{2em}
\schemestart
\chemfig{C(-[2]F)(-[4]@{F1}F)(-[6]@{F2}F)-C(-[2]F)(-[6]F)-C(-[2]F)(-[6]F)-C(-[2]F)(-[6]F)-C(-[2]F)(-[6]F)-C(-[2]F)(-[6]@{F3}F)-[:0,1.5]C(=[2]O)(=[6]@{O1}O)(-[8]@{OH}OH)}
\schemestop
\chemmove{
\draw[-,brace]([yshift=-3pt,xshift=5pt]F3.south east) --  ([yshift=-3pt]F1.west|-F2.south)
node[midway,below=2pt]{text 1};
\draw[-,brace]([yshift=-3pt,xshift=6pt]O1.south-|OH.east) -- ([yshift=-3pt,xshift=5pt]F3.south east)
node[midway,below=2pt]{text 2};;
}
\end{document}
1
  • I am not sure about the version, I am using Texmaker 5.0.2 and chemfig version 1.3. But your solution is working beautifully thank you!!
    – Karhu
    Commented Apr 2, 2018 at 13:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .