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

JP McCarthy picture JP McCarthy · May 13, 2016 · Viewed 9.7k times · Source

I have just upgraded my Macbook Pro OS to El Capitan (v10.11.4).

My attempt to export a Markdown file (created using Sublime Text 2, v2.0.2, build 2221) to pdf using pandoc is now failing, and I receive the following error:

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

My output command is as follows:

pandoc doc1.md -o doc1.pdf --toc -V geometry:margin=1in --variable fontsize=10pt --variable fontfamily=utopia --variable linkcolor=blue --latex-engine=xelatex -f markdown-implicit_figures -s

Above command worked like a charm prior to installing El Capitan.

FYI - in searching for questions here I have not found one that gives a suitable answer.

Answer

holibut picture holibut · Aug 18, 2016

For my case, add one line into ~/.bashrc solved the error:

export PATH=/Library/TeX/texbin:$PATH

Of course, the environment variable should be activated in the current term:

$ . ~/.bashrc

then run: $ make

the error disappears.