Post

Convert Obsidian Markdowns to MS Word, Power Point - Pandoc

If you have a well-organized article using Obsidian, you may occasionally need to share it with a colleague or friend. Obsidian itself provides the ability to export as a PDF file, but if you want to share it in the form of a Word(docx) or Power Point(pptx) file that can be modified, copying and pasting a lot of new files is a hassle.

So, I would like to introduce Pandoc, an Obsidian community plugin that can make this task easier.

What is the Pandoc?

The Pandoc is a library for converting from one markup format to PDF, MS Word, and PowerPoint as well as Markdown, HTML, and LaTeX. Basically, it is a CLI tool that can be used as a command in Windows Powershell or Linux terminal.

However, because document conversion using commands is complicated, Pandoc is provided in the form of a plug-in so that you can easily use Pandoc in a GUI environment. If you search in the community plugin menu in Obsidian, two plugins are found. In this article, we will talk about the first Pandoc plugin. Actually, I tried using Obsidian Enhancing Export, which was searched for the second time, but it didn’t work well.

Obsidian - `Community Plugins` - `Pandoc Plugin` Obsidian - Community Plugins - Pandoc Plugin

Install Pandoc

The Pandoc plugin does not work by itself. The plugin uses the official Pandoc library to convert documents.

Therefore, you need to visit the Pandoc official site and download and install the Pandoc library.

Visit the Pandoc site. Pandoc supports various types of OS installation packages such as Windows, macOS, and Linux. Download and install.

Pandoc Official Site - Download Pandoc Official Site - Download

If you are a Windows user, I recommend the installation package in msi format. If you want to use the portable version in zip format, it’s not a big problem. Anyway, download and install or unzip it to a suitable location.

Install and configure Pandoc Plugin in Obsidian

Allow the use of the Community plugin in Obsidian’s Settings, and search for and install the Pandoc plugin in the Community plugin menu. And activate it.

Obsidian - Settings - Community Plugins - Pandoc Plugin Obsidian - Settings - Community Plugins - Pandoc Plugin

Once the plugin has been installed and activated, the next step is to set up the plugin. You can see that the Pandoc Plugin item has been added to the settings. The parts that need to be set here are the Export folder and Pandoc path.

Obsidian - Settings - Community Plugin - `Pandoc Plugin` Settings Obsidian - Settings - Community Plugin - Pandoc Plugin Settings

  • Export folder : Folder where files are saved when converting Obsidian Markdown to the file format you want.
  • Pandoc path : This is the executable file path of the Pandoc library downloaded and installed above.
  • If you installed Pandoc using a Windows msi or a Linux deb, you don’t need to configure it. When the Pandoc library is installed, the executable file path is registered in the environment variable, so Obsidian will automatically recognize the Pandoc path.
  • However, if you downloaded and unzipped the portable format of the zip file, you must add the full absolute path to pandoc.exe or the executable file path of pandoc. Assuming you are in a Windows environment, a suitable example would be C:\Data\pandoc-3.1.11.1-windows-x86_64\pandoc-3.1.11.1\pandoc.exe.

When everything is completed, restart Obsidian.

Usage Of The Pandoc Plugin

To convert Obsidian Markdown to the file format you want, press Ctrl + P to open the Quick Palette. Then, if you search for pandoc plugin and select the desired file format, a file will be created in the Export folder set above.

Obsidian - Article - `Ctrl + P` - Search `pandoc plugin` - Select Format You Want To Convert it Obsidian - Article - Ctrl + P - Search pandoc plugin - Select Format You Want To Convert it

If your post doesn’t have any images, there won’t be a problem, but if it contains images, you’ll get an error saying the image file can’t be found

Obsidian - Pandoc plugin - Post with attached image file - Export as Word Document (docx) Obsidian - Pandoc plugin - Post with attached image file - Export as Word Document (docx)

File conversion error solution by Pandoc

The cause of the problem is that the plugin does not find the image file attached to the post based on the location of the markdown file. The plugin will attempt to find the image file in the Obsidian Vault root. So an error occurs saying there is no image file.

To solve this problem, I tried setting the --resource-path option in Extra Pandoc arguments in the plugin settings, but it did not work. Unfortunately this bug cannot be fixed. Because the plugin has not been updated and is no longer maintained for over a year. But walkarounds do exist !

The solution is to create a new vault for export purposes only and use it when document format conversion is needed. copy the md and image files to the vault root and convert them.

New Obsidian Vault for Export Purposes Only New Obsidian Vault for Export Purposes Only

Of course, copying md files and image files to the vault for export purposes every time you convert a file is a hassle, but considering the quality of the converted files, it may be a worthwhile hassle. Below is the result of converting md to word (docx) with Pandoc.

**Word** file created by Pandoc Word file created by Pandoc

Below is the result of converting md to PowerPoint (pptx) using Pandoc.

**PowerPoint file** created by Pandoc PowerPoint file created by Pandoc

This post is licensed under CC BY 4.0 by the author.