I'm trying to make a command that creates a box as seen in the picture below:

enter image description here

I've used minibox but the results aren't exactly the same. Here's what I've done:





And here's the result:

enter image description here

The black box in my case is a bit smaller than the height of the gray. How can I make them the same size? Any ideas are welcome, it's not necessary to use minipage I just couldn't think of anything else.

Thanks in advance!

1 Answer 1


See if the following redefinition of your command is what you after. It consider that in gray box is only one line text or no text.:





enter image description here

(red lines indicate text borders)

  • Excellent! Thank you very much! Feb 14, 2022 at 14:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .