Math & Science ⇒ Weird spacing problem
Weird spacing problem
Hello,
I don't know what to do here: The underlined sigma should not look fine (see my screenshot with URW's GaramondNo8), but indeed does look ok with the Latin Modern, and I've just noticed the not existing horizontal space between the \dund{D} and \uli{u}.
Could anyone give me a hint what the problem is, or if I misunderstood something?
Latin Modern: GaramondNo8 with mathdesign:
I don't know what to do here: The underlined sigma should not look fine (see my screenshot with URW's GaramondNo8), but indeed does look ok with the Latin Modern, and I've just noticed the not existing horizontal space between the \dund{D} and \uli{u}.
Could anyone give me a hint what the problem is, or if I misunderstood something?
Latin Modern: GaramondNo8 with mathdesign:
- Attachments
-
- weird-spacing.tex
- (389 Bytes) Downloaded 184 times
Last edited by Montag on Thu Jan 20, 2011 9:43 am, edited 1 time in total.
OS: Win 7 64-bit LaTeX: MikTeX 2.9 64-bit Editor: TXC 1 RC1
NEW: TikZ book now 40% off at Amazon.com for a short time.

Re: Weird spacing problem
Out of curiousity, can you still tell the difference printed?
Weird spacing problem
Yes, I can, it looks weird. What's the way to go, is it common to add horizontal space via \, or something alike?frabjous wrote:Out of curiousity, can you still tell the difference printed?

