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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.