0

When I try to use the IBMPlexSans medium or semibold font weights with the plex package, I get an error like this:

Font shape `TU/IBMPlexSans(0)/mb/n' undefined

The map file for the font is installed and I have updated the sysmap with the command:

sudo mktexlsr

sudo updmap-sys

I have also verified that I have the font installed, including medium and semibold weights. In the log file for the compiled pdf I can see that these weights aren't loaded in.

Package fontspec Info: IBMPlexSans-Regular scale = 1.

Package fontspec Info: IBMPlexSans-Regular scale = 1.

luaotfload | aux : font no 20 (nil) does not define feature smcp for script latn with language dflt

Package fontspec Info: IBMPlexSans-Bold scale = 1.

luaotfload | aux : font no 21 (nil) does not define feature smcp for script latn with language dflt

Package fontspec Info: IBMPlexSans-Italic scale = 1.

luaotfload | aux : font no 22 (nil) does not define feature smcp for script latn with language dflt

Package fontspec Info: IBMPlexSans-BoldItalic scale = 1.

luaotfload | aux : font no 23 (nil) does not define feature smcp for script latn with language dflt

Package fontspec Info: Font family 'IBMPlexSans(0)' created for font (fontspec) 'IBMPlexSans' with options [Ligatures = TeX,Scale = (fontspec) 1,Extension = .otf,Ligatures=TeX,UprightFont = (fontspec)
*-Regular,ItalicFont = *-Italic,BoldFont = (fontspec) *-Bold,BoldItalicFont = *-BoldItalic]. (fontspec) (fontspec) This font family consists of the following NFSS (fontspec) series/shapes: (fontspec)
(fontspec) - 'normal' (m/n) with NFSS spec.:

(fontspec)
<->s*[1]"[IBMPlexSans-Regular.otf]:mode=node;script=latn ;language=dflt;+tlig;"

(fontspec) - 'small caps' (m/sc) with NFSS spec.: (fontspec) - 'bold' (b/n) with NFSS spec.:

(fontspec)
<->s*[1]"[IBMPlexSans-Bold.otf]:mode=node;script=latn;language=dflt;+tlig;"

(fontspec) - 'bold small caps' (b/sc) with NFSS spec.: (fontspec) - 'italic' (m/it) with NFSS spec.:

(fontspec)
<->s*[1]"[IBMPlexSans-Italic.otf]:mode=node;script=latn;language=dflt;+tlig;"

(fontspec) - 'italic small caps' (m/scit) with NFSS spec.: (fontspec) - 'bold italic' (b/it) with NFSS spec.:

(fontspec)
<->s*[1]"[IBMPlexSans-BoldItalic.otf]:mode=node;script=latn;language=dflt;+tlig;"

(fontspec) - 'bold italic small caps' (b/scit) with NFSS spec.:

Does anyone have an idea of how I can fix this and use medium/semibold weights?

3
  • Welcome to TeX.SE. Commented Feb 14 at 14:05
  • 3
    Can you please add a small example of code? It's important how you load the font. Commented Feb 14 at 14:12
  • where does that mb come from? that should never be requested as it is disallowed and the m or b has to get dropped. Commented Feb 14 at 17:20

2 Answers 2

2
\documentclass{article} \usepackage{plex-otf} \begin{document} \noindent \slshapeRM Slanted Serif\\ \PlexExtraLightRM Extra Light Serif\\ \PlexLightRM Light Serif\\ \PlexThinRM Thin Serif\\ \PlexMediumRM Medium Serif\\ \PlexTextRM Text Serif \\ \PlexSemiBoldRM Bold Serif \slshapeSS Slanted Sans Serif\\ \PlexExtraLightSS Extra Light Sans Serif\\ \PlexLightSS Light Sans Serif\\ \PlexThinSS Thin Sans Serif\\ \PlexMediumSS Medium Sans Serif\\ \PlexTextSS Text Sans Serif\\ \PlexSemiBoldSS SemiBold Sans Serif \sffamilyCon Sans Serif Condensed\\ \slshapeSScon Slanted Sans Serif Condensed\\ \PlexExtraLightSScon ExtraLight Sans Serif Condensed\\ \PlexLightSScon Light Sans Serif Condensed\\ \PlexThinSScon Thin Sans Serif Condensed\\ \PlexMediumSScon Medium Sans Serif Condensed\\ \PlexTextSScon Text Sans Serif Condensed\\ \PlexSemiBoldSScon Bold Sans Serif Condensed\\ \slshapeTT Slanted Mono\\ \PlexExtraLightTT ExtraLight Mono\\ \PlexLightTT Light Mono\\ \PlexThinTT Thin Mono\\ \PlexMediumTT Medium Mono\\ \PlexTextTT Text Mono\\ \PlexSemiBoldTT Bold Mono \end{document} 

enter image description here

See documentation for setting the optional values!

2
  • it would be better not to use \\ for line breaking here, I think? Commented Feb 14 at 17:21
  • Thanks, this worked! (using the plex-otf package, not plex) Commented Feb 14 at 21:43
1

By default, \setmainfont and \setsansfont only define the standard four weight/shape combinations.

You can add your own.

\documentclass{article} \usepackage{fontspec} \setmainfont{IBMPlexSerif}[ Extension=.otf, UprightFont=*-Regular, ItalicFont=*-Italic, BoldFont=*-Bold, BoldItalicFont=*-BoldItalic, FontFace={l}{n}{*-Light}, FontFace={l}{it}{*-Italic}, FontFace={el}{n}{*-ExtraLight}, FontFace={el}{it}{*-ExtraLightItalic}, FontFace={md}{n}{*-Medium}, FontFace={md}{it}{*-MediumItalic}, FontFace={sb}{n}{*-SemiBold}, FontFace={sb}{it}{*-SemiBoldItalic}, FontFace={tx}{n}{*-Text}, FontFace={tx}{it}{*-TextItalic}, FontFace={th}{n}{*-Thin}, FontFace={th}{it}{*-ThinItalic}, ] \setsansfont{IBMPlexSans}[ Extension=.otf, UprightFont=*-Regular, ItalicFont=*-Italic, BoldFont=*-Bold, BoldItalicFont=*-BoldItalic, FontFace={l}{n}{*-Light}, FontFace={l}{it}{*-Italic}, FontFace={el}{n}{*-ExtraLight}, FontFace={el}{it}{*-ExtraLightItalic}, FontFace={md}{n}{*-Medium}, FontFace={md}{it}{*-MediumItalic}, FontFace={sb}{n}{*-SemiBold}, FontFace={sb}{it}{*-SemiBoldItalic}, FontFace={tx}{n}{*-Text}, FontFace={tx}{it}{*-TextItalic}, FontFace={th}{n}{*-Thin}, FontFace={th}{it}{*-ThinItalic}, ] \NewDocumentCommand{\fontvar}{smm}{% {\fontseries{#2}\fontshape{\IfBooleanTF{#1}{it}{n}}\selectfont#3}% } \begin{document} SERIF Normal, \textit{Italic}, \textbf{Bold}, \textbf{\textit{Bold Italic}} \fontvar{l}{Light}, \fontvar*{l}{Light Italic} \fontvar{el}{Extra Light}, \fontvar*{el}{Extra Light Italic} \fontvar{md}{Medium}, \fontvar*{md}{Medium Italic} \fontvar{sb}{Semibold}, \fontvar*{sb}{Semibold Italic} \fontvar{tx}{Text}, \fontvar*{tx}{Text Italic} \fontvar{th}{Thin}, \fontvar*{th}{Thin Italic} \bigskip {\sffamily SANS Normal, \textit{Italic}, \textbf{Bold}, \textbf{\textit{Bold Italic}} \fontvar{l}{Light}, \fontvar*{l}{Light Italic} \fontvar{el}{Extra Light}, \fontvar*{el}{Extra Light Italic} \fontvar{md}{Medium}, \fontvar*{md}{Medium Italic} \fontvar{sb}{Semibold}, \fontvar*{sb}{Semibold Italic} \fontvar{tx}{Text}, \fontvar*{tx}{Text Italic} \fontvar{th}{Thin}, \fontvar*{th}{Thin Italic} } \end{document} 

output

However, mixing several of these combination would be quite confusing.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.