The underline sigma set in GaramondNo8 looks simply horrible. :/
But using the Minion Pro font which is provided via CTAN, it looks ok. I guess I'll stick to any font except the GaramondNo8 then.
OS: Win 7 64-bit LaTeX: MikTeX 2.9 64-bit Editor: TXC 1 RC1
Weird spacing problem
Yeah, it does seem to be a problem with that font: it doesn't seem to know how tall its own characters are. That's especially true of \sigma apparently. You could use commands like \smash to force them into submission. With the Du and D\epsilon constructions, I think the only thing you could try to do would be to try to force the underlining that goes under both to come from the same \underline command, and then get the second underline under the D by putting in a zero-width double-underlined phantom D before it, e.g.:
But that's a lot of work if you have a lot of these constructions popping up, and kind of an ugly kludge. If this is just a couple equations here and there, it might be worth it if you really had your heart set on Garamond/mathdesign.
Surely Minion Pro isn't provided by CTAN? Adobe owns that font. Do you mean the package that is on CTAN for use with the Adobe fonts?
Code: Select all
\documentclass{scrartcl}
\usepackage[english]{babel}
\usepackage[garamond]{mathdesign}
\usepackage{amsmath}
\newcommand{\uli}[1]{\underline{#1}}
\newcommand{\dund}[1]{\underline{\underline{#1}}}
\begin{document}
\begin{align*}
\uli{\varepsilon} &= \rlap{\uli{\phantom{\uli{D}}}}\uli{Du} \\
\uli{\smash\sigma} &= \rlap{\uli{\phantom{\uli{D}}}}\uli{D\varepsilon}
\end{align*}
\end{document}
Surely Minion Pro isn't provided by CTAN? Adobe owns that font. Do you mean the package that is on CTAN for use with the Adobe fonts?
Weird spacing problem
Hm, yes, you are right, it is a lot of work. And these constructions appear a lot, so not using Garamond isn't that bad here. Thank you for your code though!frabjous wrote:But that's a lot of work if you have a lot of these constructions popping up, and kind of an ugly kludge. If this is just a couple equations here and there, it might be worth it if you really had your heart set on Garamond/mathdesign.
Oh, yes, I know, I meant this version which I use.Surely Minion Pro isn't provided by CTAN? Adobe owns that font. Do you mean the package that is on CTAN for use with the Adobe fonts?
But could you add anything to my other question about the horizontal space, if possible?
OS: Win 7 64-bit LaTeX: MikTeX 2.9 64-bit Editor: TXC 1 RC1
Re: Weird spacing problem
I guess I don't understand the horizontal space question. Why should/would there be horizontal space there? In math mode, spaces in the code never do anything. The spacing is controlled by the semantic/syntactic nature of the symbols. If you wanted space, you'd have to put it in, or change the syntactic category of the symbols (with e.g., \mathalpha, \mathord, \mathop, \mathrel, \mathpunct, \mathleft, \mathright, etc.)
Weird spacing problem
Hm, yes, that makes sense.frabjous wrote:I guess I don't understand the horizontal space question. Why should/would there be horizontal space there? In math mode, spaces in the code never do anything. The spacing is controlled by the semantic/syntactic nature of the symbols. If you wanted space, you'd have to put it in, or change the syntactic category of the symbols (with e.g., \mathalpha, \mathord, \mathop, \mathrel, \mathpunct, \mathleft, \mathright, etc.)

OS: Win 7 64-bit LaTeX: MikTeX 2.9 64-bit Editor: TXC 1 RC1
Weird spacing problem
And when compiling this

I get this:
Man, this is annoying, because I have to use "8pt" as a global option. 
OS: Win 7 64-bit LaTeX: MikTeX 2.9 64-bit Editor: TXC 1 RC1
Weird spacing problem
This has nothing to do with the 8pt option. It's because of the \smash in the \und definition. My fault from some other thread, probably -- I probably shouldn't have recommended smash without telling you what it did. It basically makes LaTeX ignore what's inside the \smash{...} command when computing the vertical dimensions of something. This can be useful if you want to keep things level across different characters, etc., but can also create problems like this. As far as LaTeX knows, that K doesn't have any height, so it's overlining it too low.
You can make up its height by reinserting a \vphantom{K} which inserts the height of something without inserting that something; and then of course you'll need to smash that back down unless you want the superscript raised too. It's all very exhausting. Probably there's a better way, but I've never seen a document that uses so much overlining and underlining as the one you're apparently using.
You can make up its height by reinserting a \vphantom{K} which inserts the height of something without inserting that something; and then of course you'll need to smash that back down unless you want the superscript raised too. It's all very exhausting. Probably there's a better way, but I've never seen a document that uses so much overlining and underlining as the one you're apparently using.
Code: Select all
\documentclass[
8pt
]{scrartcl}
\usepackage[
notextcomp,
oldstylenums
]{kpfonts}
\newcommand{\dund}[1]{{\smash{\underline{\underline{#1}}}}}
\begin{document}
\begin{equation*}
\dund{T}^{T} \smash{\overline{\vphantom{K}\dund{K}}}^{(e)} \dund{T}
\end{equation*}
\end{document}
Weird spacing problem
Thank you this explanation, I appreciate it. But it's not your "fault", I looked for \smash online myself after reading this and it's actually explaiend in the Amsmath-manual -- which I should have read when you talked about \smash earlier. Thanks again.frabjous wrote:This has nothing to do with the 8pt option. It's because of the \smash in the \und definition. My fault from some other thread, probably -- I probably shouldn't have recommended smash without telling you what it did. It basically makes LaTeX ignore what's inside the \smash{...} command when computing the vertical dimensions of something. This can be useful if you want to keep things level across different characters, etc., but can also create problems like this. As far as LaTeX knows, that K doesn't have any height, so it's overlining it too low.
Well, yes, it's abit exhausting, but it's necessary, but at long sight, I think I'll redefine my underlining commands either to the ones provided bei ulem or delete the \smash.You can make up its height by reinserting a \vphantom{K} which inserts the height of something without inserting that something; and then
[...]
Well, it is a summary of a lecture notes which contains a lot of vectors/matrices and which I'll print out (like this). The notation of the vectors/matrices is the version with the underlinings, which I like more than the version with symbols formatted in bold.
OS: Win 7 64-bit LaTeX: MikTeX 2.9 64-bit Editor: TXC 1 RC1