pastefromhtml is a Zim plugin that lets you paste lists, links, text, images, and LaTeX/MathML equations from HTML clipboard data.
You can install pastefromhtml by creating a folder with files htmlcdparser.py and __init__.py in your zim/plugins directory.
For installation in Linux, place the folder in ~/.local/share/zim/plugins.
You can also install by cloning the repository:
cd ~/.local/share/zim/plugins
git clone https://github.com/cetinkaya/pastefromhtml.gitTo enable the plugin, click on Edit / Preferences, then go to the Plugins tab.
For basic use (text, links, images) no additional dependencies are needed.
For LaTeX/KaTeX equation rendering (e.g. when pasting from Claude.ai) the following must be installed:
latexanddvipng(from TeX Live)
For MathML equation rendering (e.g. when pasting from GitHub Copilot) additionally:
python-pypandocandpandoc
On Arch/Manjaro:
sudo pacman -S texlive dvipng python-pypandocOn Debian/Ubuntu:
sudo apt install texlive dvipng pandoc python3-pypandocIf the dependencies are not installed, equations are silently skipped and the rest of the content is pasted normally.
pastefromhtml adds menu entries (Tools / Paste from HTML, Edit / Paste from HTML) and a right-click context-menu entry, as well as a keyboard shortcut (ctrl + shift + v) in Zim.
After you copy content in your browser, paste it into Zim by clicking on the menu entry or by using the shortcut ctrl + shift + v.
Equations are automatically rendered to PNG and embedded as images in the page's attachments folder.
To access the configuration options, click on Edit / Preferences, navigate to the Plugins tab, select Paste from HTML, and click the Configure button.
Available options:
- Images inside anchor tags – when pasting
<img>tags inside<a>tags, paste the image instead of the link URL - Reload page after pasting – reload the page after pasting to apply formatting
- LaTeX equation font size – font size in pt for rendered equations (default: 14)
- LaTeX equation image DPI – resolution of rendered equation images (default: 200)
- LaTeX dark mode – use white font color for equations (for dark Zim themes)