SVG Export
To export an SVG of your drawing, choose File > Export SVG..., check the filename and options, and click Export SVG. There is no keyboard shortcut for SVG export.
SVG is the format for figures that must stay sharp at any size: atom labels stay selectable text, and the file matches the canvas because Molkit builds it from the live drawing. It also carries the chemistry and an editable copy of the drawing, so you can bring it back into Molkit later.
Export one molecule from a busy canvas
- Select the molecule, for example by double-clicking any atom of acetic acid with the Select tool.
- Choose
File > Export SVG.... - Under
Scope, pickSelection Only. - Type a name in
Filename, such asacetic acid. It appears asacetic-acid, and.svgis added for you. - Click
Export SVG.
Molkit stores the name you typed on the molecule, so the next export of the same selection starts with it. Typing a name for a selection that has none creates a named selection, which Batch Export can refresh later.
Filename
The Filename field is pre-filled from the first of these that exists:
- the named selection that matches your current selection;
- the saved name of the one whole molecule you have selected (empty if that molecule has no name yet);
- the last name used for this document, or the document’s filename (
moleculefor an untitled document).
Names are shown in web-safe form, so acetic acid becomes acetic-acid.
Options
| Option | What it does | Default |
|---|---|---|
Scope | All Content exports everything on the canvas; Selection Only exports the selected objects and is disabled when nothing is selected. | All Content |
Scale | 1x to 10x. The SVG stays vector; the scale sets its width and height, shown next to Size:. | 2x |
Include background | Adds a solid fill behind the drawing. Pick the color with the swatch or type a hex value. Clear it for a transparent SVG. | On, white |
Edit metadata... | A link that opens the metadata editor so you can set the title, description and names first. See Document and Molecule Metadata. | |
Responsive (remove width/height) | Drops the width and height attributes so the host page sizes the image. Scale is grayed out and the size reads Sized by container. | Off |
Theme-aware (light/dark) | Adds dark-mode colors that apply when the viewer is in dark mode. See Light and dark. | Off |
Padding | Space in pixels around the content, 0 to 200. | 20 |
Embed fonts for offline use | Writes the font files into the SVG. Shown only when the document uses a Google font or one you uploaded, and checked for you when it uses an uploaded font. See Font Embedding & Convert to Paths. | Varies |
Mobile-safe rendering | Embeds small metric-compatible stand-ins for Arial, Helvetica, Times and Courier. A note under the checkbox names them, and a warning triangle appears while the option is off and one of those fonts is in use. See Mobile-Safe Rendering. | Remembered |
Convert labels to paths | Outlines text labels as vector shapes. The file needs no font, and the text can no longer be selected. | Off |
Maximum compatibility | A static SVG for Microsoft Office (PowerPoint, Word), Keynote, LibreOffice and print. Checking it turns on Convert labels to paths and turns off Theme-aware (light/dark) and Embed fonts for offline use; you can change those three again afterwards. | Off |
Omit per-atom implicit H counts (metadata) | Records each atom’s implicit hydrogen count as 0 in the embedded data. Formula, molecular weight and atom count still include implicit hydrogens. Grayed out when the export has no implicit hydrogens. | Off |
Include editable source | Stores an editable copy of the document in the SVG. See What the SVG contains. | Off, not remembered |
Electrostatic maps | Where an electrostatic potential map goes: Inside the SVG (one file), Separate file (on demand) or Leave out. Shown only when a molecule in the document has a current map. | Inside the SVG (one file) |
Options that cannot affect the export are hidden. With no atoms in scope, Omit per-atom implicit H counts (metadata) disappears. When the export holds only images, such as a captured 3D view on its own, the text, font and theme options disappear as well.
The dialog shows a preview built the same way as the export, so it matches the saved file. If the export fails, an error message gives the reason and the dialog stays open.
Light and dark (theme-aware export)
The Molkit editor has one light appearance and no light/dark switch. To recolor the drawing itself, change the color scheme. Light and dark matter once the file leaves Molkit: a website or slide viewer in dark mode shows your black bonds on a dark background.
Theme-aware (light/dark) fixes this. It writes a @media (prefers-color-scheme: dark) rule into the SVG, so a viewer set to dark mode shows dark-appropriate colors and a light viewer shows the light version, from the same file. A host page can also force either version with the mk-light or mk-dark class; see CSS Theming.
The checkbox is in three dialogs:
Export SVG, off by default;Export Animated SVG, on by default;Export LaTeX Animation, on by default.
Leave it off when the export must look the same everywhere. Maximum compatibility turns it off, because that option bakes the colors in for apps such as PowerPoint and Keynote.
With the option off, the export bakes in the colors the app is showing. If the app is displayed in a dark theme, an SVG, PNG or PDF on a light or transparent background is drawn with the light theme’s dark ink, so bonds do not come out near-white on a white page or slide. A dark background keeps the dark theme’s light ink.
Remembered settings
The dialog starts from the options you chose last, in this document or any other and after a reload. The filename is not carried between documents. Exports that contain a structure and exports that do not (a 3D capture on its own, for example) keep separate settings, so changing one leaves the other alone.
If you save the document after exporting, the .mkit file stores its own export settings, and they take priority for that document.
What the SVG contains
- Vector geometry with a
viewBoxset to the content bounds, an inline stylesheet, and atom labels as text unless you converted them to paths. - Chemistry data for every atom and bond, plus molecule-level data such as the formula, SMILES and a MOL block. This is always included and has no checkbox. See Embedded Chemistry Metadata.
- A 3D geometry and net dipole for each molecule, when one can be generated. The structure widget uses these; if generation fails, the export goes ahead without them.
- An editable copy of the drawing, only if you tick Include editable source. With it, you can open the SVG with
File > Import SVG..., drop it on the canvas, or paste it, and it comes back as editable objects. Without it, Molkit brings the SVG back as a picture. The option is off each time the dialog opens and is not remembered, because anyone who receives the file also receives the full document. Turn it on for working copies you plan to edit again, and leave it off for files you share or publish. - An electrostatic potential map, when a molecule in the export carries a current one. The
Electrostatic mapsoption, shown when a molecule in the document has a current map, writes itInside the SVG (one file), as aSeparate file (on demand)with the.espextension in the folder you name (espby default), orLeave out. A separate map file downloads next to the SVG, and a message tells you which folder to put it in beside the SVG. See Electrostatic Potential Maps.
When you are online, the export also looks the molecule up in PubChem to add its IUPAC name and identifiers. The lookup gives up after eight seconds, and the export completes either way.
If the structure uses R-groups with defined substituents and their geometry could not be embedded, a warning tells you the SVG has the substituent legend but no drawable fragments. Check the R-group definitions and export again.
A host web page can restyle the SVG with CSS, read the chemistry from JavaScript, and follow the site’s theme toggle. The Developer Guide has code examples.
See also
- PNG Export for fixed-pixel images
- PDF Export for print
- Electrostatic Potential Maps