# fontspec: Defining a new font family using TeX Gyre Pagella causes error [closed]

I just updated my packages through the MikTeX console, and when I try to define a new font family with TeX Gyre Pagella, I get a mysterious error (below). Just defining the new font family leads to the error; it's not necessary to use it anywhere. Commenting out the \newfontfamily macro or replacing TeX Gyre Pagella with something else allows it to compile. This did not occur before the update just now.

MWE:

\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage{fontspec}
\newfontfamily{\myfamily}{TeX Gyre Pagella}
% Comment out or replace with Times New Roman to compile

\begin{document}
\end{document}


Runaway argument? 76543210\q_stop end \exp_args:NNf \group_end: \iow_log:n {\tl_to_str:N \ETC. ! File ended while scanning use of \__iow_wrap_end_chunk:w. <inserted text> \par <*> ./test.tex

Any ideas? (Also, I'm not entirely sure if I need fontenc here, but the same error happens even without including it.)

## closed as off-topic by egreg, Romain Picot, Stefan Pinnow, Bobyandbob, Phelype OleinikOct 23 '18 at 10:35

• This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

• Oh, I should also mention that setting the main font to TeX Gyre Pagella with \setmainfont works fine. It's only defining a new font family with it that causes the issue. – Jigsaw Oct 23 '18 at 1:26
• – Thérèse Oct 23 '18 at 1:29
• I'm voting to close this question as off-topic because the issue is due to a bug that has already been removed – egreg Oct 23 '18 at 8:44
• @egreg On one hand I agree that this question is off-topic since it is about a resolved bug, on the other hand it might be useful for MikTeX users to leave the question open until the update arrives in MikTeX. – moewe Oct 23 '18 at 9:59

Edit: As of 2018-10-24 0:00 midnight (EST, may be earlier), the 2018-10-19 l3kernel has made its way to MiKTeX, so additional tweaking is no longer nessessary.

Old answer if you are using the 2018-10-17 l3kernel: MiKTeX was really late updating a bug fix from the l3kernel package. So we must wait until MiKTeX updates its repository.

In the mean time, since there were only two lines of code changed, you could

1. Go to your local directory: C:\Program Files\MiKTeX 2.9\tex\latex\l3kernel.
2. Copy the file expl3-code.tex.
3. Paste it into your working directory.
4. Replace line 10665

\or: \use_none:nnnnnnn


with this line

\or: \__iow_wrap_line_seven:nnnnnnn

\cs_new:Npn \__iow_wrap_line_seven:nnnnnnn #1#2#3#4#5#6#7 { \exp_stop_f: }

\cs_new:Npn \__iow_wrap_line_end:NnnnnnnnN #1#2#3#4#5#6#7#8#9 % <- So this becomes line 10670

This is how I get around using packages affected by the 2018-10-17 l3kernel update. As soon as MiKTeX has the 2018-10-19 l3kernel update, everything should be back to normal.