3

I am using the Baskervald font with KP fonts for the maths font. It is very nice, but it needs some manual fine-tuning.

For example, the \star command gives an (oversized) italic star, which should not happen. I figured I just redefine \star as

\renewcommand{\star}{\scalebox{.5}{\bigstar}}

but this doesn't seem to work (\star is used in display mode).

What is the correct command to resize a particular command in math mode?

Minimal example:

\documentclass{article}
\usepackage{amssymb,amsmath}
\usepackage{kpfonts,baskervald}

\begin{document}
\begin{align*}
  f\star g=fg+\hbar\{f,g\}\\
  f\bigstar g=fg+\hbar\{f,g\}
\end{align*}
\end{document}

\star is slanted, but \bigstar is not.

2
  • It would help for you to provide a complete minimum working example (MWE), beginning with \documentclass. For example, I do not get a big italic star with \star and \usepackage{baskervald}. So perhaps it is other packages you have loaded that are interacting with your font. It is why a complete MWE is usually needed. Commented Oct 2, 2013 at 12:25
  • @StevenB.Segletes Done.
    – Earthliŋ
    Commented Oct 2, 2013 at 12:34

1 Answer 1

5

In this case, I use \scalerel to replace the definition of \star with a \bigstar that is scaled to the same vertical footprint as the italic \star. I tried putting a \mathrel around it, but the spacing to the f seemed odd, so I took it out.

The nice thing about this scalerel approach is that it will work in smaller math styles, as well, as shown below.

\documentclass{article}
\usepackage{amssymb,amsmath}
\usepackage{kpfonts,baskervald}
\usepackage{scalerel}
\let\savestar\star
\renewcommand\star{{\scalerel*{\bigstar}{\savestar}}}
\begin{document}
\begin{align*}
  f\star g=fg+\hbar\{f,g\}\\
 \scriptstyle f\star g=fg+\hbar\{f,g\}
\end{align*}
\end{document}

enter image description here

as I said in my initial comment, loading just baskervald does not give an italic star. Rather, the problem originates in the kpfonts package. I get the same erroneous behavior loading just the kpfonts package. Alternately, if I try to load baskervald first, I get an option clash, which I presume is kpfonts complaining that baskervald already took control of \star and it wants it too.

1
  • This works perfectly (I used + to give a more reasonable size for the star). Thank you very much.
    – Earthliŋ
    Commented Oct 3, 2013 at 23:04

You must log in to answer this question.

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