1

This is a followup to my previous question How do I raise underlining within underlining? and I have indeed found a solution. My question is how can I predict the value I feed to \raisebox to adjust the underlining height? At present, I'm doing it purely by eye and looking at the result under magnification in my PDF viewer. The overall goal is to have the longer underlined "slot" the same height all the way across.

Here is my MWE and its output.

\documentclass{article}
\usepackage{xparse}

\NewDocumentCommand{\slot}{ s O{} }{%
  \IfBooleanTF {#1} % check for *
    {% * doesn't print a filled slot.
      %\,\smash{\makebox[1.5em]{\ensuremath{#2}}}\,
      {\,\makebox[2.0em]{\ensuremath{#2}}\,}
    }%
    {% Print a filled slot by default, a la Thorne and Blandford.
      %\,\underline{\smash{\makebox[1.5em]{\ensuremath{#2}}}}\,
      %\,\underline{\makebox[2.0em]{\ensuremath{#2}}}\,
      \,\underline{\makebox[2.0em]{\ensuremath{\raisebox{0.5pt}{\ensuremath{#2}}}}}\,
    }%
}%

%\newcommand*{\smallslot}{\,\underline{\smash{\makebox[0.04em]{\ensuremath{~}}}}\,}
%\newcommand*{\smallslot}{\,\underline{\makebox[0.80em]{\ensuremath{}}}\,}
%\newcommand*{\smallslot}{\,\underline{\makebox[0.50em]{\ensuremath{}}}\,}
\newcommand*{\smallslot}{\raisebox{2.3pt}{(\,\underline{\makebox[0.53em]{\ensuremath{}}}\,)}}

\begin{document}
\[
  \mathbf{a}(\slot) \quad 
  \mathbf{a}(\slot[\raisebox{0.5pt}{\ensuremath{\mathbf{b}}}]) \quad
  \mathbf{a}(\slot[\mathbf{b}\smallslot]) \quad
  \mathbf{a}(\slot[\mathbf{b}\smallslot])
\]
\[
  \mathbf{T}(\slot,\slot) \quad 
  %\mathbf{T}(\slot[\raisebox{0.5pt}{\ensuremath{\mathbf{b}}}],\slot) \quad
  \mathbf{T}(\slot[\mathbf{b}],\slot) \quad
  \mathbf{T}(\slot[\mathbf{b}\smallslot],\slot) \quad
  %\mathbf{T}(\slot[\mathbf{b}\smallslot]\slot)
\]
\end{document}

Compiled MWE output

6
  • I'm not sure I understand the question. Currently all the large slots are at the baseline and all the small slots are 2.3 points above the baseline. Is that not what you want? Additionally here you set the first b 0.5pt higher, why is that? If you leave it at the natural height (\mathbf{a}(\slot[\mathbf{b}]) then it looks ok, and additionally it is at the same height as all the other occurrences of b, which seems desirable. So which examples from your code are wrong, or are wrong when not setting the height, and why?
    – Marijn
    Aug 8, 2020 at 20:05
  • @Marijn To clarify, how can I know in advance what to use where I used 0.5pt? I arrived at that value by trial and error and visual inspection. Is there a way to calculate or predict that value? Aug 8, 2020 at 20:08
  • But why do you want to raise that b 0.5pt? Now it is higher than the next b.
    – Marijn
    Aug 8, 2020 at 20:10
  • @Marijn I'm sorry for not being clear. All I want to do is make the inner content, including the inner underline, to be at the same height without pushing the outer (larger) underline downward. Adjusting that 0.5pt was the only thing I tried that seemed to work. The larger underlines must all be at the same level regardless of what else is present. I may be misunderstanding something. Aug 8, 2020 at 20:21
  • @Marijn I think I see your point now. Maybe I need to change what's inside the raised box to NOT include the b. Aug 8, 2020 at 20:25

0

You must log in to answer this question.

Browse other questions tagged .