artisticat1 / obsidian-tikzjax

Render LaTeX and TikZ diagrams in your notes
MIT License
395 stars 23 forks source link

Can't set charges within chemfig #22

Open bryceorchard opened 1 year ago

bryceorchard commented 1 year ago

Using say \chemfig{A^+-[2]B} which should look like:

Screenshot 2022-11-06 at 7 11 25 PM

however it fails to display. It seems like the support for adding charges to atoms is lacking, including the \charge macro

MultisampledNight commented 1 year ago

It looks like the packaged tikzjax just ships an old version of chemfig, where \charge wasn't available. Using \listfiles in the preamble and looking into the console:

chemfig.sty    2019/04/18 v1.4 Draw molecule with an easy syntax (CT)

Temporary workaround is to use the \lewis command, which was deprecated in chemfig 1.5 on 2020-03-05 and removed in chemfig 1.6 though.