Latexmk with xelatex: xdvipdfmx cannot convert the resulting xdv file to pdf

1.3k Views Asked by At

I'm trying to compile a file using latexmk and xelatex, but for the life of me I can't make it work. I honestly have no idea what's going on.

I'm using Latexmk Version 4.55 on Ubuntu 16.04 and XeTeX, Version 3.14159265-2.6-0.99998 (TeX Live 2017) (preloaded format=xelatex).

Here is a MWE that I'm trying to compile:

\documentclass[12pt]{article}
\usepackage{fontspec}
\usepackage{unicode-math} 
\begin{document}

This is some text.

\end{document}

Compiling with

xelatex mwe.tex

works as it should. I get a pdf as output. However, both

latexmk -xelatex mwe.tex
latexmk -pdfxe mwe.tex

fail. I've tried a bunch of different additional options, but I can't get a pdf output with latexmk. The error looks like this:

xdvipdfmx:fatal: Something is wrong. Are you sure this is a DVI file? DVI ID = 7 xdvipdfmx: Command for 'xdvipdfmx' gave return code 256

Browsing other kind of similar questions (but they seem to have some font issue) made me try running

 xdvipdfmx -vv mwe.tex

which yeilds the following error:

FONTMAP:/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map>

mwe.tex -> mwe.tex.pdf DVI ID = 10

xdvipdfmx:fatal: Something is wrong. Are you sure this is a DVI file?

The frustrating thing is that everything works fine at work, where I have an older version of Ubuntu, and probably latexmk.

I would think that latexmk use the same ''backbone'' as when I call xelatex from the command line, but how come one yeilds and output, and one don't? Is there a way to see specifically what's going on ''deeper down''. (For the record, I have tried compiling with xelatex and latexmk using texstudio with the same result.)

What am I doing wrong here?

0

There are 0 best solutions below