[Tex/LaTex] fontspec package causes error

fontsfontspecxetex

For some reason the inclusion of the fontspec package causes XeLaTeX to not compile properly.

Here is an MWE (inspired by Rob Hyndman):

\documentclass{article}
\usepackage{lipsum,fontspec}

\begin{document}
\section{Introduction}
 \lipsum[1]

\section{Main}
 \lipsum[1]

\end{document}

If I remove the the fontspec package, everything works fine. With it, I get lots of errors and the resulting PDF has the following text on top:

require(’luaotfload-main’) local v oid = luaotfload.main()
require(”fontspec”)
EU2

The FileList in the .log file is:

 article.cls    2014/09/29 v1.4h Standard LaTeX document class
 size10.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
 lipsum.sty    2014/07/27 v1.3 150 paragraphs of Lorem Ipsum dummy text
fontspec.sty    2016/02/01 v2.5a Font selection for XeLaTeX and LuaLaTeX
  expl3.sty    2012/04/23 v3570 L3 Experimental code bundle wrapper
l3names.sty    2012/03/04 v3494 L3 Experimental namespace for primitives
l3bootstrap.sty    2011/12/29 v3110 L3 Experimental bootstrap code
   etex.sty    2016/01/11 v2.6 eTeX basic definition package (PEB,DPC)
  color.sty    2016/01/03 v1.1b Standard LaTeX Color (DPC)
  color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive
xetex.def    2015/09/11 v4.06 LaTeX color/graphics driver for XeTeX (TeX  Live/RRM/JK)    
infwarerr.sty    2010/04/08 v1.3 Providing info/warning/error messages (HO)
ltxcmds.sty    2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
 graphics.sty    2016/01/03 v1.0q Standard LaTeX Graphics (DPC,SPQR)
   trig.sty    2016/01/03 v1.10 sin cos tan (DPC)
graphics.cfg    2010/04/23 v1.9 graphics configuration of TeX Live
l3basics.sty    2012/03/04 v3491 L3 Experimental basic definitions
l3expan.sty    2012/02/26 v3460 L3 Experimental argument expansion
   l3tl.sty    2012/03/04 v3490 L3 Experimental token lists
  l3seq.sty    2012/03/04 v3490 L3 Experimental sequences and stacks
  l3int.sty    2012/03/04 v3490 L3 Experimental integers
l3quark.sty    2012/02/12 v3384 L3 Experimental quarks
  l3prg.sty    2012/03/04 v3490 L3 Experimental control structures
l3clist.sty    2012/03/04 v3490 L3 Experimental comma separated lists
l3token.sty    2012/03/04 v3491 L3 Experimental token manipulation
 l3prop.sty    2012/03/04 v3490 L3 Experimental property lists
  l3msg.sty    2012/04/23 v3568 L3 Experimental messages
 l3file.sty    2012/03/09 v3520 L3 Experimental file and I/O operations
 l3skip.sty    2012/03/05 v3499 L3 Experimental dimensions and skips
 l3keys.sty    2012/03/03 v3487 L3 Experimental key-value interfaces
   l3fp.sty    2012/03/04 v3490 L3 Experimental floating-point operations
  l3box.sty    2012/03/04 v3490 L3 Experimental boxes
l3coffins.sty    2012/03/03 v3482 L3 Experimental coffin code layer
l3color.sty    2011/09/07 v2776 L3 Experimental colour support
l3luatex.sty    2012/02/09 v3355 L3 Experimental LuaTeX-specific functions
 xparse.sty    2012/04/23 v3570 L3 Experimental document command parser
luaotfload.sty    2015/12/09 v2.6 OpenType layout system
fontspec-luatex.sty    2016/02/01 v2.5a Font selection for XeLaTeX and LuaLaTeX

fontenc.sty
 eu2enc.def    2010/05/27 v0.1h Experimental Unicode font encodings
 eu2lmr.fd    2009/10/30 v1.6 Font defs for Latin Modern
xunicode.sty    2011/09/09 v0.981 provides access to latin accents and many   other characters in Unicode lower plane
  eu2lmss.fd    2009/10/30 v1.6 Font defs for Latin Modern
  graphicx.sty    2014/10/28 v1.0g Enhanced LaTeX Graphics (DPC,SPQR)
  keyval.sty    2014/10/28 v1.15 key=value parser (DPC)
  fontspec.cfg
  t3cmr.fd    2001/12/31 TIPA font definitions

Best Answer

SOLVED: Based on egreg's comments about outdated packages involving l3packages and others, I uninstalled these packages in the package manager, and then deleted the subfolders of these packages from the MikTeX folder. Re-compiling now produces a perfect PDF (even when using \setmainfont{Georgia}).

Thanks everybody!

Related Question