[Tex/LaTex] make math symbol italic

italicmath-modesymbols

I must admit that I don't really know my way around LaTeX, pretty much at all. Anyway, here's my problem:

I want to include the symbols \flat and \sharp in my text. Unfortunately I only receive errors when I put them in like that. So I declared this somewhere

\newcommand{\vb}{\ensuremath{\flat}}

and it works quite well. Unfortunately I need my text with this symbol always in italics. So when I write B\vb (in italics) the B and the flat sign will intersect.

Is there any way I can force the flat sign to be italicised?

Best Answer

The italic flat isn't prepared in the fonts. But if you really need it and you are using pdfTeX with direct output to PDF then you can try this:

\def\flatit{\setbox0=\hbox{$\flat$}%
   \pdfliteral{q 1 0 .3 1 0 0 cm}\rlap{$\flat$}\pdfliteral{Q}\kern\wd0 }

{\it B\flatit C}

sharp

If you are not using pdfTeX with direct PDF output but you create PDF via (x)dvipdfm(x) (XeTeX chooses this way) then you can add the following definition:

\def\pdfliteral#1{\special{pdf:literal #1}}