2

In relation to this question How to create cram bonds with anchors, I wanted to put the segment in the background and the black triangle hiding it in the foreground.

enter image description here

How is this possible with chemfig?

Here there is my answer

\documentclass{article}
\usepackage{chemfig}
\begin{document}
\chemfig{
                   % 7
      -[:270,0.963]% 4
    -[:328.2,1.019]% 3
            -[:270]% 2
            -[:210]% 1
                      (
                -[:150]% 6
                 -[:90]% 5
         -[:31.8,1.019]% -> 4
                      )
    -[:267.9,1.001]% 8
                      (
                -[:210]% 10
                      )
                      (
                -[:330]% 11
                      )
    <[:102.9,1.696]O% 9
                      (
         >[:73.3,1.445]% -> 4
                      )
}
\end{document}

enter image description here

Reading the chemfig manual I have not found nothing.

Edit: Considering the output after the very nice comments, I have a white space below probably why I have not a straight line?

\documentclass{article}
\usepackage{chemfig}
\begin{document}
\chemfig{
                   % 7
      -[:270,0.963]% 4
    -[:328.2,1.019]% 3
            -[:270]% 2
            -[:210]% 1
                      (
                -[:150]% 6
                 -[:90]% 5
         -[:31.8,1.019]% -> 4
                      )
    -[:267.9,1.001]% 8
                      (
                -[:210]% 10
                      )
                      (
                -[:330]% 11
                      )
    <[:102.9,1.696,,,,{preaction={draw=white,-,line width=2pt}}]O% 9
                      (
         >[:73.3,1.445]% -> 4
                      )
}
\end{document}

enter image description here

10
  • 2
    Crossing bonds in chemfig might be interesting.
    – leandriis
    Apr 30, 2020 at 20:28
  • @leandriis Thank you very much for your precious comment....but there is always tikz? :-( I wanted use only chemfig and just the moment I am not able to solve my question.
    – Sebastiano
    Apr 30, 2020 at 20:36
  • 1
    What about tex.stackexchange.com/a/40164/134144? Probably you will have to adjust the width to prevent the white line covering part of the oxygen atom.
    – leandriis
    Apr 30, 2020 at 20:37
  • 2
    chemfig uses tikz so without tikz is not a good idea. In @leandriis link there are two answers, and if you use <[:102.9,1.696,,,,{preaction={draw=white, -,line width=2pt}}] for the < path it gets already close.
    – user194703
    Apr 30, 2020 at 20:39
  • @leandriis Can you add an answer, please? I am not expert in chemistry..I am only 5 votes to vote up :-)
    – Sebastiano
    Apr 30, 2020 at 20:39

1 Answer 1

2

Try this (with the construction to help the understanding):

\documentclass{article}
\usepackage{chemfig}
\begin{document}
\chemfig{*6(-
    ([::150,0.75,,,draw=purple]-
    O?[Oxy]-
    [::162,0.75,,,preaction={draw=green,line width=8pt}])
    (-?[Oxy,{>},{red}]([::60]-)([::-60]-))---
    (?[Oxy,{>},{blue}])(-)--)}\qquad
\chemfig{*6(-([::150,0.75,,,draw=none]-
    O?[Oxy]-
    [::162,0.75,,,preaction={draw=white,line width=8pt}])
    (-?[Oxy,{>}]([::60]-)([::-60]-))---
    (?[Oxy,{>}])(-)--)}
\end{document}

The output: Molecule

2
  • Thank you very very much (+1)...After can, please, you consider my edit to the question?
    – Sebastiano
    May 1, 2020 at 15:25
  • 1
    Replace draw=white by draw=red and you will see what's happening. That's the reason why I not using this work-around. May 1, 2020 at 15:47

You must log in to answer this question.

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