The numbers in the following itemized list are not aligned with the text:

Vertically Offset Bullet List


It is possible to adjust the vertical alignment using the offset command:

% Itemized bullet list

However, the calculation of either y=0.2\baselineskip or y=0.2\lineheight does not quite vertically align the number and its background to the text.


How would you vertically align the number of an itemized list such that:

  • the number is vertically aligned within the frame; and
  • the frame is vertically aligned to the itemized text?


I have tried:

  • location=middle - produces a frame that is much too low
  • command=\vcenter - no discernible effect
  • \offset[y=0.15\baselineskip]{% - comes closest:

Offset Numbers

In the above image, the numbered item should be 2px higher with respect to the \framed object, while the y value for the offset is almost perfect (I am concerned that varying the font and its size will cause the alignment to be off; that is, it's a fragile calculation that should use a constant rather than a magic number of 0.15).


A complete example that shows the problem:


% Defines the frame style for bullets. This replaces the leader dots in the
% ToC as well as provides the starting point for all squares.

% Defines the bullet as a symbol, which can be used with bullet lists.

% Defines the bullet as a symbol, which can be used with numbered lists.
% Twice small to ensure the number fits inside the bullet.

\define[1]\instruction{\startitem #1. \stopitem}


    \instruction{Set up the video camera's tripod at the hallway door}
    \instruction{Start the video recorder}
    \instruction{Make sure the path to the hallway door is unobstructed}
    \instruction{Ensure both laces on your running shoes are tied tight}
    \instruction{Check that nobody else is in the room}
    \instruction{Don safety goggles}
    \instruction{Using metal serving tongs, hold the sodium over the water}
    \instruction{Drop the sodium into the water}
    \instruction{Run to the hallway}
    \instruction{Prepare to call the fire department}
    \instruction{Upload video to YouTube}



1 Answer 1


ConTeXt already has a mechanism to ensure that a \framed aligns with the text baseline: \framed[location=low]{...}. However, this mechanism fails when you explicitly set the height of the frame. So what you need to do is not set the height of the frame, rather change the height of the background. For example,



   newpath basicShape;
   basicShape := unitsquare ;

   DefaultLineHeight := \defaultlineheight;

\startuseMPgraphic {unnumberedbullet}
  fill basicShape scaled OverlayWidth shifted (0, 0.5*LineHeight)
       withcolor \MPcolor{red};
  setbounds currentpicture to OverlayBox;

    \startuseMPgraphic {numberedbullet}
      fill basicShape xyscaled (0.9*DefaultLineHeight, 0.9*DefaultLineHeight)
      shifted (-0.5(0.9*DefaultLineHeight - OverlayWidth, 0))
           withcolor \MPcolor{green};
      setbounds currentpicture to OverlayBox;

\defineframed [unnumberedbullet]


\defineframed [numberedbullet]
                % Center the number against capital letters, ignoring character descent
                foregroundstyle={\small\small}, % better to define a custom fontswitch


     \item One
     \item Two
     \item Three

     \item gpat
     \item Two
     \item Three


which gives

enter image description here

To change the shape of the bullets, change basicShape := unitsquare to any other shape. For example, to get a circle, use basicShape := unitcircle.

  • Thank you, Aditya. I noticed that 2-digit numbers touch the edges of the bounding box. Is there a way to ensure the box always fits (whether 1, 2, or 3 digits)? Or is the only way to use 1.5em, or the like? Aug 25, 2013 at 19:57
  • 1
    Add frame=on to see what is happening. You cannot have a square box with a given width and a given height. Pick two out of the three.
    – Aditya
    Aug 25, 2013 at 20:08

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.