6

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}
Micha
  • 2,869

1 Answers1

11

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}