14

Very strange discovery today for a newbie. If I want to type pounds, I could use \pounds to get the British Pounds symbol, but apparently, LaTeX does not recognize \dollars. (I have to type \$).

Is there a reason behind that?

2
  • 15
    The symbol for pounds is not in ASCII.
    – egreg
    Commented Apr 26, 2020 at 14:55
  • 5
    Is something stopping you from defining \newcommand\dollars{\$}? Maybe the creator(s) of LaTeX didn't bother providing such a definition since writing \$ would seem quicker than writing \dollars does?
    – Mico
    Commented Apr 26, 2020 at 14:57

4 Answers 4

38

The reason is good old ASCII code that has a slot for $, but no slot for £.

Since $ has a special meaning for TeX, Knuth decided that in order to obtain the “$” glyph one just needed to escape $, so to type \$.

The pound symbol is available in fonts, but there used to be no straightforward way to input it (remember that when TeX was born there was no Unicode and code pages extending ASCII differed wildly among operating systems). Hence the solution was to define a control sequence for it.

There is no need for \dollars: I don't think you believe that typing \dollars is more practical than typing \$.

Now that we have Unicode and UTF-8 it's much simpler to type £ instead of \pounds.

\documentclass{article}

\begin{document}

\$100 is good, but £100 is better.

\end{document}

enter image description here

14
  • 2
    @jxhyc If you have an up-to-date LaTeX system, just type in £ and see.
    – egreg
    Commented Apr 26, 2020 at 15:53
  • 17
    These days £100 isn't much better than $100. Commented Apr 26, 2020 at 18:40
  • 10
    $5 is better than nothing. And nothing is better than perfect happiness. Therefore $5 is better than perfect happiness. Commented Apr 27, 2020 at 3:10
  • 8
    I would argue about it being simpler, unless you either have a British-specific keyboard, or use pounds frequently enough to have memorized the extended key combination. \pounds is MUCH simpler for most of us.
    – jamesqf
    Commented Apr 27, 2020 at 3:34
  • 1
    Using US-International-Layout AltGr+Shift+4 gives a '£', AltGr+5 gives a '€' (not hard to remember, if you occasionally use either of them)
    – chtz
    Commented Apr 28, 2020 at 0:39
11

The LaTeX kernel has \textdollar, as well as \textsterling, \texteuro, \textcent, \textyen and \textdollaroldstyle for a dollar sign with two bars.

On older kernels, you might need to include the fontspec or textcomp packages to use some of these.

1
  • 2
    all of textcomp is part of the kernel these days Commented Apr 28, 2020 at 19:02
7

FWIW, dollars and pounds are on equal footing in ConTeXt:

\starttext
\textdollar 100 is good, but \textsterling 100 is better.
\stoptext

or an Wolfgang Schuster mentions in the comments, use \asciimode and directly enter the symbols:

\asciimode
\starttext
$100 is good, but £100 is better.
\stoptext
2
  • 3
    With \asciimode you can write $100 is good, but £100 is better. without the need for TeX commands. Commented Apr 27, 2020 at 21:38
  • 4
    and so is LaTeX, which too has \textdollar and \textsterling (\pounds is historical) Commented Apr 28, 2020 at 19:01
1

Is that nobody use \EyesDollar? XD

Seriously, there are a few other dollar commands beside \$ (or \textdollar), but one must take into account if they work also in both math and text mode, if they need a package (that can be lost in a copy and paste, and then find out ...) o more "fun", it is custom macro based in a composed character, instead a simple glyph, that could be "decomposed", or even produce a fatal error, changing something else in the document or using another compiler.

mwe

\documentclass[a5paper]{article}
\usepackage{fontspec} % compile with xelatex !!
\setmainfont[Mapping=tex-text]{Symbola} % needed for some glyphs !!
\usepackage{geometry}  \usepackage{graphicx,xcolor}
\usepackage{tabto}
\TabPositions{5cm,7.5cm,8.5cm,12cm}
\usepackage{circledsteps}
\usepackage{fontawesome}
\usepackage{marvosym}
\usepackage{dsfont}
\usepackage[colorlinks,linkcolor=blue]{hyperref}
\parindent0pt\parskip.8em\pagestyle{empty}
\begin{document}

\subsubsection*{Just for the sake of completeness} 

Symbol \tab Math \tab Text\par
\medskip\par  
\verb.\$(\textdollar)£(\pounds). \tab {\Large$\$(\textdollar)£(\pounds)$} \tab {\Large\$(\textdollar)£(\pounds)} \par
\verb.\mathdollar. \tab  {\Large$\mathdollar$} \tab \vbox to 1.25em {\textcolor{red}{oops! ⛔}} \par
\verb.\textdollaroldstyle. \tab  {\Large$\textdollaroldstyle$} \tab  {\Large\textdollaroldstyle}\par  
\verb.\faDollar. \tab  {\Large$\faDollar$} \tab  {\Large\faDollar}\par
\verb!S+...//! \tab
 {\Large$S\kern-.52em\vbox to .8em{\hbox{/}}\kern-.15em\vbox to .8em{\hbox{/}}$} \tab
{\Large S\kern-.52em\vbox to .8em{\hbox{/}}\kern-.15em\vbox to .8em{\hbox{/}}}\par
\verb!S+ ...||! \tab
 {\Large $S\kern-.42em\vbox to .8em{\hbox{|}}\kern-.1em\vbox to .8em{\hbox{|}}$} 
\tab
 {\Large S\kern-.42em\vbox to .8em{\hbox{|}}\kern-.1em\vbox to .8em{\hbox{|}}} \par


There are also \verb.\bbdollar. of the \href{https://www.ctan.org/pkg/mbboard}{\ttfamily mbboard} package (in CTAN  but not available from \TeX Live nor Mik\TeX\  download managers).


\section*{Just joking: 🤣} 
\TabPositions{1cm,4cm}
\tab {\Large\EyesDollar} \tab Tempting dollars (evil snake)\par 
\tab {\Large\rotatebox[origin=c]{180}{\EyesDollar}} \tab Healing dollars (Aesculapius snake) \par\tab 
{\Large\textcircled{\resizebox{!}{.55em}{\$}} \mbox{\vbox to .61em{\hbox to .5em{\$}}⃝} }  
{\Large\Circled[outer color=gray,inner color=gray!10, fill color=gray!60]{\$}}
\tab Silver dollar coins \par % U+20DD
\tab{\Large\Circled[outer color=black,inner color=orange!30!yellow, fill color=orange!60!brown]{\$}} 
\tab Fiat (fake) copper dollar\par 
\tab {\Large 💵}  \tab Fiat (fake) banknote dollar  \par  % U+1F4B5 
\tab {\Large$\mathds{S}$} \tab Half dollar (50 ¢)\par
\tab {\Large\mbox{\vbox to .6em{\hbox to .5em{\scalebox{.97}{\$}}}⃠}} \tab I am broke (0 \$) % U+20E0


\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .