TransWikia.com

Using raisebox to change nested underlining

TeX - LaTeX Asked by LaTeXereXeTaL on November 9, 2020

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

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP