[lltx] fontspec/keyval clash

Reinhard Kotucha reinhard.kotucha at web.de
Sat Dec 29 01:10:53 CET 2012


On 2012-12-28 at 09:44:27 +0100, Heiko Oberdiek wrote:

 > On Fri, Dec 28, 2012 at 04:23:39AM +0100, Reinhard Kotucha wrote:
 > 
 > > the following works with LuaTeX:
 > > 
 > >  \documentclass{minimal}
 > >  \RequirePackage[final]{graphicx}
 > >  \RequirePackage{fontspec}
 > >  \stop
 > > 
 > > However, if load fontspec before graphicx 
 > > 
 > >  \documentclass{minimal}
 > >  \RequirePackage{fontspec}
 > >  \RequirePackage[final]{graphicx}
 > >  \stop
 > > 
 > > I get
 > > 
 > >   ! LaTeX Error: Option clash for package graphicx.
 > > 
 > > It seems that fontspec screws up the keyval package somehow.
 > 
 > It's unrelated to package `keyval'.
 > 
 > Package `fontspec' loads package `xunicode' and the latter package
 > requires `graphicx'. Then, if LaTeX gets another package loading
 > request of a package that is already loaded, then it checks the
 > options. The specified options must be a subset of the options that
 > are present at loading time. Otherwise LaTeX throws the option
 > clash error.

Thank you very much, Heiko,
I never expected that a font related package loads graphicx.  That's
why I thought that keyval is the culprit.

Regards,
  Reinhard


 >   \RequirePackage{graphicx}
 >   \RequirePackage[final]{graphicx}% --> error
 > 
 > Solution: The first loading of the package needs all options:
 > 
 >   \RequirePackage[final]{graphicx}
 >   \RequirePackage{graphicx}% --> ok
 > 
 > Or in this case, \PassOptionsToPackage helps:
 > 
 >   \PassOptionsToPackage{final}{graphicx}
 >   \RequirePackage{graphicx}% inside fontspec/xunicode
 >   \RequirePackage[final]{graphicx}% --> now ok
 > 
 > Yours sincerely
 >   Heiko Oberdiek

-- 
----------------------------------------------------------------------------
Reinhard Kotucha                                      Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover                              mailto:reinhard.kotucha at web.de
----------------------------------------------------------------------------
Microsoft isn't the answer. Microsoft is the question, and the answer is NO.
----------------------------------------------------------------------------


More information about the lualatex-dev mailing list