% $Id: faq-symbols.tex,v 1.2 2009/06/30 18:44:15 rf10 Exp $ \section{Symbols, etc.} \Question[Q-usesymb]{Using symbols} Most symbol font sets come with a package that defines commands for every symbol in the font. While this is convenient, it can lead to difficulties, particularly with name clashes when you load packages that cover fonts which duplicate symbols~--- an issue which is discussed in \begin{narrowversion} \Qref[question]{}{Q-alreadydef}. \end{narrowversion} \begin{wideversion} ``\Qref{symbol already defined}{Q-alreadydef}''. \end{wideversion} Some font sets (for example, \FontName{MnSymbol}) are huge, and the accompanying macros cover so many symbols that name clashes are surely a serious problem. The \Package{pifont} package (originally designed to use the Adobe \FontName{Zapf Dingbats} font) avoids this sort of problem: it requires you to know the font position of any symbol you want to use (the documentation provides font tables). The basic command is \cmdinvoke*{ding}{number} for a single symbol; there are commands for other fancier uses. \Package{Pifont} also allows you to select other fonts, for similar use. The \Package{yagusylo} describes itself as ``an extended version of \Package{pifont}, gone technicolor''. It provides all the facilities of \Package{pifont}, but allows you to create your own mnemonic names for symbols. Thus, while you can say % ! line break \cmdinvoke*{yagding}[family]{symbol number}[colour], you can also define symbol names with \csx{defdingname}, and then use them with \cmdinvoke*{yagding*}{symbol name} (the defined name carries the font family and colour specified in the arguments of \csx{defdingname}). \Package{Yagusylo} is somewhat complicated, but its documentation is clear; it is probably the best tool to use for picking and choosing symbols from a variety of font families. \begin{ctanrefs} \item[mnsymbol \nothtml{\rmfamily}fonts]\CTANref{mnsymbol} \item[pifont.sty]Distributed as part of \CTANref{psnfss} \item[yagusylo.sty]\CTANref{yagusylo} \end{ctanrefs} \Question[Q-numbersets]{Symbols for the number sets} Mathematicians commonly use special lettering for the real numbers and other standard number sets. Traditionally these were typeset in bold. Because, in the ordinary course of events, mathematicians do not have access to bold chalk, they invented special symbols that are now often used for the number sets; these symbols are known as ``blackboard bold'' (or double-stroked fonts); in place of the heavier strokes of a bold font, (some) strokes of the letters are doubled. The minimum useful set is upper-case letters `I', `N', `R', `Q' and `Z'; some fonts offer a figure `1' (for a unit matrix~--- not a number set at all). A set of blackboard bold capitals is available in the \acro{AMS} \FontName{msbm} fonts (\FontName{msbm} is available at a range of design sizes, with names such as \FontName{msbm10}). The pair of font families (the other is called \FontName{msam}) have a large number of mathematical symbols to supplement those provided in the Knuth's original \TeX{} distribution, and are available in Type~1 format in modern distributions. Support files for using the fonts, both under \plaintex{} and \LaTeX{} (packages \Package{amssymb} and \Package{amsfonts}), are available. The font shape is a rather austere sans, which many people don't like (though it captures the essence of quickly-chalked writing rather well). The \FontName{bbold} family is set of blackboard bold fonts written in \MF{}. This set offers blackboard bold forms of lower-case letters; the font source directory also contains sources for a \LaTeX{} package that enables use of the fonts. The fonts are not available in Type~1 format. The \FontName{bbm} family claims to provide `blackboard' versions of most of the \FontName{cm} fonts~\dots{} including the bold and bold-extended series. Again, the fonts are designed in \MF{} and are not available in Type~1 format. \LaTeX{} macro support comes from a package by Torsten Hilbrich. The \FontName{doublestroke} family comes in just roman and sans shapes, at a single weight, and is available both as \MF{} sources and as Type~1; the font covers the uppercase latin letters, lowercase `h' and 'k', and the digit `1'. A document that shows the \FontName{bbm}, \FontName{bbold}, \FontName{doublestroke} and \FontName{msbm} fonts, so that you can get a feel for their appearance, is available (\acro{CTAN} package \Package{blackboard}). An alternative source of Type~1 fonts with blackboard bold characters may be found in the steadily increasing set of complete families, both commercial and free, that have been prepared for use with \AllTeX{} (see % beware line break \htmlonly{``}\Qref[question]{choice of outline fonts}{Q-psfchoice}\htmlonly{''}). Of the free sets, the \FontName{txfonts} and \FontName{pxfonts} families both come with replicas of \FontName{msam} and \FontName{msbm} (though, as noted elsewhere, there are other reasons not to use these fonts). The \FontName{mathpazo} family includes a ``mathematically significant'' choice of blackboard bold characters, and the \FontName{fourier} fonts contain blackboard bold upper-case letters, the digit `1', and lower-case `k'. The ``lazy person's'' blackboard bold macros: \begin{quote} \begin{verbatim} \newcommand{\R}{{\textsf{R}\hspace*{-0.9ex}% \rule{0.15ex}{1.5ex}\hspace*{0.9ex}}} \newcommand{\N}{{\textsf{N}\hspace*{-1.0ex}% \rule{0.15ex}{1.3ex}\hspace*{1.0ex}}} \newcommand{\Q}{{\textsf{Q}\hspace*{-1.1ex}% \rule{0.15ex}{1.5ex}\hspace*{1.1ex}}} \newcommand{\C}{{\textsf{C}\hspace*{-0.9ex}% \rule{0.15ex}{1.3ex}\hspace*{0.9ex}}} \end{verbatim} \end{quote} are almost acceptable at normal size if the surrounding text is \FontName{cmr10} (the position of the vertical bar can be affected by the surrounding font). However, they are not part of a proper maths font, and do not work in sub- and superscripts. As we've seen, there are plenty of alternatives: that mythical ``lazy'' person can inevitably do better than the macros, or anything similar using capital `I' (which looks even worse!). Voluntary \AllTeX{} effort has redefined the meaning of laziness (in this respect!). \begin{ctanrefs} \item[AMS support files]Distributed as part of \CTANref{amsfonts} \item[AMS symbol fonts]Distributed as part of \CTANref{amsfonts} \item[bbm fonts]\CTANref{bbm} \item[bbm macros]\CTANref{bbm-macros} \item[bbold fonts]\CTANref{bbold} \item[blackboard \nothtml{\rmfamily}evaluation set]\CTANref{blackboard} \item[doublestroke fonts]\CTANref{doublestroke} \item[fourier fonts]\CTANref{fourier} \item[mathpazo fonts]\CTANref{mathpazo} \item[pxfonts]\CTANref{pxfonts} \item[txfonts]\CTANref{txfonts} \end{ctanrefs} \Question[Q-scriptfonts]{Better script fonts for maths} The font selected by \csx{mathcal} is the only script font `built in'. However, there are other useful calligraphic fonts included with modern \TeX{} distributions. \begin{description} \item[Euler] The \Package{eucal} package (part of most sensible \TeX{} distributions; the fonts are part of the \acro{AMS} font set) gives a slightly curlier font than the default. The package changes the font that is selected by \csx{mathcal}. Type 1 versions of the fonts are available in the \acro{AMS} fonts distribution. \item[RSFS] The \Package{mathrsfs} package uses a really fancy script font (the name stands for ``Ralph Smith's Formal Script'') which is already part of most modern \TeX{} distributions (Type~1 versions of the font are also provided, courtesy of Taco Hoekwater). The package creates a new command \csx{mathscr}. \item[Zapf Chancery] is the standard \PS{} calligraphic font. There is no package but you can easily make it available by means of the command \begin{verbatim} \DeclareMathAlphabet{\mathscr}{OT1}{pzc}% {m}{it} \end{verbatim} in your preamble. You may find the font rather too big; if so, you can use a scaled version of it like this: \begin{verbatim} \DeclareFontFamily{OT1}{pzc}{} \DeclareFontShape{OT1}{pzc}{m}{it}% {<-> s * [0.900] pzcmi7t}{} \DeclareMathAlphabet{\mathscr}{OT1}{pzc}% {m}{it} \end{verbatim} Adobe Zapf Chancery (which the above examples use) is distributed in any but the most basic \PS{} printers. A substantially identical font (to the extent that the same metrics may be used) is available from \acro{URW}, called URW Chancery L: it is distributed with Ghostscript, and as part of the ``URW base35'' bundle, which is available in most distributions. \end{description} Examples of the available styles are available on \acro{CTAN}. \begin{ctanrefs} \item[eucal.sty]Distributed as part of \CTANref{amsfonts} \item[euler fonts]Distributed as part of \CTANref{amsfonts} \item[ghostscript]Browse \CTANref{ghostscript} \item[mathrsfs.sty]Distributed as part of \CTANref{jknappen-macros} \item[rsfs fonts]\CTANref{rsfs} \item[Script font examples]\CTANref{mathscript} \item[URW Chancery L]Distributed as part of \CTANref{urw-base35} \end{ctanrefs} \Question[Q-boldgreek]{Setting bold Greek letters in \LaTeX{}} The issue here is complicated by the fact that \csx{mathbf} (the command for setting bold \emph{text} in \TeX{} maths) affects a select few mathematical symbols (the uppercase Greek letters). However lower-case Greek letters behave differently from upper-case Greek letters (due to Knuth's esoteric font encoding decisions). However, \csx{mathbf} \emph{can't} be used even for upper-case Greek letters in the \AMSLaTeX{} \Package{amsmath} package, which disables this font-switching and you must use one of the techniques outlined below. The \plaintex{} solution \emph{does} work, in a limited way: \begin{quote} \begin{verbatim} {\boldmath$\theta$} \end{verbatim} \end{quote} but \csx{boldmath} may not be used in maths mode, so this `solution' requires arcana such as: \begin{quote} \begin{verbatim} $... \mbox{\boldmath$\theta$} ...$ \end{verbatim} \end{quote} which then causes problems in superscripts, etc. These problems may be addressed by using a bold mathematics package. \begin{itemize} \item The \Package{bm} package, which is part of the \LaTeX{} tools distribution, defines a command \csx{bm} which may be used anywhere in maths mode. \item The \Package{amsbsy} package (which is part of \AMSLaTeX{}) defines a command \csx{boldsymbol}, which (though slightly less comprehensive than \csx{bm}) covers almost all common cases. \end{itemize} All these solutions cover all mathematical symbols, not merely Greek letters. \begin{ctanrefs} \item[bm.sty]Distributed as part of \CTANref{2etools} \item[amsbsy.sty]Distributed as part of \AMSLaTeX{} \CTANref{amslatex} \item[amsmath.sty]Distributed as part of \AMSLaTeX{} \CTANref{amslatex} \end{ctanrefs} \Question[Q-prinvalint]{The Principal Value Integral symbol} This symbol (an integral sign, `crossed') does not appear in any of the fonts ordinarily available to \AllTeX{} users, but it can be created by use of the following macros: \begin{wideversion} \begin{verbatim} \def\Xint#1{\mathchoice {\XXint\displaystyle\textstyle{#1}}% {\XXint\textstyle\scriptstyle{#1}}% {\XXint\scriptstyle\scriptscriptstyle{#1}}% {\XXint\scriptscriptstyle\scriptscriptstyle{#1}}% \!\int} \def\XXint#1#2#3{{\setbox0=\hbox{$#1{#2#3}{\int}$} \vcenter{\hbox{$#2#3$}}\kern-.5\wd0}} \def\ddashint{\Xint=} \def\dashint{\Xint-} \end{verbatim} \end{wideversion} \begin{narrowversion} \begin{verbatim} \def\Xint#1{\mathchoice {\XXint\displaystyle\textstyle{#1}}% {\XXint\textstyle\scriptstyle{#1}}% {\XXint\scriptstyle\scriptscriptstyle{#1}}% {\XXint\scriptscriptstyle \scriptscriptstyle{#1}}% \!\int} \def\XXint#1#2#3{{% \setbox0=\hbox{$#1{#2#3}{\int}$} \vcenter{\hbox{$#2#3$}}\kern-.5\wd0}} \def\ddashint{\Xint=} \def\dashint{\Xint-} \end{verbatim} \end{narrowversion} \csx{dashint} gives a single-dashed integral sign, \csx{ddashint} a double-dashed one. \Question[Q-underscore]{How to use the underscore character} The underscore character `\texttt{\_}' is ordinarily used in \TeX{} to indicate a subscript in maths mode; if you type \texttt{\_}, on its own, in the course of ordinary text, \TeX{} will complain. If you're writing a document which will contain a large number of underscore characters, the prospect of typing \csx{\_} (or, worse, \csx{textunderscore}) for every one of them will daunt most ordinary people. Moderately skilled macro programmers can readily generate a quick hack to permit typing `\texttt{\_}' to mean `text underscore'. However, the code \emph{is} somewhat tricky, and more importantly there are significant points where it's easy to get it wrong. There is therefore a package \Package{underscore} which provides a general solution to this requirement. There is a problem, though: \acro{OT}1 text fonts don't contain an underscore character, unless they're in the typewriter version of the encoding (used by fixed-width fonts such as \texttt{cmtt}). So either you must ensure that your underscore characters only occur in text set in a typewriter font, or you must use a more modern encoding, such as \acro{T}1, which has the same layout for every font, and thus an underscore in every font. If the requirement is only for occasional uses of underscores, it may be acceptable to use the following construct: \begin{quote} \begin{verbatim} \def\us{\char`\_} ... \texttt{create\us process} \end{verbatim} \end{quote} The construction isn't in the least robust (in the normal English sense of the word), but it \emph{is} robust under expansion (i.e., the \LaTeX{} sense of the word); so use it with care, but don't worry about section headings and the like. \begin{ctanrefs} \item[underscore.sty]\CTANref{underscore} \end{ctanrefs} \Question[Q-atsign]{How to type an `@' sign?} Long ago, some packages used to use the `@' sign as a command, so that special measures were needed to type it. While those packages are still in principle available, few people use them, and those that do use them have ready access to rather good documentation. Ordinary people (such as the author of this \acro{FAQ}) need only type `@'. \Question[Q-euro]{Typesetting the Euro sign} The European currency ``Euro'' is represented by a symbol of somewhat dubious design, but it's an important currency and \AllTeX{} users need to typeset it. Note that the Commission of the European Community at first deemed that the Euro symbol should always be set in a sans-serif font; fortunately, this eccentric ruling has now been rescinded, and one may apply best typesetting efforts to making it appear at least slightly ``respectable'' (typographically). The \acro{TS}1-encoded \acro{TC} fonts provided as part of the \acro{EC} font distribution provide Euro glyphs. The fonts are called Text Companion (\acro{TC}) fonts, and offer the same range of faces as do the \acro{EC} fonts themselves. The \Package{textcomp} package provides a \csx{texteuro} command for accessing the symbol, which selects a symbol to match the surrounding text. The design of the symbol in the \acro{TC} fonts is not universally loved\dots{} Nevertheless, use the \acro{TC} font version of the symbol if you are producing documents using Knuth's Computer Modern Fonts. The \Package{latin9} input encoding defined by the \Package{inputenc} package has a euro character defined (character position 164, occupied in other \acro{ISO} Latin character sets by the ``currency symbol''). The encoding uses the command \csx{texteuro} for the character; at present that command is \emph{only} available from the \Package{textcomp} package. There is a Microsoft code page position, too, but standardisation of such things proceeds via rather different routes and the \LaTeX{} project hasn't yet been given details of the change. Outline fonts which contain nothing but Euro symbols are available (free) from \href{ftp://ftp.adobe.com/pub/adobe/type/win/all/eurofont.exe}{Adobe}\nobreakspace--- the file is packaged as a \ProgName{Windows} self-extracting executable, but it may be decoded as a \extension{zip} format archive on other operating systems. The \Package{euro} bundle contains metrics, \ProgName{dvips} map files, and macros (for \plaintex{} and \LaTeX{}), for using these fonts in documents. \LaTeX{} users will find two packages in the bundle: \Package{eurosans} only offers the sans-serif version (to conform with the obsolete ruling about sans-serif-only symbols; the package provides the command \csx{euro}), whereas \Package{europs} matches the Euro symbol with the surrounding text (providing the command \csx{EUR}). To use either package with the \Package{latin9} encoding, you need to define \csx{texteuro} as an alias for the euro command the package defines. The Adobe fonts are probably the best bet for use in non-Computer Modern environments. They are apparently designed to fit with Adobe Times, Helvetica and Courier, but can probably fit with a wider range of modern fonts. The \Package{eurofont} package provides a compendious analysis of the ``problem of the euro symbol'' in its documentation, and offers macros for configuring the source of the glyphs to be used; however, it seems rather large for everyday use. The \Package{euro-ce} bundle is a rather pleasing \MF{}-only design providing Euro symbols in a number of shapes. The file \File{euro-ce.tex}, in the distribution, offers hints as to how a \plaintex{} user might make use of the fonts. Euro symbols are found in several other places, which we list here for completeness. The \Package{marvosym} fonts contain a Euro symbol among many other good things. %% ; the font on \acro{CTAN} is not Adobe \ProgName{ATM} %% compatible, but a compatible version is available free from %% \href{http://www.YandY.com/download/marvosym.zip}{\YandY{}}. The font %% on \acro{CTAN} comes with a set of macros to typeset all the symbols %% it contains. Other \MF{}-based bundles containing Euro symbols are to be found in \Package{china2e} (whose primary aim is Chinese dates and suchlike matters) and the \Package{eurosym} fonts. \begin{ctanrefs} \item[china2e bundle]\CTANref{china2e} \item[EC fonts]\CTANref{ec} \item[euro fonts]\CTANref{euro-fonts} \item[euro-ce fonts]\CTANref{euro-ce} \item[eurofont.sty]\CTANref{eurofont} \item[eurosym fonts]\CTANref{eurosym} \item[marvosym fonts]\CTANref{marvosym-fonts} \item[textcomp.sty]Part of the \LaTeX{} distribution. \end{ctanrefs} \Question[Q-tradesyms]{How to get copyright, trademark, etc.} The ``\nothtml{Comprehensive symbol list'' (}% beware line break \Qref{Comprehensive symbol list}{Q-symbols}\latexhtml{)}{''}, lists the symbol commands \csx{textcopyright}, \csx{textregistered} and \csx{texttrademark}, which are available in \acro{TS}1-encoded fonts, and which are enabled using the \Package{textcomp} package. In fact, all three commands are enabled in default \LaTeX{}, but the glyphs you get aren't terribly beautiful. In particular, \csx{textregistered} behaves oddly when included in bold text (for example, in a section heading), since it is composed of a small-caps letter, which typically degrades to a regular shape letter when asked to set in a bold font. This means that the glyph becomes a circled ``r'', whereas the proper symbol is a circled ``R''. This effect is of course avoided by use of \Package{textcomp}. Another problem arises if you want \csx{textregistered} in a superscript position (to look similar to \csx{texttrademark}). Using a maths-mode superscript to do this provokes lots of pointless errors: you \emph{must} use \begin{quote} \begin{verbatim} \textsuperscript{\textregistered} \end{verbatim} \end{quote} \Question[Q-osf]{Using ``old-style'' figures} These numbers are also called medieval or lowercase figures and their use is mostly font-specific. Terminology is confusing since the lining figures (which are now the default) are a relatively recent development (19th century) and before they arrived, oldstyle figures were the norm, even when setting mathematics. (An example is Thomas Harriot's \emph{Artis Analyticae Praxis} published in 1631). In a typical old style 3, 4, 5, 7 and 9 have descenders and 6 and 8 ascend above the x-height; sometimes 2 will also ascend (this last seems to be a variation associated with French typography). \LaTeX{} provides a command \cmdinvoke*{oldstylenums}{digits}, which by default uses an old-style set embedded in Knuth's `math italic' font. The command isn't sensitive to the font style of surrounding text: the glyphs are only available to match the normal medium weight Computer Modern Roman fonts. The \Package{textcomp} package changes \csx{oldstylenums} to use the glyphs in the Text Companion fonts (\LaTeX{} \acro{TS}1 encoding) when in text mode, and also makes them available using the macros of the form \csx{textoldstyle}, e.g., \csx{textzerooldstyle}. (Of course, not all font families can provide this facility.) Some font packages (e.g., \Package{mathpazo}) make old-style figures available and provide explicit support for making them the default: \cmdinvoke{usepackage}[osf]{mathpazo} selects a form where digits are always old-style in text. The \Package{fontinst} package will automatically generate ``old-style versions'' of commercial Adobe Type 1 font families for which ``expert'' sets are available. It's also possible to make virtual fonts, that offer old-style digits, from existing font packages. The \FontName{cmolddig} bundle provides a such a virtual version of Knuth's originals, and the \FontName{eco} or \FontName{hfoldsty} bundles both provide versions of the \acro{EC} fonts. The \FontName{lm} family offers old-style figures to OpenType users (see below), but we have no stable mapping for \FontName{lm} with old-style digits from the Adobe Type 1 versions of the fonts. Originally, oldstyle figures were only to be found the expert sets of commercial fonts, but now they are increasingly widely available. An example is Matthew Carter's Georgia font, which has old-style figures as its normal form (the font was created for inclusion with certain Microsoft products and is intended for on-screen viewing). OpenType fonts have a pair of axes for number variations~--- proportional/tabular and lining/oldstyle selections are commonly available. ``Full feature access'' to OpenType fonts, making such options available to the \AllTeX{} user, is already supported by \Qref*{\xetex{}}{Q-xetex} using, for example, the \Package{fontspec} package. Similar support is also in the works for \Qref*{\LuaTeX{}}{Q-luatex}. \begin{ctanrefs} \item[cmolddig \nothtml{\rmfamily}fonts]\CTANref{cmolddig} \item[eco \nothtml{\rmfamily}fonts]\CTANref{eco} \item[fontinst]\CTANref{fontinst} \item[fontspec.sty]\CTANref{fontspec} \item[mathpazo \nothtml{\rmfamily}fonts]\CTANref{mathpazo} \end{ctanrefs}