Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
    
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. –  Steven B. Segletes Oct 2 '13 at 12:25
    
@StevenB.Segletes Done. –  Earthliŋ Oct 2 '13 at 12:34
add comment

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer
    
This works perfectly (I used + to give a more reasonable size for the star). Thank you very much. –  Earthliŋ Oct 3 '13 at 23:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.