Discussion:
[tex-live] Fatal fontspec error: "cannot-use-pdftex"
José Hissa Ferreira
2017-04-11 14:10:33 UTC
Permalink
Hello,

I have TeXLive installed on both Ubuntu 16.04 and Windows 10 with no
problems but today just after the update process I got an error with
fontenc package:

Fatal fontspec error: "cannot-use-pdftex" The fontspec package requires
either XeTeX or LuaTeX. You must change your typesetting engine to,
e.g., "xelatex" or "lualatex"instead of plain "latex" or "pdflatex". For
immediate help type H <return>.

This error message is wrong because I am using pdflatex to compile.

I did run pdflatex with my tex file (with beamer) before and after the
update. Just after the update had ended (without any error message) I
did run the same file and got that error message.

I can not identify the source of this issue and I would like some
guidance on how to proceed

Thanks,

JHissa
David Carlisle
2017-04-11 14:44:12 UTC
Permalink
Post by José Hissa Ferreira
This error message is wrong because I am using pdflatex to compile.
The error message is because you used pdflatex.
You have included the fontspec package, and that requires xelatex or
lualatex and does not work with pdflatex.

David
José Hissa Ferreira
2017-04-11 15:59:20 UTC
Permalink
David,

The "culprit" is the `dantelogo.sty' package:

\@tempswatrue% suppose latex or pdflatex

%

\ifXeTeX\@tempswafalse\else\ifLuaTeX\@tempswafalse\fi\fi

%

\***@tempswa% we have (pdf)latex

\message{We run (pdf)latex ... }%

\PassOptionsToPackage{T1}{fontenc}%

\RequirePackage{fontenc}%

\def\***@font{\fontencoding{\encodingdefault}\fontfamily{DANTE}\selectfont}%

\else

\message{We run (lua)xelatex ... }%

\RequirePackage{fontspec}

\newfontfamily\***@font{DANTE}%

[Extension=.otf,

BoldFont=*-Bold,

ItalicFont=*-Italic,

BoldItalicFont=*-Bold-Italic]

\fi

%


Maybe there is some issues with the first message line. Well, I removed
it (don't know why I am using it) and now all works again.

Thanks,

JHissa
the line
Fatal fontspec error: "cannot-use-pdftex"
cones from fontspec, perhaps a package that you include now loads fontspec.
Show the log file or terminal output from running pdflatex on your document.
it will have an open bracket (...path/to/fontspec.sty and looking for the
preceding open brackets will show which file you are including has
included fontspec.
David
Post by David Carlisle
Post by José Hissa Ferreira
This error message is wrong because I am using pdflatex to compile.
The error message is because you used pdflatex.
You have included the fontspec package, and that requires xelatex or
lualatex and does not work with pdflatex.
David
David, I did not include the fontspec package. Please note that I did get
that error just after I updated texlive today
JHissa
Ulrike Fischer
2017-04-11 20:43:10 UTC
Permalink
but not directly. It works fine in a small document:

\documentclass{article}
\usepackage{dantelogo}
\begin{document}
xxx

\end{document}

It is possible to fool the test in dsntelogo, but it must be done by
some code before the package.
--
Ulrike Fischer
http://www.troubleshooting-tex.de/
Loading...