This particular issue frustrated me for quite a while. If I can save anyone a few minutes of time it’s worth a quick writeup. Note I don't go into much detail about Obsidian, Pandoc, or MacTex. I find these tools invaluable but an explaination of them is beyond the scope of this post. Maybe someday when there's more time. In the mean time Google is your friend.
Print an Obsidian note to a PDF file. Obsidian is a cross platform note taking/personal information management tool available here
I installed the pandoc plugin for Obsidian hoping to print my documents directly from Obsidian to a pdf. I ran into two problems
- Obsidian would not find pandoc. I kept getting an error message.
- Once I figured this out (see below) it wouldn’t let me print to a pdf (it didn’t even offer an option to print to pdf)
Installing Pandoc and PDFLatex on Mac for use with Obsidian
Here’s what ultimately worked:
Note: I assume you have Obsidian installed and updated. If not start here
Install pandoc (on a mac I use homebrew - “brew install pandoc”). You can also download a binary here. I chose the brew method because I have a lot of tools installed with brew and updating all of them is a breeze with homebrew. If your new to homebrew here’s a good place to start
Install MacTex from here
Install the Obsidian pandoc plugin from the community plugin’s directory
Here’s where it took too long for me to figure out how to make this work.
You have to carefully configure both pandoc (installed with brew) and the pdflatex application (installed with MacTex)
- Go to Obsidian preferences -> Community Plugins -> Pandoc and click on the gear icon (this is putting you in the Obsidian/pandoc preference).
- Find the configuration option for both Pandoc path and PDFLaTex path. They are right next to each other.
Enter the explicit path to pandoc executable (this can be found using the command “which pandoc” in a terminal window) and enter it in the pandoc path option in the pandoc preferences. Note: Include the “pandoc” in the path (so “/folder/folder/pandoc”).
Find the path to pdflatex. This was harder. For some reason “which” didn’t find this. Could be because I didn’t reboot after installing mactex, or it could be because it was in the root library directory. I don’t know but I ultimately found mine in the directory: /Library/Tex/texbin. Note, again you need to put the executable “pdflatex” at the end of this. So my location was “/Library/Tex/texbin/pdflatex”
Once I put the correct paths in here this all worked. I was able to print to a pdf.The output isn’t pretty (I haven’t figured out how to use a template with this yet but I will). It does WORK though. Hope this post saves someone time