# LaTeX \mathcal{w} has strange printout

The follwing LaTex lines don't print out what I hope to see:

calculate $\rho_i^{t} = \| \mathcal{w}_{i}^{t} - \mathcal{w}_{i}^{t-1} \|_2$


what I get instead of the two w is that:

Thank you!

• Welcome to TeX.SX! Please help us (and also you) and add a minimal working example (MWE), that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass and ending with \end{document}. – Bobyandbob Apr 24 '18 at 7:04

That's because the font does not have lowercase characters. This is also documented in the TeXbook (in plain TeX you get the effect of \mathcal using \cal).

For example, ‘$\cal A$’ produces ‘𝒜‘ and ‘$\cal Z$‘ produces ‘𝒵’. But beware: This works only with the letters A to Z; you'll get weird results if you apply \cal to lowercase or Greek letters.

As you can see from the symbols table below, there are other characters encoded in the slots where lowercase usually is (w maps to slot 119).

That being said, some Unicode math fonts have a lowercase script alphabet, e.g. XITS Math. The Unicode version of Latin Modern unfortunately does not have a lowercase script alphabet.

\documentclass{article}
\usepackage{unicode-math}
\setmathfont{XITS Math}
\begin{document}
$\rho_i^{t} = \| \mathscr{w}_{i}^{t} - \mathscr{w}_{i}^{t-1} \|_2$
\end{document}


• Wonderful, thank you. I used now \mathit{w}. Looks also pretty satisfactorily. – Felix Laumann Apr 24 '18 at 6:42
• @FelixLaumann Instead of \mathit{w} you can also just use plain w. The font should be the same. The only difference is that \mathit enables character kerning (compare \mathit{ff} and ff), i.e. it is to be used for actual words. – Henri Menke Apr 24 '18 at 6:46
• @HenriMenke or rather \mathit is wrong, it uses the text italic font (so multi-letter identifiers work) w on its own will use math italic (which typically has wider sidebearings, and potentially different character shapes) – David Carlisle Apr 24 '18 at 7:08