I have defined a compilation tool for TeXWorks as follows:
Program: latexmk
Arguments: -e
$xelatex=q/xelatex $synctexoption %0 %S/
-pdf
$fullname
It works fine in most cases, but I'm having problems with one file that imports the hyperref
package. Here's a minimal example:
\documentclass{article}
\usepackage{fontspec}
\usepackage[xetex,bookmarks=true,colorlinks=true,linkcolor=headernfooter,urlcolor=headernfooter,linktoc=section,]{hyperref}
\begin{document}
hello, paper!
\end{document}
If I use the (predefined) XeLaTeX compilation tool instead, it works. If I comment the line importing hyperref
, it works. But if I try to combine them, I get the following error message:
! Package hyperref Error: Wrong driver option `xetex',
(hyperref) because XeTeX is not detected.
If I remove the xetex
option and the import of fontspec
, both work, but then I can't choose the fonts I want in my real document.
How do I combine these requirements?