I would like to use non-TeX fonts in LyX. To do this, I use the Document->Setting->Use non-TeX fonts setting. This setting causes LyX to insert the \usepackage{fontspec} statement automatically into the preamble. However, I would like to load the fontspec with specific options. I have tried to do \usepackage[LY1,T1]{fontspec} for example. Even with this LyX still does \usepackage{fontspec} and I end up with two statements which both load fontspec in the preamble. I have tried using the command Provides fontspec 1 in the layout file in the hope that LyX would not load fontspec automatically. It still does. What is interesting is that LyX does the automatic package loading on a line that precedes the one on which I ask it to load fontspec with specified options.
Does somebody have an idea of how I could condition LyX to let me load fontspec with the required options without it loading fontspec automatically?
fontspecis a xelatex and lualatex specific package that does not work with latex or pdflatex and does not take options such asLY1orT1are you thinking offontenc(which does take those options) ? – David Carlisle Sep 08 '14 at 20:00\PassOptionsToPackage{<options>}{<package>}before the package is loaded. This may be possible in LyX using "ERT"; just a matter of making sure this code comes before LyX loads the package in question. – Paul Gessler Sep 08 '14 at 20:09fontspecand not to loadfontenc. You can use LuaLaTeX or XeLaTeX withoutfontspecbut I can't think why you would wish to. – cfr Sep 09 '14 at 00:05