AnswerBun.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!

Related Questions

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

   

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

     

increase the separation of two lines in double bonds using chemfig package

0  Asked on December 22, 2020 by ram-krishna-adhikari

     

Change url font size

0  Asked on December 22, 2020 by rmshoeb

   

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

1  Asked on December 22, 2020 by crazytelli

     

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

 

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir