[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#193444: further information



Here is further information.

> That \textsterling needs textcomp according to "The Comprehensive
> LaTeX Symbol List" by Scott Pakin. I can't find the same statement
> about \pounds.

Both \textsterling and \pounds should work without using the textcomp
package or TS1 encoding.

The "Symbol List" should be revised to mention or (better) discuss the
complicated situation of \pounds/\textsterling and \$/\textdollar in
standard LaTeX, i.e., OT1 encoding.

I don't understand it fully yet, but the excerpts from LaTeX sources
below are a start.  It looks like the dollar and sterling glyphs share
the same position (call it P) in OT1; that each glyph exists in a
roman and a slanted/italic form; and that in CMR, the four glyphs are
placed in the Pth position of four different font shapes as follows:

   dollar, roman:    upshape
   dollar, sl/it:    slshape
   sterling, roman:  itshape
   sterling, sl/it:  ui      (= "upright italic" otherwise, I think)

That this hack is not duplicated in OT1 Helvetica is not surprising,
since Helvetica is available within \sffamily, and I've never heard of
nor seen a sans-serif italic distinct from sans-serif slanted, and a
fortiori never seen sans-serif upright italic.  Whether such
variations are theoretically possible, I have not yet figured out.

It's clearly wrong for \textsterling to produce a dollar glyph in the
context of the test file.  But I'm still not clear where the problem
is.  One possibility is that the Helvetica OT1 definition (or possibly
all non-CMR instances of OT1) fails to duplicate the CMR hack when it
should (and the failure could be specific to Debian or teTeX).
Another is that non-CMR OT1 fonts can not (or should not) duplicate
this hack.  In either case, \textsterling should produce an error
rather than an entirely incorrect glyph (in the first case,
temporarily until the functionality can be provided; in the second,
permanently).  I don't now see any third possibility, but I'm not
fully confident of that analysis into two alternatives yet.

The problem does not occur if you use T1, which provides the sterling
glyph with its own distinct position.  See the slightly revised test
file below.

Notice the comment explaining that successfully selecting T1 is
awkward; you can't use the fontenc package in the way described in the
"Symbol List" document (which is the way one would expect and which is
I think the way recommended elsewhere as well).  Whether this apparent
limitation is due to the context of the use of the Helvetica package,
to obsolete documentation, to some bug in the code, to local
misconfiguration, or to my own insufficient understanding, I have not
yet determined.  (Thomas's example using textcomp/TS1 does work on my
system, by the way.)

The best workaround, surely, is to use T1 or TS1 instead of OT1.  Does
teTeX or Debian TeX permit a user to install versions of LaTeX that
default to T1 instead of OT1?  Probably this would represent a
problematic deviation from "standard LaTeX," but using a T1-default
LaTeX could nevertheless be made convenient for teTeX and/or Debian
TeX users.

Slightly revised test file:

    \documentclass{article}

    % LaTeX rejects this (doesn't know T1), though this is what the ``Symbol List''
    % says to do to get the T1 encoding.
    %\usepackage[T1]{fontenc}

    % Using TS1 produces the expected result.
    %\usepackage{textcomp}

    \usepackage{helvet}
    \begin{document}

    % This declaration causes t1phv.fd to be loaded instead of ot1phv.fd, but not
    % if it is put above in the preamble; it must be done after \begin{document}.
    \fontencoding{T1}\selectfont

    \sffamily
    \pounds 4
    \textsterling 3
    \end{document}

Below are excerpts from LaTeX sources (downloaded from CTAN -- I
haven't cross-checked these against teTeX or Debian versions, but they
ought to be the same!).

    * From /usr/local/share/LaTeX-01-06/tex/latex/base-source/ltoutenc.dtx, which
      is incorporated into latex.ltx:

    <file line number>:
    <file excerpt>

    422:
    % \changes{v1.9o}{1998/03/20}{Documentation added for pr/2783}
    %
    % In some cases encoding definitions are given to provide some limited
    % support since nothing better is available, for example, the definition
    % for |\textdollar| in \texttt{OT1} is a hack since \$ and \pounds{}
    % actually share the same slot in this encoding. Thus if such a glyph
    % becomes available in a different encoding (e.g., \texttt{TS1}) one
    % would like to get rid of the flacky one and make the default
    % definition point to the new encoding. In such a case defining
    %\begin{verbatim}
    %   \DeclareTextSymbol{\textdollar}{TS1}{36}
    %   \DeclareTextSymbolDefault{\textdollar}{TS1}
    %\end{verbatim}
    % is not enough since if typesetting in \texttt{OT1} \LaTeX{} will
    % still find the encoding specific-definition for \texttt{OT1} and
    % therefore ignore the new default.
    % Therefore to ensure that in this case the \texttt{TS1} version is
    % used  we have to remove the \texttt{OT1} declaration:
    %\begin{verbatim}
    %   \UndeclareTextCommand{\textdollar}{OT1}
    %\end{verbatim}
    %
    % Since the \$ sign is a proper glyph in the \texttt{T1} encoding there
    % is no point removing its definition and forcing \LaTeX{} to pick up
    % the \texttt{TS1} version if typesetting in this encoding.
    % However, assume you want to use the variant dollar sign,
    % i.e., \textdollaroldstyle{}
    % for your dollars. In that case you have to get rid of the \texttt{T1}
    % declaration as well, e.g., the following would do that for you:
    %\begin{verbatim}
    %   \UndeclareTextCommand{\textdollar}{OT1}
    %   \UndeclareTextCommand{\textdollar} {T1}
    %   \DeclareTextCommandDefault{\textdollar}
    %                             {\UseTextSymbol{TS1}\textdollaroldstyle}
    %\end{verbatim}
    %

    1293:
    \DeclareTextSymbolDefault{\textsterling}{OT1}

    1426:
    \DeclareRobustCommand{\pounds}{%
       \ifmmode\mathsterling\else\textsterling\fi}

    1711:
    %    In the OT1 encoding, \pounds~and \$ share a slot.
    % \changes{v1.9y}{2000/01/30}{Use \cs{hmode@bgroup} where applicable
    %    (pr/3160)}
    %    \begin{macrocode}
    \DeclareTextCommand{\textdollar}{OT1}{\hmode@bgroup
       \ifdim \fontdimen\@ne\font >\z@
          \slshape
       \else
          \upshape
       \fi
       \char`\$\egroup}
    %    \end{macrocode}
    %
    %    \begin{macrocode}
    \DeclareTextCommand{\textsterling}{OT1}{\hmode@bgroup
       \ifdim \fontdimen\@ne\font >\z@
          \itshape
       \else
          \fontshape{ui}\selectfont
       \fi
       \char`\$\egroup}
    %    \end{macrocode}
    %   

    1917:
    \DeclareTextSymbol{\textsterling}{T1}{191}

    2252:
    %    In the OT4 encoding, \pounds~and \$ share a slot.
    % \changes{v1.9y}{2000/01/30}{Use \cs{hmode@bgroup} where applicable
    %    (pr/3160)}
    %    \begin{macrocode}
    \DeclareTextCommand{\textdollar}{OT4}{\hmode@bgroup
       \ifdim \fontdimen\@ne\font >\z@
          \slshape
       \else
          \upshape
       \fi
       \char`\$\egroup}
    \DeclareTextCommand{\textsterling}{OT4}{\hmode@bgroup
       \ifdim \fontdimen\@ne\font >\z@
          \itshape 
       \else 
          \fontshape{ui}\selectfont 
       \fi 
       \char`\$\egroup}
    %    \end{macrocode}

    2556: \DeclareTextSymbol{\textsterling}{TS1}{163}

    2728: \DeclareTextSymbolDefault{\textsterling}{TS1}

    2759: %    Finally input the encoding-specific definitions for
    %    \texttt{TS1} thus making the top-level definitions
    %    optimised for this encoding (and not for the default
    %    encoding, see section~\ref{sec:orderofdecls}).
    % \changes{v1.9o}{1998/03/20}{Load decls after defaults for speed.}
    %    \begin{macrocode}
    \input{ts1enc.def}
    %    \end{macrocode}
    %    Now having the new glyphs available we also want to make sure
    %    that they are used. For most cases this will automatically happen
    %    but for some glyphs there are inferior definitions already known
    %    to \LaTeX{} which will prevent the usage of the \texttt{TS1}
    %    versions (see section~\ref{sec:removeencspec} above). So we better
    %    get rid of them:
    % \changes{v1.9o}{1998/03/20}{Added various \cs{UndeclareTextCommand}
    %    declarations for pr/2783}
    %    \begin{macrocode}
    \UndeclareTextCommand{\textsterling}{OT1}
    \UndeclareTextCommand{\textdollar}  {OT1}
    %    \end{macrocode}
    %    Similar declarations should probably be made for other encodings
    %    like \texttt{OT4} if they are in use.
    %    \begin{macrocode}
    %\UndeclareTextCommand{\textsterling}{OT4}
    %\UndeclareTextCommand{\textdollar}  {OT4}
    %    \end{macrocode}


    * From /usr/local/share/LaTeX-01-06/tex/latex/base/, the following:

    ot1cmr.fd
    ucmr.fd (mutatis mutandis)

    % Warning: please note that the upright shape below is
    %          used for the \pounds symbol of LaTeX. So this
    %          font definition shouldn't be removed.
    %
    \DeclareFontShape{OT1}{cmr}{m}{ui}
       {
          <5><6><7><8><9><10><10.95><12>%
          <14.4><17.28><20.74><24.88>cmu10%
          }{}

    [...]

    % Again this is necessary for a correct \pounds symbol in
    % the cmr fonts Hopefully the dc/ec font layout will take
    % over soon.
    %
    \DeclareFontShape{OT1}{cmr}{bx}{ui}
          {<->sub*cmr/m/ui}{}


    * From /usr/local/share/LaTeX-01-06/tex/latex/base/, the following, which have
      their source in
      /usr/local/share/LaTeX-01-06/tex/latex/base-source/inputenc.dtx:

    ansinew.def
    applemac.def
    cp1252.def
    decmulti.def
    latin1.def
    latin3.def
    latin5.def
    latin9.def
    next.def

    \DeclareInputText{163}{\pounds}

    cp437de.def
    cp437.def
    cp850.def
    cp856.def

    \DeclareInputText{156}{\pounds}





Reply to: