Pandoc 導入

Pandoc 導入

Install

$ brew install pandoc
$ brew cask install mactex

zshを使用しているため、.zshrc に以下を追記

PATH=/usr/local/texlive/2019/bin/x86_64-darwin/:$PATH

変更内容を読み込む

$ source ~/.zshrc

以下のように実行

$ pandoc *.md -o sample.pdf --latex-engine=xelatex -V documentclass=bxjsarticle -V classoption=pandoc

Error

pandoc: pdflatex not found. pdflatex is needed for pdf output.

Pandocを実行すると以下のエラー

$ pandoc *.md -o sample.pdf
pandoc: pdflatex not found. pdflatex is needed for pdf output.

Pandocがpdflatexに依存していて、これがインストールされていないかららしい

mactex をbrewでインストール

参考 https://superuser.com/questions/1038612/where-do-i-get-the-pdflatex-program-for-mac

command not found: pdflatex

パスを設定で実行できるようになった

! Package inputenc Error: Unicode character は (U+306F)

以下実行で上記エラー文

指示文どおりに以下のオプションで解消

! Undefined control sequence.

以下のエラーはエスケープで解消

日本語が表示されない

-V documentclass=bxjsarticle -V classoption=pandoc オプションを追加で解消

参考 https://qiita.com/sky_y/items/15bf7737f4b37da50372

! Text line contains an invalid character.

一回削除して同じ文章を打ち直すと解消

Reference

  • Pandoc Manual

    • https://pandoc.org/MANUAL.html

Last updated