Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary[positioning]

\begin{document}

\begin{tikzpicture}
[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] {};%
\end{tikzpicture}

\end{document}

latexExample

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
1  
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
add comment

1 Answer

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 –  Jérémy Bulle May 11 '13 at 8:38
add comment

Your Answer

 
discard

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.