SMILES in Obsidian

It would we great is SMILES were possible in Obsidian for creating chemical and molecular diagrams

You can now add SMILES code to Mathpix Markdown (.mmd) documents using Markdown code block syntax to render chemical structures:

CC(O)=0

9 Likes

What’s the benefit over writing the chemical formulae directly using latex as shown in overleaf

However, currently I can only use chemistry syntax supported by mhchem since Obsidian render latex using MathJax

Working on it. Mathpix uses smiles-drawer to render smiles strings. With the help of the package it would be a simple implement. Unluckily I’m major in chemistry and not familiar to web dev, it may took some time for this.

2 Likes

Popular/Professional chemistry structure builders like chemdraw supports smiles, and its plain string nature fits well with markdown/obsidian. Smiles strings can be typed directly, or generate by mature structure builders, which would be helpful when handling complex structures.

Though latex packages like chemfig or mhchem can visualize molecules, they can’t represent a molecule well. It’s a basic concern in the field of cheminformatics.

2 Likes

Looking forward to the plugin.

1 Like

I’ve published a release just now, hope that you would like it XD.

5 Likes

As a physics & chemistry teacher I am very interested to test it.
Thanks for your work.
I will inform you about my experience.

:+1: perfect :ok_hand:

Super! It works like a charm.
I am wondering whether it can do chemical structure specific resizing and arrangement of structures in the smiles code block instead of a global setting?

It would also be good if more examples can be presented. Although I understand it is based on the converter which has multiple examples on its website.

Thanks for the kind words. (lol

Size setting for each structure would definately be supported, though I don’t want to include any setting info in the block. I would firstly wrap the structures up as components, then figure out how to specify the options.

What do you refer to when you talking about ‘examples’? Instructions of the plugin specified settings would certainly be provided. Or the users may need some turorial on the usage of the smiles-drawer package features and SMILES strings?

By “examples,” I meant tutorial on the usage, but yes, you are right that I can follow smiles-drawer to find a tutorial, so I was asking the obvious.

1 Like

Hello, may I ask why obsidian-chem renders Acetic Acid:

CC(=O)O

as:Pasted image 20230529233210
instead of: image
?

This is a feature provided by the package smiles-drawer, in the Drawer(options), you may configure a boolean compactDraw to render the terminal carboxylic acid group in either way. Here’s a quick demo from the package’s playground SmilesDrawer 2.0

Enable compact draw:

Disable compact draw:

Chem plugin will soon support the configs of the options, as there are some important styling problems involved.

Also refer to It's wrong for 'N=C(O)CC' · Issue #152 · reymond-group/smilesDrawer · GitHub

1 Like