obsidian-tikzjax icon indicating copy to clipboard operation
obsidian-tikzjax copied to clipboard

Chemfig scheme causes the bond lines to disappear

Open TroubleClef128 opened this issue 2 years ago • 3 comments

In chemfig \schemestart and \schemestop are used to define a scheme which is important to add arrows and to align elements.

The following is a document I made for my notes in Obsidian:

\usepackage{chemfig}
\begin{document}

\schemestart
\chemfig{[:-60]*6(---(*6(------))(-[:-90]Cl)---)}
\arrow
\chemname{\chemfig{[:-60]*6(---(*6(-----=))---)}}{major}
and
\chemname{\chemfig{[:-60]*6(---(*6(=-----))---)}}{minor}
\schemestop

\end{document}

This results in the following in TikZJax: scheme-TikZJax

The same code produces the following when compiled using LaTeX: scheme-LaTeX

I've been getting by by only using the \schemestart and \schemestop markers around the \arrow commands:

\usepackage{chemfig}
\begin{document}

\chemfig{[:-60]*6(---(*6(------))(-[:-90]Cl)---)}
\schemestart
\arrow
\schemestop
\chemname{\chemfig{[:-60]*6(---(*6(-----=))---)}}{major}
and
\chemname{\chemfig{[:-60]*6(---(*6(=-----))---)}}{minor}

\end{document}

This produces the following in TikZJax: scheme-arrow

So the bond lines do render correctly, but because not all parts of the figure are part of the scheme, the arrow doesn't center appropriately. In this example the scheme is used on a small scale, but this is a necessary feature in creating more complex reaction figures.

TroubleClef128 avatar Dec 02 '22 15:12 TroubleClef128

Still encountering the same problem :( Has anyone found a workaround, aside from rendering the formula externally and inserting the final image?

deindoenermann avatar Mar 16 '24 08:03 deindoenermann

Same issue here, I’d highly appreciate if someone could resolve this issue. Or if someone knew a feasible workaround, too. This really is a deal breaker for basically any sort of organic chemistry notes in Obsidian.

thecodechemist99 avatar May 14 '24 19:05 thecodechemist99

~~This might be related to #9. I’m not sure, but it seems very likely that schemes would need multiple passes to render correctly and apparently that’s currently not supported.~~ Edit: Actually probably not, as #54 suggests it has something to do with missing bond settings and cram bonds are actually rendered correctly.

thecodechemist99 avatar Jun 22 '24 09:06 thecodechemist99