MacBook Pro 2016, macOS Catalina, version 10.5.7
Install
- Install packages
brew install basictex sudo tlmgr update --self --all # Not sure if these 3 are needed sudo tlmgr paper a4 sudo tlmgr install collection-langjapanese sudo tlmgr install xecjk # Fix `! LaTeX Error: File `ctexhook.sty' not found.` sudo tlmgr install ctex
- To fix
! Package fontspec Error: The font "IPAexGothic" cannot be found.
, download fonts from here, unzip, and double click the.ttf
file to open a window, clickInstall font
- There must be a simpler way to install… It’s never easy to setup latex, especially for writing Japanese/Chinese/Korean
Compile
I use a makefile so that the files can be ordered as I like. Note that Makefile indentation usually requires TAB
.
files = \
index.md\
$(wildcard files*.md)
output/manual.pdf: $(files)
pandoc --pdf-engine=xelatex -V CJKmainfont=IPAexGothic
-V colorlinks=true \
--output=$@ $(files)
In terminal, type make