2

I am wondering what I am doing wrong. I am using LuaLaTeX and trying to load the kpfonts. I understand the math version of this font supports bold math. But when I use symbf I don't get the expected result. A comparison of the bold versus regular math versions is shown below. The bold looks upright/regular. I don't know why, it doesn't quite look right. Or is my intuition wrong here? Am I specifying bold incorrectly?

Note when I compile this I do get the warning Some font shapes were not available, defaults substituted. Might this mean the bold math is actually missing and some type of upright substitute gets put in its place?

bold-comp

Here is the code.

\documentclass[11pt,letterpaper]{article}

\usepackage{fontspec}
\usepackage{unicode-math}

\setmainfont[Path=fonts/serif/]{KpRoman}[
    Extension = .otf,
    UprightFont = *-Regular,
    BoldFont = *-Bold,
    ItalicFont = *-Italic,
    BoldItalicFont = *-BoldItalic
]
\setsansfont[Path=fonts/sans_serif/]{KpSans}[
    Extension = .otf,
    UprightFont = *-Regular,
    BoldFont = *-Bold,
    ItalicFont = *-Italic,
    BoldItalicFont = *-BoldItalic
]

\setmathfont[Path=fonts/math/]{KpMath-Regular}[
    Extension = .otf,
    BoldFont = KpMath-Bold,
]

\begin{document}

\[
    \phi = \int f(x) x dx
\]

\[
    \symbf{\phi = \int f(x) x dx}
\]

\end{document}

2
  • symbf (like mathbf) is upright bold. use symbfit (around each character) Commented Jun 11, 2023 at 23:13
  • but symxx uses the same font to use the bold font use \boldmath before the equation Commented Jun 11, 2023 at 23:24

1 Answer 1

4

enter image description here

\symbf is upright bold, you can use \symbfit for bold math italic, but both use characters from the Unicode math alphabets in the regular font.

As with classic latex, to access the bold math font use \boldmath before the equation. It appears the bold font is not a full math font and misses the bold math characters.

I removed the [Path=f options as they stop the example working if the fonts are installed in the usual texlive locations.

\documentclass[11pt,letterpaper]{article}

\usepackage{fontspec}
\usepackage{unicode-math}

\setmainfont{KpRoman}[
    Extension = .otf,
    UprightFont = *-Regular,
    BoldFont = *-Bold,
    ItalicFont = *-Italic,
    BoldItalicFont = *-BoldItalic
]
\setsansfont{KpSans}[
    Extension = .otf,
    UprightFont = *-Regular,
    BoldFont = *-Bold,
    ItalicFont = *-Italic,
    BoldItalicFont = *-BoldItalic
]

\setmathfont{KpMath-Regular}[
    Extension = .otf,
    BoldFont = KpMath-Bold,
]

\begin{document}

\[
    \phi = \int f(x) x\, dx
\]

\[
    \symbfit{\phi} = \int \symbfit{f}(\symbfit{x}) \symbfit{x}\, \symbfit{d}\symbfit{x}
\]

\boldmath

\[
    \phi = \int f(x) x\, dx
\]

\[
    \symbfit{\phi} = \int \symbfit{f}(\symbfit{x}) \symbfit{x}\, \symbfit{d}\symbfit{x}
\]

\end{document}
4
  • what is expected in the last equation? my understanding is that the letters should be in something like ultrabold, and that's right, these ultrabold glyphs are not provided by KpMath-Bold.otf. Am I missing something? Commented Jun 13, 2023 at 16:29
  • @DanielFlipo yes, or if designing ultrabold is too much, having the same bold alphabet as the regular font so you get something rather than nothing would be good I think. Commented Jun 13, 2023 at 16:34
  • OK, thanks, I'll add the regular (bold and bold italic) glyphs the next version. I do not think that having ultrabold is worth the pain. Commented Jun 13, 2023 at 19:02
  • @DanielFlipo thanks Commented Jun 13, 2023 at 19:43

You must log in to answer this question.

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