0

I try to put this formula to LaTex: enter image description here

but this code is not the best descicion for this problem:

{\left[{(-CF_2-CF_2-)}_n-CF_2-CF-\right]}_x
\\\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\overset\vert{(O-}CF_2-CF)_m-O-CF_2CF_2-SO_3^-M^+
\\\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\overset\vert{CF_3}

I also tried to find solution on this webpage https://www.overleaf.com/learn/latex/Chemistry_formulae but I didn't find it(( Can you please help me

  • 4
    Please don't post code fragments, but instead put the fragment into a compilable document that includes \documentclass{...}\begin{document}...\end{document}. But as the Overleaf links show, there are various packages designed specifically for chemistry, so it would probably be best to try to use one of those packages to create your formula and then people can help you from there. Also the Overleaf documentation is not the full documentation for any of the packages it recommends. – Alan Munn Jan 21 '23 at 17:33
  • 1
    To take up the space on the left, you can use \phantom{...}. For line 2, just copy everything up to the "CF" in the first line, where the second line starts, but omitting the \left (which would cause an error) and one "(", to adjust for the one starting line 2. For line 3, repeat the \phantom from line 2, then another `\phantom' starting with "(" and going on as far as necessary. There are undoubtedly other solutions, but a simple hack seems easiest here. – barbara beeton Jan 21 '23 at 17:48
  • 1
    Have a look here: https://www.ctan.org/topic/chemistry . Chemstruct and streetex claim to handle otganic chemistry, though these two packages are quite old. – MS-SPO Jan 21 '23 at 18:23
  • 2

2 Answers2

5
\documentclass{article}
\usepackage{chemfig}
\def\0{\vphantom{C}}
\begin{document}
    \chemfig[atom sep=2em, fixed length=true]{
        -[@{op2,-0.2},0.25,,,draw=none]\0-[@{op1,-0.2}]CF_2|\0-CF_2|\0-[@{cl1,1.2}]\hphantom{I}-CF_2|\0-CF(-[6]O-[@{op3,-0.8}]CF_2|\0-[@{cl3,2.2}]CF(-[6]CF_3)-[,0.5,,,draw=none]-O-CF_2CF_2|\0-SO_3^{-}M^+)-[@{cl2,1.2}]
    }
    \polymerdelim[height=2pt, depth = 4pt, indice=\!n]{op1}{cl1}
    \polymerdelim[delimiters ={[]}, height=3pt, depth=5pt, indice=\!x]{op2}{cl2}
    \polymerdelim[height=2pt, depth = 4pt, indice=\!m]{op3}{cl3}
\end{document}

enter image description here

Edit

\documentclass{article}
\usepackage{chemfig}
\def\0{\vphantom{C}}
\begin{document}
    \chemfig[atom sep=2em, fixed length=true]{
        \0-[@{op2,-0.2},]CF(-[6]O-[@{op3,-0.8}]CF_2|\0-[@{cl3,2.2}]CF(-[6]CF_3)-[,0.5,,,draw=none]-O-CF_2CF_2|\0-SO_3^{-}M^+)-CF_2|\0-\hphantom{I}-[@{op1,-0.2}]CF_2|\0-CF_2|\0-[@{cl1,1.2}]\hphantom{I}-[@{cl2,1.2},0.3,,,draw=none]
    }
    \polymerdelim[height=2pt, depth = 4pt, indice=\!n]{op1}{cl1}
    \polymerdelim[delimiters ={[]}, height=3pt, depth=5pt, indice=\!x]{op2}{cl2}
    \polymerdelim[height=2pt, depth = 4pt, indice=\!m]{op3}{cl3}
\end{document}

enter image description here

polyn
  • 5,614
2

You can use the package chemfig to draw any kind of molecule.

\documentclass{article}

\usepackage{chemfig} \usepackage{amsmath}

\begin{document}

\chemfig{\phantom{CH_2}-[@{op1,.75}]-[@{op2,.75}]CF_2-CF_2-[@{cl2,0.25}]CF_2-CF(-[6]@{op3,.75}O-CF_2-CF(-[6]CF_3)-[@{cl3,0.25}]O-CF_2CF_2-SO_3^{-}M^{+})-[@{cl1,.25}]} \polymerdelim[delimiters ={[]}, height = 6pt, indice = x, open xshift=-5pt, close xshift=-15pt]{op1}{cl1} \polymerdelim[height = 4pt, indice = n]{op2}{cl2} \polymerdelim[height = 4pt, indice = m, open xshift=-10pt]{op3}{cl3}

\end{document}

enter image description here

kekko
  • 509