Dollar sign with txfonts and fontenc

It's a bug in the TXfonts distribution. When the bold font metrics were built the dollar (character 36, octal 44) received the information for the ampersand (character 38, octal 46), as it is evident from the property list files derived from t1xb.tfm and txb.tfm (the fonts used for boldface in the T1 and OT1 encodings respectively). What happens because of this bug is that TeX prints a dollar sign, but reserves for it the same space it would for an ampersand. The difference is 3.33pt, so it resembles an interword space.

From t1xb.pl

(CHARACTER O 44
   (CHARWD R 0.833)
   (CHARHT R 0.681999)
   (CHARDP R 0.0135)
   )
(CHARACTER O 45
   (CHARWD R 1.0)
   (CHARHT R 0.681999)
   (CHARDP R 0.0135)
   )
(CHARACTER O 46
   (CHARWD R 0.833)
   (CHARHT R 0.681999)
   (CHARDP R 0.0135)
   )

From txb.pl

(CHARACTER O 44
   (CHARWD R 0.5)
   (CHARHT R 0.75)
   (CHARDP R 0.0975)
   )
(CHARACTER O 45
   (CHARWD R 1.0)
   (CHARHT R 0.686)
   (CHARDP R 0.0135)
   )
(CHARACTER O 46
   (CHARWD R 0.833)
   (CHARHT R 0.686)
   (CHARDP R 0.0175)
   )

A cure is to undeclare the \textdollar command in T1 encoding.

\documentclass{report}
\usepackage[T1]{fontenc}
%\usepackage{txfonts}
\usepackage{newtxtext}

\UndeclareTextCommand{\textdollar}{T1}

\begin{document}
\bfseries\$5
\end{document}

The developer of the NewTX fonts is active and maybe he can think to a solution for the problem at least for the newtxtext package if not for the original TXfonts.


Based on my testing perhaps there are some problems with the bold dollar symbol in T1 encoding TX fonts but I do not really know the detailed mechanism. Anyway, to switch to OT1 encoding fonts temporarily does work as a non-optimal remedy.

\documentclass{report}
\usepackage{txfonts}
\usepackage[T1]{fontenc}
\renewcommand{\$}{{\fontencoding{OT1}\selectfont\textdollar}}

\begin{document}

\begin{tabular}{l}
\textbf{\$500}\\
\$500 
\end{tabular}
\end{document}