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 would like to place a TikZ node inside normal text to get the fancy boxes. But the box is on the same baseline. I would like to get the text on the baseline. What can I do?

\documentclass{article}

\usepackage{tikz}

\begin{document}

Not all characters are at the same baseline \tikz{\node [rounded corners,draw] {X};}

\end{document}
share|improve this question
    
Welcome to tex.sx! Note that you can format code blocks by preceding each line by 4 white spaces, or by selecting the block and clicking the {} button. –  T. Verron Feb 19 '13 at 15:22
3  
have you seen How to align a series of TikZ pictures at the baseline –  cmhughes Feb 19 '13 at 15:34

1 Answer 1

up vote 7 down vote accepted

You just have to use the key baseline with a named node to tell TikZ where is the baseline

The anchor of the baseline for a node is named base

\documentclass{article}
\usepackage{tikz}

\begin{document}
Not all characters are at the same baseline \tikz[baseline=(n.base)]{\node [rounded corners,draw] (n) {X};}
\end{document}
share|improve this answer

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.