I have created a new command using colorbox as follow:

\newcommand{\resheading}[1]{{\small \colorbox{mygrey}{\begin{minipage}{0.975\textwidth}{\textbf{#1 \vphantom{p\^{E}}}}\end{minipage}}}}

This is how it looks: enter image description here

Is there a way to increase the spacing between resheading and the bullet point? Any help is greatly appreciated.

  • Also, a newline is just too much – subtleseeker Jul 6 '19 at 13:51

The following adds 5pt of additional vertical space:





something else

How it works:

  1. we set the results of the \colorbox command into a box, it is not directly printed (\sbox\resheadingbox{...}).
  2. we enlarge this box by 5pt to the bottom (\dp\resheadingbox=\dimexpr\dp\resheadingbox+5pt\relax, I left out the optional =), for this enlargement TeX pads whitespace.
  3. we output the contents of the box register (\usebox\resheadingbox)

I also changed the width of your minipage, such that the \colorbox will be as wide as possible without sticking into the margin (a \colorbox adds an \fboxsep on both sides as padding, we use the width of a full line minus those 2\fboxsep). Also I used \strut as vertical padding inside the \colorbox instead of your \vphantom{...} construct, a \strut has zero width and the height and depth such that it is as big as your fontsize.

enter image description here

  • It works exactly as needed! Could you explain what is happening here? For what I can understand is that you added a box to create some whitespace. I am new to LaTeX. – subtleseeker Jul 6 '19 at 14:16
  • @subtleseeker I've added a small explanation. Anything else you don't understand? – Skillmon Jul 6 '19 at 14:31
  • Thanks, this helped! – subtleseeker Jul 6 '19 at 14:35
  • To whomever downvoted my answer: Do you want to explain why you downvoted this and what you want me to improve? – Skillmon Jul 7 '19 at 6:38

I propose this simple code, based on the shaded* environment from the framed package:


\colorlet{shadecolor}{Gainsboro!50! Lavender}

     \end{shaded*}\noindent }%


Blah blah blah… blah blah blah…
Some text. Some more text.


enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.