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.

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

1 Answer

up vote 14 down vote accepted

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

\documentclass{article}
\usepackage{tikz}
\begin{document}
the distance \tikz[baseline=-0.5ex]{ \draw [|-|] (0,0) -- (5ex,0); } overarching the activities
\end{document}

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
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.