Chem is a plugin for Obsidian.md providing chemistry support. It allows you to insert chemical structures into your notes through code blocks containing SMILES strings (powered by Smiles Drawer).
You can use this plugin to render chemical structures from SMILES strings. Just type the SMILES strings in a code block with smiles
as the language. Each line should contain only one string.
The data is stored as plain text, so you won’t lose it. The renderer will always work, even if the plugin changes its cheminfo core.
You can adjust the image size and configure light themes and dark themes of the molecule pictures in the plugin’s settings page.
Note
For now, you need to reopen the active notes containing SMILES blocks to apply the new settings, as well as adapting the Obsidian light/dark theme changes.
SMILES stands for Simplified Molecular-Input Line-Entry System. It is a specification to describe chemical structures using linear ASCII strings. You can learn more about it from the official website or Wikipedia.
Using SMILES strings to represent molecules is easier and more widely supported by chemistry drawing tools than using LaTeX packages like mhchem and chemfig.
For simple structures, you can type them in manually. However, for more complex ones, you may want to use structure editors, such as ChemDraw, ChemDrawJS, MarvinJS and Ketcher. Also, you can use translators like Open Bable, JOELib and the Chemical Translation Service to convert chemical names, CAS numbers and *.mol files into SMILES strings.
Note
Make sure that you are not in the Restricted Mode.
The plugin is available in the official plugin market. You can go to Settings → Community plugins → Browse, and search for the Chem
plugin by Acylation. After installing, you need to enable the plugin to use it.
You can also follow the steps below to install the plugin manually.
- Go to the repo's latest release page, and download the
main.js
,style.css
, andmanifest.json
. Alternatively, you can download the latest zip file and then unzip it to get the three files. - Copy these files to your local path
[yourvault]/.obsidian/plugins/obsidian-chem/
. You may need to create the folderobsidian-chem
by yourself. - Launch/restart Obsidian, or refresh the plugin list, you will see this plugin.
- In the plugin list, enable
Chem
and enjoy!
I have a lot of ideas for this plugin, but my coding skills and resources are limited. I want to make it useful for anyone who needs to take notes on chemistry (such as research records, organic chemistry anki cards, etc.). As examples, here are some of the features I have in mind.
- Displaying chemical formulas and structures.
- Importing structures from the clipboard, .cdxml files, etc.
- Appending chemical info (e.g. exact mass) next to the structures. This can help MS users and beginners in chemistry.
- Supporting internal coordinates like .mol files. Would be useful in computational chemistry.
- Shortcuts for physicochemical formulas in LaTeX.
- ......
I'd love to hear your feedback and suggestions. Actually, the first feature of the plugin, to render SMILES strings, was suggested by community users! I’m very grateful for their input. (See the acknowledgment section for details)
Before working on a new feature, I will consider the following criteria. The feature should meet at least one of them to be useful.
- It helps with taking notes on chemical research, like experimental records, literature notes, paper writing, etc.
- It promotes a workflow that integrates well with other chemistry tools.
- It aids in learning chemistry and related subjects.
As an Obsidian plugin, this project adheres to the following principles:
- Localize: Data should be kept local and standalone packages are preferred over remote services.
- Leave No Trace: The plugin must not leave plugin-specific content in notes, allowing them to be shared with non-Obsidian users.
- Plain Text Central: Plain text is preferred over complex formats.
Thank you for your interest in contributing to this project! We welcome bug reports, feature requests, and pull requests from anyone.
- Please use the issue tracker to report any problems or suggest new features.
- Before creating a new issue, please search for existing issues to avoid duplicates.
- When creating a new issue, please follow the templates to provide necessary information.
- You can also vote for existing issues by adding a 👍 reaction to show your support.
- If you want to contribute code, please fork the repository and create a new branch for your work.
- If you are a beginner in plugin development, you can check the official developer documentation.
- Please include a clear and concise description of your changes in the pull request title and body.
- Please reference any related issues in the pull request body using keywords like
fixes #123
orcloses #456
. - Please wait for a review before merging your pull request.
- If you have any questions or need help with using or developing this project, please join our Discussions right here in the repo.
Thank you for being a part of this project! 🙌
Check out the roadmap to see what's been working on.
The plugin relies on Smiles Drawer as the parsing and drawing core, and uses Mathpix as an example on how to integrate the package. Thank you very much!
During the whole process of development, I found the developer documentation super helpful. Massive thanks to @marcusolsson for leading this project!
The plugin is motivated by forum requests for including chemical structures in Obsidian. Thank you for the inspiring discussions and the great ideas!
- https://forum.obsidian.md/t/smiles-in-obsidian/35974
- https://forum.obsidian.md/t/structural-formulas-for-chemistry/29366
- https://forum.obsidian.md/t/chemistry-formulas-in-obsidian/25772
- https://forum.obsidian.md/t/obsidian-for-chemistry/33491
- https://forum.obsidian.md/t/how-to-write-chemical-formulas/12249