tompollard/phd_thesis_markdown

make: *** [pdf] Error 1

FrancescoFilippi opened this issue · 8 comments

I'm trying to use the template in my thesis. Love both the idea and the template, but I'm stack with this error:

Unknown reader: pdf
Pandoc can convert to PDF, but not from PDF.
make: *** [pdf] Error 1

I've updated the make script as --latex-engine isn't supported anymore and (listening to pandoc own logging) --pdf-engine should be used. Final Makefile's pdf script looks like this:

pdf:
	pandoc $(INPUTDIR)/*.md \
	-o $(OUTPUTDIR)/thesis.pdf \
	-H $(STYLEDIR)/preamble.tex \
	--template $(STYLEDIR)/template.tex \
	--bibliography=$(BIBFILE) \
	--csl=$(STYLEDIR)/ref_format.csl \
	-V fontsize=12pt \
	-V papersize=a4paper \
	-V documentclass:report \
	-N \
	--pdf-engine=xelatex

I've installed every package required by the preamble.tex file and I can't get the script up and working.
Any ideas? Thanks.

Pandoc uses the file extension of input files to determine the reader type. So, two thing is might be:

  1. Is the -V documentclass:report line correct. I think it should have an equal not at semicolon. This might mess up pandoc's argument parsing.

  2. Does $(INPUTDIR)/*.md definitely find any files?

I tried to bypass the makefile and run the pandoc command directly with the local paths (documentclass:report updated with documentclass=report):

pandoc -N -H style/preamble.tex --template style/template.tex --bibliography=source/references.bib --csl=style/ref_format.csl -V fontsize=12pt -V papersize=a4paper -V documentclass=report source/*.md --pdf-engine=xelatex -o output/thesis.pdf

Something actually changed and the previous error is gone, so @robwalton was right and there was definitely something wrong with $(INPUTDIR)/*.md. In fact looks like now is trying to generate the .pdf, but a different kind of error did show up:

Error producing PDF.
! Undefined control sequence.
<argument> \LaTeX3 error: 
                           Erroneous variable \c__fontspec_shape_n_n_tl used!
l.3806 \emfontdeclare{ \emshape, \eminnershape }

@FrancescoFilippi The command that you've listed works fine for me. What is your operating system, pandoc version, and latex distribution? Thanks for highlighting the --latex-engine issue, btw. I've updated the Makefile.

@tompollard

  • macOS High Sierra 10.13.1
  • pandoc 2.1.1
    Compiled with pandoc-types 1.17.3.1, texmath 0.10.1, skylighting 0.6
    Default user data directory: /Users/francesco/.pandoc
  • pdfTeX 3.14159265-2.6-1.40.18 (TeX Live 2017)
    kpathsea version 6.2.3

I didn't install the whole MacTeX distribution, just the basicTeX.

It sounds like the last point in your list might be an issue. You may be missing the required packages. Can you check if fontspec is installed?

tlmgr list --only-installed | grep fontspec

If it is installed, you should see something like:

i fontspec: Advanced font selection in XeLaTeX and LuaLaTeX.

Could you post the result of tlmgr info fontspec?

That's it. fontspec was installed but there was a version mismatch. So

tlmgr update fontspec

solved the problem. Thanks!

Great, thanks @FrancescoFilippi.