1

I used 4 lines code from this answer

chapter-number-and-chapter-title-in-one-line

Mathematica graphics

Which works very well as is. I just changed to new font, and find now I get strange error. When I remove the new font package, the error goes away. This is all with lualatex. I only use lualatex. I followed instructions on using the font from http://www.tug.dk/FontCatalogue/urwschoolbookl/

Mathematica graphics

And ended up with this MWE

\documentclass[chapterprefix=false]{scrbook}

\makeatletter
\renewcommand*{\chapterformat}{%
  \mbox{\chapapp~\thechapter\autodot:\enskip}%
}
\makeatother    

\IfFileExists{luatex85.sty}{\usepackage{luatex85}}{}
\usepackage{fontspec}
\usepackage{amssymb}

\usepackage{fouriernc}  %added this per instructions
\usepackage[T1]{fontenc} %added this per instructions

\begin{document}
\chapter{test}
test
\end{document}

Compiled

lualatex foo.tex 
This is LuaTeX, Version 0.95.0 (TeX Live 2016) 
 restricted system commands enabled.
(./foo.tex
LaTeX2e <2016/03/31> patch level 2
Babel <3.9r> and hyphenation patterns for 1 language(s) loaded.
(/usr/local/texlive/2016/texmf-dist/tex/latex/koma-script/scrbook.cls
Document Class: scrbook 2016/06/14 v3.21 KOMA-Script document class (book)
(/usr/local/texlive/2016/texmf-dist/tex/latex/koma-script/scrkbase.sty
(/usr/local/texlive/2016/texmf-dist/tex/latex/koma-script/scrbase.sty
(/usr/local/texlive/2016/texmf-dist/scripts/oberdiek/oberdiek.luatex.lua)))
(/usr/local/texlive/2016/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
chapter 1.
(/usr/local/texlive/2016/texmf-dist/tex/latex/lm/t1lmss.fd)
...................
! LaTeX Error: Command \nobreakspace unavailable in encoding T1.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.17 \chapter{test}                     
? 

The error goes away when removing both these lines

 \usepackage{fouriernc}  %added this
 \usepackage[T1]{fontenc} %added this

Or by keeping the above 2 lines, but removing makeatletter.... stuff. So this below works:

\documentclass[chapterprefix=false]{scrbook}%ext        
\IfFileExists{luatex85.sty}{\usepackage{luatex85}}{}
\usepackage{fontspec}
\usepackage{amssymb}

\usepackage{fouriernc}  %added this
\usepackage[T1]{fontenc} %added this

\begin{document}
\chapter{test}
test
\end{document}

No error. The question is: Can one keep

\makeatletter
\renewcommand*{\chapterformat}{%
  \mbox{\chapapp~\thechapter\autodot:\enskip}%
}
\makeatother 

in the above and not get this error? Using TL 2016 on Linux. Here is file list

*File List*
 scrbook.cls    2016/06/14 v3.21 KOMA-Script document class (book)
scrkbase.sty    2016/06/14 v3.21 KOMA-Script package (KOMA-Script-dependent bas
ics and keyval usage)
 scrbase.sty    2016/06/14 v3.21 KOMA-Script package (KOMA-Script-independent b
asics and keyval usage)
  keyval.sty    2014/10/28 v1.15 key=value parser (DPC)
scrlfile.sty    2016/06/14 v3.21 KOMA-Script package (loading files)
tocbasic.sty    2016/06/14 v3.21 KOMA-Script package (handling toc-files)
scrsize11pt.clo    2016/06/14 v3.21 KOMA-Script font size class option (11pt)
typearea.sty    2016/06/14 v3.21 KOMA-Script package (type area)
luatex85.sty    2016/06/15 v1.4 pdftex aliases for luatex
fontspec.sty    2016/02/01 v2.5a Font selection for XeLaTeX and LuaLaTeX
   expl3.sty    2016/05/18 v6512 L3 programming layer (loader) 
expl3-code.tex    2016/05/18 v6512 L3 programming layer 
l3pdfmode.def    2016/03/26 v6465 L3 Experimental driver: PDF mode
  xparse.sty    2016/05/18 v6512 L3 Experimental document command parser
luaotfload.sty    2016/06/16 v2.7 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 oth
er 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)
graphics.sty    2016/07/10 v1.0t Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    2016/01/03 v1.10 sin cos tan (DPC)
graphics.cfg    2016/06/04 v1.11 sample graphics configuration
  luatex.def    2016/07/11 v0.01f Graphics/Color for luaTeX
infwarerr.sty    2016/05/16 v1.4 Providing info/warning/error messages (HO)
 ltxcmds.sty    2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
fontspec.cfg
 amssymb.sty    2013/01/14 v3.01 AMS font symbols
amsfonts.sty    2013/01/14 v3.01 Basic AMSFonts support
fouriernc.sty    2005/12/20 1.0 fouriernc package
 fourier.sty    2005/01/01 1.4 fourier-GUTenberg package
 fontenc.sty
   t1enc.def    2016/06/19 v1.99m Standard LaTeX file
   t1lmr.fd    2009/10/30 v1.6 Font defs for Latin Modern
textcomp.sty    2016/06/19 v1.99m Standard LaTeX package
  ts1enc.def    2001/06/05 v3.0e (jk/car/fm) Standard LaTeX file
fourier-orns.sty    2004/01/30 1.1 fourier-ornaments package
 fontenc.sty
   t1enc.def    2016/06/19 v1.99m Standard LaTeX file
   t3cmr.fd    2001/12/31 TIPA font definitions
fmlfncmi.fd    2005/12/20 Fontinst v1.928 font definitions for FML/fncmi.
 fmsfncm.fd    2005/12/20 Fontinst v1.928 font definitions for FMS/fncm.
 fmxfutm.fd    futm-extension
  ts1cmr.fd    2014/09/29 v2.5h Standard LaTeX font definitions
   t1fnc.fd    2005/12/13 scaled font definitions for T1/fnc.
supp-pdf.mkii
epstopdf-base.sty    2016/05/15 v2.6 Base part for package epstopdf
  grfext.sty    2016/05/16 v1.2 Manage graphics extensions (HO)
kvdefinekeys.sty    2016/05/16 v1.4 Define keys (HO)
kvoptions.sty    2016/05/16 v3.12 Key value format for package options (HO)
kvsetkeys.sty    2016/05/16 v1.17 Key value parser (HO)
etexcmds.sty    2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO)
ifluatex.sty    2016/05/16 v1.4 Provides the ifluatex switch (HO)
pdftexcmds.sty    2016/05/21 v0.22 Utility functions of pdfTeX for LuaTeX (HO)
   ifpdf.sty    2016/05/14 v3.1 Provides the ifpdf switch
luatex-loader.sty    2016/05/16 v0.6 Lua module loader (HO)
epstopdf-sys.cfg    2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live
  t1lmss.fd    2009/10/30 v1.6 Font defs for Latin Modern
 ***********

ps. I know \usepackage[T1]{fontenc} is not needed with new lualatex? but instructions said to add it.

1 Answer 1

4

I see no reason whatsoever for loading fontspec along with fouriernc, that relies on legacy fonts.

Loading luainputenc should guarantee equal results as with pdflatex.

\documentclass[chapterprefix=false]{scrbook}
\usepackage{luatex85}

\usepackage[T1]{fontenc}
\usepackage[utf8]{luainputenc}
\usepackage{fouriernc}

\begin{document}

\chapter{test}

test Münchener-Straße

\end{document}

enter image description here

If your aim is using fouriernc in math, then you can use TeX Gyre Schola as text font:

\documentclass[chapterprefix=false]{scrbook}
\usepackage{luatex85}

\usepackage{fouriernc}  % for math
\usepackage[no-math]{fontspec}
\setmainfont{TeX Gyre Schola}[Scale=0.95]

\begin{document}

\chapter{test}

test Münchener-Straße $a+b=\sum_{i=1}^n x_i\sin y$

\end{document}

enter image description here

Of course you can also use unicode-math:

\documentclass[chapterprefix=false]{scrbook}
\usepackage{luatex85}

\usepackage{unicode-math}
\setmainfont{TeX Gyre Schola}[Scale=0.95]
\setmathfont{TeX Gyre Schola Math}[Scale=0.95]

\begin{document}

\chapter{test}

test Münchener-Straße $a+b=\sum_{i=1}^n x_i\sin y$

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .