Closed3
WSL2でpandoc(md -> pdf)

インストール
apt install
では古いバージョンがくるので、githubからダウンロードしてインストールする
Debianベースの場合
wget <最新のリンク>.deb
sudo dpkg -i pandoc-2.9-1-amd64.deb

そのままだとPDF変換できない
Error producing PDF.
! LaTeX Error: Missing \begin{document}.
Error producing PDF.
! LaTeX Error: File `ltjsarticle.cls' not found.
LuaLaTexを経由しないといけないので、LuaLaTexを入れる
必要ライブラリを入れる
sudo apt update
sudo apt install texlive-lang-japanese texlive-luatex texlive-latex-extra texlive-latex-recommended

変換
pandoc \
--standalone \
--output=out.pdf \
--pdf-engine=lualatex \
-V documentclass=bxjsarticle \
-V classoption=pandoc \
./yourdocument.md
このスクラップは2023/11/27にクローズされました