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

If I inline a bounded line segment like this:

the distance \tikz{ \draw [|-|] (0,0) -- (5ex,0); } overarching the activities

how can I make the line appear vertically centered on the line (automatically taking into account the line height).

share|improve this question
up vote 21 down vote accepted

You can directly tell where the baseline should meet the picture using the baseline option

the distance \tikz[baseline=-0.5ex]{ \draw [|-|] (0,0) -- (5ex,0); } overarching the activities

enter image description here

share|improve this answer
To get a better vertical alignment see this answer. – Claudio Fiandrino Jun 13 '12 at 16:42

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.