# {newunicodechar} + \chapter{} produces two font-related warnings

I get 2 warnings when I compile the MWE. The warnings are:

Warning 1: ./cuba.tex:13: Font shape EU1/EversonMono(0)/bx/n' undefined(Font) using EU1/EversonMono(0)/m/n' instead on input line 13.Font shape EU1/EversonMono(0)/bx/n' undefined(Font) using EU1/EversonMono(0)/m/n' instead

Warning 2: ./cuba.tex:0: Some font shapes were not available, defaults substituted.

My question is: How do I solve the warnings?

Information:

1. I am using the {scrbook} document class and compiling using XeLaTeX.

2. The character "⸱" is "Word Separator Middle Dot". Its Unicode is U+2E31.

It has the regular (Everson Mono), bold (Everson Mono Bold), italic (Everson Mono Oblique), and bold italic (Everson Mono Bold Oblique).

1. The MWE:

\documentclass{scrbook}

\usepackage{fontspec}

\usepackage{newunicodechar}
\newfontface{\emr}{Everson Mono}% emr -- Everson Mono (regular)
\newunicodechar{⸱}{\emr{⸱}}

\newcommand{\titik}{\emr{⸱}}

\begin{document}

\chapter{Manusia (ma{\titik}nu{\titik}sia)}

Manusia (ma{\titik}nu{\titik}sia).

\end{document}

2. I use the \newcommand to make the MWE easier to read (for me at least) and also I will be using this Unicode often in the original document.

With \newfontface you don't define a command that changes fonts respecting the current conditions. You may want that the \titik symbol doesn't respect a bold face condition, but the main problem is how you define it. It should be

\newfontface{\emr}{Everson Mono}% emr -- Everson Mono (regular)
\newunicodechar{⸱}{{\normalfont\emr ⸱}}

\newcommand{\titik}{⸱}


What you did selects the \emr font for the rest of the section title (or until the current group ends.

If you want that \titik respects bold face or italic declarations, use

\newfontfamily{\emr}{Everson Mono}% emr -- Everson Mono (regular)
\newunicodechar{⸱}{{\emr ⸱}}

\newcommand{\titik}{⸱}


What's the difference between \newfontfamily and \newfontface? The former command will set up a complete font family (based on the font name and the available shapes or based on the directive the user adds manually). The latter defines a “fixed” font, which can only change size.

Thus with \newfontface{\emr}{Everson Mono} you just define \emr to choose the regular version of the font, independently of the context, but you will get warnings about not defined font shapes (what you experienced). To the contrary, if you use \newfontfamily and issue \emr in a context where boldface is active, you will get Everson Mono Bold.

In both cases, \emr is a declaration that tells TeX to use the font until the current group ends. So if you want to use \titik with your definition, you need to add braces around it to limit the scope.

The defined command is similar to \itshape or \bfseries, which are not commands with an argument.

If you want to define a command with argument, after defining the font family or face named \emr, you can do

\DeclareTextFontCommand{\textemr}{\emr}


and after this \textemr{text} will typeset text in Everson Mono.

• I think I can sort of understand what you are explaining though with much difficulty as I don't know what \newfontface and \newfontfamily are or what they do, also what I did wrong (although I can see where I went wrong). I'll try to read up about them. Thank you for the super fast help! <3 – Gula Kapas May 4 '18 at 17:32