# 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[mathbf{b}smallslot])
]
[
%mathbf{T}(slot[mathbf{b}smallslot]slot)
]
end{document}


## Related Questions

### Combining images side by side with overlays in beamer

1  Asked on December 22, 2020 by zed

### Need help for environment

1  Asked on December 22, 2020

### text under the section title without spacing

1  Asked on December 22, 2020 by el-musleh

### References in names and descriptions of embedded files with navigator

1  Asked on December 22, 2020

### Write a macro to define a new command and locally invoke it

2  Asked on December 22, 2020

### Place a heading at the top of a page on the grid

0  Asked on December 22, 2020

### How to put Figure with caption next to text in beamer

1  Asked on December 22, 2020 by eugens

### the spell checker has no dictionaries lyx 2.1.0 (windows7)

1  Asked on December 22, 2020 by user54800

### Issue with the item command

1  Asked on December 22, 2020 by l-faros

### remove pagebreak after part

2  Asked on December 22, 2020 by peter-staab

### Citation showing “a” “b” like (2018a) and (2018b) when the author list is different

1  Asked on December 22, 2020 by user1849133

### Change url font size

0  Asked on December 22, 2020 by rmshoeb

### Parbox on the table not vertically centered and remove space before enumeration but topsep=0pt failed

1  Asked on December 22, 2020

### Should I place my preamble on a .tex file or on a .sty file

1  Asked on December 22, 2020 by crazytelli

### How can I patch mintinline to work with breaklines and mathmode?

0  Asked on December 22, 2020

### How to make the transition from LaTeX2e to expl3 syntax?

0  Asked on December 21, 2020 by yiannis-lazarides

### Numbered ordering of multiple citations

2  Asked on December 21, 2020 by samaursa

### legend={text={ multi line

1  Asked on December 21, 2020 by jota-aguilar

### What do floats mean?

0  Asked on December 21, 2020 by neo