I would like to add a tikz node within a text in such a way that it doesn't add space between the lines. In particular, I'd like to animate (in beamer) a frame around the text without it taking space.
Below is an example of what I'm trying to do.
Many thanks in advance!
\documentclass{beamer}
\usepackage{tikz}
\tikzset{
alt/.code args={<#1>#2#3}{%
\alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}}
},
BeamerAlert/.style={alt=#1{draw=red,thick,rounded corners}{},anchor=base}
}
\newcommand<>{\tikzMe}[1]{
\tikz[baseline]\node[BeamerAlert=#2] {${#1}$};
}
\begin{document}
\begin{frame}
This is an \tikzMe<2>{\mathsf{example}} of
text with the space between lines changed because of the tikz
node. Here is another line whose spacing is natural.
\end{frame}
\end{document}
inner sepand see what happens. – Claudio Fiandrino Sep 17 '13 at 08:47\tikzMefrom Qrrbrbirlbel's answer in: Highlighting in beamer using TikZ nodes. That's fine, but you can not fine tune the portion of the highlighted area. Indeed, with the styles I defined in the other answer, that's possible; a practical implementation is: Beamer overlay box around text - the correct way?. See in the animation how the highlighted space around of the text changes. – Claudio Fiandrino Sep 19 '13 at 07:43