Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Pound sterling sign in maths mode oddness

33 views
Skip to first unread message

Rowland McDonnell

unread,
Jul 8, 2002, 3:40:31 PM7/8/02
to
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.

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

Walter Schmidt

unread,
Jul 8, 2002, 7:38:41 PM7/8/02
to
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.

> 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

Peter Flynn

unread,
Jul 8, 2002, 7:44:55 PM7/8/02
to
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. But
surely \textsterling was meant to overcome all this and work everywhere?

///Peter

Rowland McDonnell

unread,
Jul 8, 2002, 8:55:47 PM7/8/02
to
Peter Flynn <pe...@silmaril.ie> wrote:

> 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

unread,
Jul 8, 2002, 8:55:47 PM7/8/02
to
Walter Schmidt <wsc...@arcor.de> wrote:

> 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.

Walter Schmidt

unread,
Jul 9, 2002, 6:21:35 AM7/9/02
to
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. Otherwise it's a valid
solution.

--
Walter Schmidt <http://home.vr-web.de/was/fonts>
____________________________________________________________

Robin Fairbairns

unread,
Jul 9, 2002, 7:55:04 AM7/9/02
to
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).

$\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

Peter Flynn

unread,
Jul 9, 2002, 7:36:36 PM7/9/02
to
Rowland McDonnell wrote:
> Peter Flynn <pe...@silmaril.ie> wrote:
>
>
>>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?

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


Walter Schmidt

unread,
Jul 9, 2002, 7:54:09 PM7/9/02
to
Peter Flynn schrieb:

> [...]
> \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

unread,
Jul 9, 2002, 8:04:23 PM7/9/02
to
Walter Schmidt <wsc...@arcor.de> wrote:

> 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.

Rowland McDonnell

unread,
Jul 9, 2002, 8:04:24 PM7/9/02
to
Robin Fairbairns <r...@cl.cam.ac.uk> wrote:

> 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.

0 new messages