Thursday, October 13, 2022

Obsidian and Pandoc. Printing to PDF on a Mac

Obsidian - Pandoc and PDF on a Mac

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.

The Goal:

Print an Obsidian note to a PDF file. Obsidian is a cross platform note taking/personal information management tool available here

The Issue:

I installed the pandoc plugin for Obsidian hoping to print my documents directly from Obsidian to a pdf. I ran into two problems

  1. Obsidian would not find pandoc. I kept getting an error message.
  2. 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

Sunday, April 26, 2020

Using Drafts and Marked 2

I frequently use Drafts to capture text on my iOS and Mac devices and Marked 2 to view markdown on the Mac. I was quite excited about Drafts getting support for streaming preview with Marked. You can find details about Drafts action here.

It did take me a bit to get this working - I can be a bit dense at times. Here’s what I did to get it working.

  1. Install the plugin on your Mac and put it in an appropriate actions group. I restarted Drafts but I don’t think this is required.
  2. Under the Drafts preference pane -> general tab, click on the “Enable Marked App Streaming Preview support” checkbox.
  3. Open the “Marked 2” application
  4. Click on the installed action “Open Marked Streaming Preview” action from your Mac. Alternatively, under the Marked “Preview” window click streaming preview. This will bring up the streaming preview window.
  5. Go to Drafts and start typing.

Highly recommend the action - it works great. Note Marked 2 is a Mac only application so this action does not work on iOS devices.

I hope this makes life easier for the next person installing this action.

Saturday, January 28, 2017

Sunday, December 25, 2016

Facts Matter 4

America, and the world, is pretty great compared to any time in the last 200 years.  Credit to https://ourworldindata.org/a-history-of-global-living-conditions-in-5-charts/

 

Wednesday, December 7, 2016

Civility

“We have a choice about how we behave, and that means we have the choice to opt for civility and grace.” – Dwight Currie “Civility means a great deal more than just being nice to one another. It is complex and encompasses learning how to connect successfully and live well with others, developing thoughtfulness, and fostering effective self-expression and communication. Civility includes courtesy, politeness, mutual respect, fairness, good manners, as well as a matter of good health.” – Pier Massimo Forni "When once the forms of civility are violated, there remains little hope of return to kindness or decency." – Samuel Johnson

Tuesday, December 6, 2016

Facts Matter 3

Undoubtedly some jobs have been saved in the Indiana Carrier deal made by the incoming administration.  Better than none. The fact: it cost around 7 million in corporate welfare to save somewhere between 38 and 57 percent of jobs in this deal. Certainly a good deal for Carrier and those whose jobs were saved.  Not so sure about the citizens of Indiana who paid for this.

http://www.politifact.com/punditfact/statements/2016/dec/04/heather-mcghee/did-donald-trumps-carrier-deal-actually-save-less-/

Thursday, November 10, 2016

Revival Time

A lot of things have happened recently that are sparking my interest in writing again.  A lot will have to change but kendisbrow.com will emerge anew.  In the mean time:

 

Tuesday, May 5, 2015

Mike McCoy

World saw the passing of a great guy on April 22nd. Mike was a family friend and instrumental in steering my kid's into their profession (by leading a Fire Explorer's post). Read about him here.

Tuesday, January 13, 2015