Every once in a while the nominal (i.e. declared) dimensions of a symbol are not identical to the actual ones. This can be intentional or not, but sometimes it is inconvenient.
The dimensions of the double dagger (\ddag
) from the cm
fonts seem to be slightly inaccurate. Using \kern
one can adjust the horizontal dimensions. The vertical dimensions can be changed with Steven B. Segletes' useful verbatimbox
package:
(Disclaimer: Note that the horizontal extensions are intentional and less likely to cause any problems. Barbara Beeton pointed out that "the Metafont definition, which clearly includes the generous sidebearings, appears on pp. 536-537 of the book Computer Modern Typefaces, volume E of Knuth's Computers & Typesetting series". Nonetheless, my adjustment shall serve illustrative purposes. A better case for adjustments of the side spacing might be the slash /
from txfonts
; see below.)
(Disclaimer: txfonts
is superseded by newtx
, i.e. newtxtext
and newtxmath
. When I compile with it instead, the same glyphic problems appear. So I will let my question stand the way it is now. To what extent the metrics from the newtx
packages are still in need of improvement I don't know.)
Looking at some symbols from txfonts
, the symbol \ncong
seems to have correct dimensions (I assume here that the horizontal spacing on both sides is fine and beneficial):
But some other symbols from there seem to be slightly miscalibrated:
Here, \dag
, \ddag
, \Vert
, \#
, and \equiv
can benefit from vertical adjustment at the top (the declared height of \equiv
is a tiny bit too small, though this is hard to see from the picture here). This is somewhat true for symbol /
too, but horizontal adjustment is more needed for it to create equal spacing on both sides. (The slash from the cm
fonts doesn't have such asymmetric horizontal spacing.)
Here is the code used for generating the above examples:
\documentclass{article}
\usepackage{txfonts} % comment out for "cm" font symbols
\usepackage{verbatimbox}
\newcommand*{\ddagMod}{\kern-0.060em\addvbuffer[0.025ex 0.025ex]{\ddag}\kern-0.062em}
\begin{document}
{
\Huge
\fboxsep=0pt\fboxrule=.02pt
% \fbox-trick taken from Steven B. Segletes' answers here:
% http://tex.stackexchange.com/a/121946/14996
% http://tex.stackexchange.com/a/123108/14996
% cm fonts ("\usepackage{txfonts}" commented out):
\fbox{\ddag}
\fbox{\ddagMod}
% with "\usepackage{txfonts}":
\fbox{\(\ncong\)}
\par
\fbox{\dag}
\fbox{\ddag}
\fbox{\(\Vert\)}
\fbox{\#}
\fbox{\(\equiv\)}
\par
\fbox{/}
}
\end{document}
How can one adjust a symbol's vertical and horizontal dimensions in the cleanest way? Let's assume we have a symbol \symb
and would like to adjust it in a way that is likely to work at different font sizes and in the different math mode styles. My \ddagMod
does what I want for \ddag
in text mode, but a robust, general approach is needed.
\ddag
is from the originalcm
fonts, designed by knuth; its origin is notamsmath
. the metafont definition, which clearly includess the generous sidebearings, appears on pp.536-537 of the book "computer modern typefaces", volume e of knuth's "computers & typesetting" series.txfonts
are notorious for having not so good metrics, in particular sidebearings.\ddag
. for something that might surprise you, take a look at the dimensions assigned to the minus sign, then compare with the plus. the explanation is in the definition ofbeginarithchar
, volume e, p.483: "ensure constant dimensions for+
,-
, etc.". you might also take a look at the relationships between\Uparrow
,\Downarrow
,\Vert
,\parallel
and the glyph at octal 015 ofcmext
(the two-line extender).