I know that this is a quite common question, but looking for many threads about undefined font shape I didn't find any solution...
When I compile my document with lualatex I get 5 different warnings related to undefined font shapes substituted.
LaTeX Font Warning: Font shape `TU/lmr/bx/sc' undefined
(Font) using `TU/lmr/bx/n' instead on input line 14.
--
LaTeX Font Warning: Font shape `TU/lmroman12-italic.otf(0)/bx/n' undefined
(Font) using `TU/lmroman12-italic.otf(0)/m/n' instead on input line
--
LaTeX Font Warning: Font shape `TU/lmroman12-italic.otf(0)/m/it' undefined
(Font) using `TU/lmroman12-italic.otf(0)/m/n' instead on input line
--
LaTeX Font Warning: Font shape `TU/lmroman12-italic.otf(0)/bx/it' undefined
(Font) using `TU/lmroman12-italic.otf(0)/bx/n' instead on input lin
--
LaTeX Font Warning: Font shape `TU/cmr/m/n' undefined
(Font) using `TU/lmr/m/n' instead on input line 25.
--
LaTeX Font Warning: Some font shapes were not available, defaults substituted.
Below is the minimal working example with my five warnings. Actually, I think there are 3 different error sources:
- a first one related to
lmodernpackage: I believed thatlmrincludes maaaaany font shapes, in particular, all variations withlf/md/bfandup/it/sl/scshapes ; - the second one related to the way I define the font used for foreign language (maybe it's not the right place for this problem) ;
- a third one related to the use of
cmrby the gnuplot cairolatex output.
Well, I'm interested in any idea to solve any of these problems.
\documentclass{memoir}
% Font packages
\usepackage{lmodern} % serif
% Define language
\usepackage{polyglossia}
\setmainlanguage[]{french}
\setotherlanguage[]{english}
% Define english font
\newfontfamily{\englishfont}{lmroman12-italic.otf} % Use italic font for foreign language
\begin{document}
\textsc{\textbf{TU/lmr/bx/sc $\to$ TU/lmr/bx/n}}
\textenglish{\textbf{TU/lmroman12-italic.otf(0)/bx/n $\to$ TU/lmroman12-italic.otf(0)/m/n}}
\textenglish{\textit{TU/lmroman12-italic.otf(0)/m/it $\to$ TU/lmroman12-italic.otf(0)/m/n}}
\textenglish{\textit{\textbf{TU/lmroman12-italic.otf(0)/bx/it $\to$ TU/lmroman12-italic.otf(0)/bx/n}}}
% Used including gnuplot cairolatex plots
\begingroup
\fontfamily{cmr}%
\selectfont
TU/cmr/m/n $\to$ TU/lmr/m/n
\endgroup
\end{document}

\textenglish{}to be italic by default, you could redefine\textenglishor patch it like the following:\usepackage{etoolbox} \pretocmd{\textenglish}{\itshape}{}{}instead. As forcmr, it haven't TU encoding support, heh. – Sergei Golovan Aug 10 '17 at 08:49lmodernhas no consequence on text fonts, because its settings would be overridden byfontspec; it still provides the setup for math fonts, though. – egreg Aug 10 '17 at 09:06\englishfontis the recommended way for polyglossia. Btw I managed to do what I want with this definition: – AlexisBRENON Aug 10 '17 at 10:49\let\englishfont\itshapeshould be enough! See my edited answer – Aug 10 '17 at 12:01