TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am not an expert in LaTeX, but I was writing a paper, everything was going fine, until it suddenly crashed giving me the error:

The fontspec package requires either XeTeX or LuaTeX to function.

share|improve this question

closed as too localized by lockstep, Stefan Kottwitz Oct 18 '12 at 12:20

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

That means that you have to use xelatex <document> or lualatex <document> instead of pdflatex <document> to compile your document if you want to use the fontspec package. For some background, try tex.stackexchange.com/q/36/86 – Loop Space Oct 4 '12 at 8:49
Welcome to TeX.sx! Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Upvoting is the preferred way here to say "thank you" to users who helped you. – Stephen Oct 4 '12 at 9:16
This can't have happened suddenly. Either you changed how you compile your document (now using pdflatex instead of xelatex for example) or you added fontspec explicitly or a package that loads fontspec implicitly. – clemens Oct 4 '12 at 11:07
As the error message said, LuaLaTeX or XeLaTeX should be used. Probably it wasn't the case. Since no further information was given, the question will now be closed as too localized. – Stefan Kottwitz Oct 18 '12 at 12:20
@Stefan I tried compile a document with XeLaTeX and got this warning. – Tyson Williams Aug 8 '13 at 20:26