TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to vertically align sans serif font with a rectangle. The following code show the problem:




[mainbullet/.style={rectangle, minimum size=0.25cm,draw=orange, fill=orange,thick}, 
categoryssf/.style={font=\sffamily, orange!100, draw, thin, inner sep = 0, outer sep = 0.0},
category/.style={orange, draw, thin, inner sep = 0}]
\node[categoryssf] (experiencecat) at (0,0) {Experience};
\node[mainbullet] (experiencebullet) [below=1mm of experiencecat.south west, anchor=north west] {};
\node[category] (experiencecat) at (0,1) {Experience};
\node[mainbullet] (experiencebullet) [below=1mm of experiencecat.south west, anchor=north west] {};%



The alignment is ok for serif font but not sans serif font as the bounding box is still positionned as if there was a serif in the font.

Is there a way to correctly align sans serif font with the side of the rectangle ?

share|improve this question
I am not sure if I understand the question correctly. Wouldn't adding anchor=west to both "Experience" nodes give you the desired result? – Gonzalo Medina May 10 '13 at 21:08
up vote 1 down vote accepted

It seems that some letters such as "E", "F", ... of this sans font are designed with a small space in front. I've tried "A", "X", ... and there's no space.

You can manually fix this problem by {\kern-0.2ex Experience}, or simply try other fonts.

share|improve this answer
the kern code does the thing. I tried multiple fonts I liked but many sans serif seems to have this leading space for the "E" letter – FenryrMKIII May 11 '13 at 8:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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