Here's an minimal example file to demonstrate the problem:
\documentclass{letter}
\address{Mine}
\begin{document}
\begin{letter}{Foobar}
\opening{Dear Blah}
\pounds25
$\mathrm{\pounds}220$
\closing{Yours}
\end{letter}
\end{document}
Does anyone have a clue why this is happening and/or what might be an
elegant solution?
Rowland.
--
Remove the animal for email address: rowland....@dog.physics.org
PGP pub key 0x62DCCA78 Sorry - the spam got to me
http://www.mag-uk.org
UK biker? Join MAG and help keep bureaucracy at bay
For historical reasons, \pounds is defined both as
a text mode and a math mode command. Within \mathrm,
the "mathematical" variant is valid and prints an
italic pound symbol.
> and/or what might be an elegant solution?
Use the amstext package to force text mode within
a formula. (Well, this is perhaps not elegant ;-)
\usepackage{amstext}
...
$\text{\pounds}$
--
Walter
I don't know what's happening, but I'm surprised that \mathrm would be
any use. I always use \hbox{stuff} to get text inside math-mode. But
surely \textsterling was meant to overcome all this and work everywhere?
///Peter
> Rowland McDonnell wrote:
> > I've got a strange problem. I'd like to include a pound sterling sign
> > inside maths mode. I thought the obvious way to get this to work would
> > be to bung the symbol inside \mathrm. But when I try this, I find that
> > I get an italic pound symbol rather than an upright one, although a
> > request for a pound symbol outside maths mode gets an upright version.
>
> I don't know what's happening, but I'm surprised that \mathrm would be
> any use. I always use \hbox{stuff} to get text inside math-mode.
Any particular reason for that rather than \mbox or the LaTeX2e \textrm
construction?
> But
> surely \textsterling was meant to overcome all this and work everywhere?
It's not a valid command in maths mode.
> Rowland McDonnell schrieb:
> >
> > I've got a strange problem. I'd like to include a pound sterling sign
> > inside maths mode. I thought the obvious way to get this to work would
> > be to bung the symbol inside \mathrm. But when I try this, I find that
> > I get an italic pound symbol rather than an upright one[...]
> >
> > Does anyone have a clue why this is happening
>
> For historical reasons, \pounds is defined both as
> a text mode and a math mode command. Within \mathrm,
> the "mathematical" variant is valid and prints an
> italic pound symbol.
Ah!
> > and/or what might be an elegant solution?
>
> Use the amstext package to force text mode within
> a formula. (Well, this is perhaps not elegant ;-)
>
> \usepackage{amstext}
> ...
> $\text{\pounds}$
Hmm - thanks for the idea. I didn't know about amstext; seems like a
Good Thing.
The solution I used in the short term was an \mbox - but that feels
icky.
With \mbox, the font size will be wrong in superscripts,
subscripts or in-line fractions. Otherwise it's a valid
solution.
--
Walter Schmidt <http://home.vr-web.de/was/fonts>
____________________________________________________________
there's no sterling symbol in any ot1 encoding except italic ones;
latex makes use of the "upright italic" font to generate upright
sterling symbols in ot1 encoding.
so, as you can no doubt guess, \pounds _doesn't_ typically get set in
the current: in particular, \mathrm in your example has no effect
whatever, and the \pounds sign is trying to match itself to the
surrounding stuff (which is maths italic).
$\mbox{\pounds}$ seems to do what you're after.
i expect the amsmath bundle's \text command would have the same effect
(with the advantage that the result could be used in sub- and
superscripts :-)
--
Robin Fairbairns, Cambridge -- rf10 at cam dot ac dot uk
Just my ignorance :-)
Because I grew up with plain TeX and I rarely ever use mathematics.
>
>>But
>>surely \textsterling was meant to overcome all this and work everywhere?
>
>
> It's not a valid command in maths mode.
Grrr. Another bright idea bites the dust.
\newcommand{\sterling}{\ifmmode etc
///Peter
> [...]
> \newcommand{\sterling}{\ifmmode etc
Yes, this is actually how \pounds is defined:
\DeclareRobustCommand{\pounds}{%
\ifmmode\mathsterling\else\textsterling\fi}
And \mathsterling is always italic. (Why? Ask DEK!)
--
Walter
> Rowland McDonnell schrieb:
> >
> >
> > The solution I used in the short term was an \mbox - but that feels
> > icky.
>
> With \mbox, the font size will be wrong in superscripts,
> subscripts or in-line fractions.
Righto - thanks.
> Otherwise it's a valid
> solution.
Uhuh.
> real-addr...@flur.bltigibbet (Rowland McDonnell) writes:
> >I've got a strange problem. I'd like to include a pound sterling sign
> >inside maths mode. I thought the obvious way to get this to work would
> >be to bung the symbol inside \mathrm. But when I try this, I find that
> >I get an italic pound symbol rather than an upright one, although a
> >request for a pound symbol outside maths mode gets an upright version.
> >
> >[...]
> >$\mathrm{\pounds}220$
> >[...]
> >
> >Does anyone have a clue why this is happening and/or what might be an
> >elegant solution?
>
> there's no sterling symbol in any ot1 encoding except italic ones;
> latex makes use of the "upright italic" font to generate upright
> sterling symbols in ot1 encoding.
>
> so, as you can no doubt guess, \pounds _doesn't_ typically get set in
> the current: in particular, \mathrm in your example has no effect
> whatever, and the \pounds sign is trying to match itself to the
> surrounding stuff (which is maths italic).
Ah! Yeeesssss....... Ur. Now it all makes sense, after a fashion (I'd
thought about the OT1/ui bit but thought it wasn't relevant since I get
the same behaviour using T1 encoding. Oh, the joys of having the legacy
of iffy 1970s design decisions still floating around...).
> $\mbox{\pounds}$ seems to do what you're after.
>
> i expect the amsmath bundle's \text command would have the same effect
> (with the advantage that the result could be used in sub- and
> superscripts :-)
Aha! Yep - thanks.