9

I'm writing a document which requires the helvet font and, in order to get access to the euro symbol, I am now trying to load the textcomp package.

However this package has the strange side effect of making the symbol produced by \textbullet, e.g. as used by an itemize environment, a bit smaller. I could live with that, but I sort of prefer the slightly larger bullet, so I'm wondering if there is an easy way to load textcomp but without changing the size of the bullet?

A small example showing the problem

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[scaled]{helvet}
\renewcommand{\familydefault}{\sfdefault}
% Uncomment the following line to see the problem 
%\usepackage{textcomp}

\begin{document}
\begin{itemize}
\item One
\item Two
\end{itemize}
\end{document}
Juan A. Navarro
  • 62,139
  • 32
  • 140
  • 169

2 Answers2

9

First, if you really want the origin \textbullet:

\DeclareTextSymbolDefault{\textbullet}{OMS}

Second, which is better? I know it is subjective, but I just want to explain what textcomp do.

With textcomp package, the text symbols are redeclared in new TS1 encoding, instead of Knuth's OMS encoding (designed for origin CM fonts). It is suitable for 8 bits fonts (256 glyphs).

If you use OMS encoding for \textbullet, then \textbullet is the same as

{\usefont{OMS}{phv}{m}{n}\symbol{15}}

And check omsphv.fd you'll find

\DeclareFontShape{OMS}{phv}{m}{n}
   {<-> ssub * cmsy/m/n}{}

i.e. Computer Modern Symbol font (cmsy) is used. In fact, it is not very suitable for Adobe Helvetica font (phv family).

If textcomp is used, \textbullet is in TS1 encoding, the result is the same as

{\usefont{TS1}{phv}{m}{n}\symbol{136}}

And check ts1phv.fd you'll find

\DeclareFontShape{TS1}{phv}{m}{n}{
   <-> \Hv@@scale phvr8c
}{}

That's real Helvetica. (Actully Nimbus Sans in most TeX distributions)

Leo Liu
  • 77,365
  • Just to let you know, I was sold by your argument that I should use the smaller bullet. Still, I am leaning to the euro symbol from eurosymb. I wish I could accept both answers, as learned a lot really from both! – Juan A. Navarro Jul 07 '11 at 17:07
6

Don't use textcomp for the Euro symbol. There's eurosym, which provides the official symbol.

If you want to input the Euro symbol directly with the Unicode character and the utf8 option to inputenc, you can write

\usepackage{eurosym,newunicodechar}
\newunicodechar{€}{\officialeuro}

You won't be able to find in the PDF, though. For that you need to add some magic:

\immediate\pdfobj stream {
  /CIDInit /ProcSet findresource begin
  12 dict begin
  begincmap
  /CIDSystemInfo
  << /Registry (TeX)
  /Ordering (Euro)
  /Supplement 0
  >> def
  /CMapName /TeX-Euro-0 def
  /CMapType 2 def
  1 begincodespacerange
  <00> <FF>
  endcodespacerange
  1 beginbfchar
  <65> <20AC>
  endbfchar
  endcmap
  CMapName currentdict /CMap defineresource pop
  end
  end
}
\begingroup
\edef\next#1#2{%
  \noexpand\fontseries{#1}\noexpand\fontshape{#2}\noexpand\selectfont
  \pdffontattr\font{/ToUnicode \the\pdflastobj\space 0 R}}
\fontencoding{U}\fontfamily{eurosym}%
\next{m}{n}\next{m}{sl}\next{m}{ol}
\next{bx}{n}\next{bx}{sl}\next{bx}{sl}
\endgroup

Basically this adds a CMAP resource and maps all eurosym fonts to it.

doncherry
  • 54,637
egreg
  • 1,121,712
  • 2
    It depends. For CM fonts, eurosym may be better (since the Euro symbol in CM super is ugly); but for those fonts that have Euro symbol, it is better to use textcomp to get the glyph in the font. – Leo Liu Jul 07 '11 at 16:29
  • Actually the euro symbol from eurosym does look rather nice. I probably should ask another question but, is it possible to make the symbol itself € work in my document if I'm using \usepackage[utf8]{inputenc} ? – Juan A. Navarro Jul 07 '11 at 16:30
  • @Juan: You'd have seen my answer in Latest advice on the euro symbol. Use \usepackage[utf8x]{inputenc} instead. – Leo Liu Jul 07 '11 at 16:33
  • Hmm.. I did saw that.. but it didn't work.. I now seem to find that the utf8x option and biblatex are incompatible. Biblatex complains about an incompatible package ucs. – Juan A. Navarro Jul 07 '11 at 16:39
  • @Leo Liu The font chosen through helvet surely hasn't it. – egreg Jul 07 '11 at 16:40
  • @Juan Look at the edited message. – egreg Jul 07 '11 at 16:53
  • @Juan: For better Unicode support, I suggest XeLaTeX or LuaLaTeX. utf8x option of inputenc does has some compatible issues. – Leo Liu Jul 07 '11 at 16:59
  • @egreg: helvet only switch phv family in NFSS. Origin \textbullet uses OMS encoding and actually use cmsy font. With textcomp, TS1 encoding is default, \textbullet uses phvr8c font, the same as the main text. – Leo Liu Jul 07 '11 at 17:02
  • I got it now, thanks both for the very useful and informative answers! – Juan A. Navarro Jul 07 '11 at 17:02
  • +1 for the Unicode/mapping magic, but I agree with @LeoLiu in that you should check if the official symbol matches the font you use. – doncherry Apr 10 '12 at 23:13
  • 1
    @doncherry I really don't like Euro symbols "matching" the current font. It's ugly anyway, so I prefer the official one. :) – egreg Apr 10 '12 at 23:17