In TikZ, there are draw=none
and fill=none
options to turn off stroking and filling operations. However, there doesn't appear to be a corresponding text=none
option. If I try \tikz \node[text=none] {X};
, I get the error message "Package xcolor Error: Undefined color `none'." (The text=red
option does work as expected.)
- Is there indeed no
text=none
option? - What are alternatives? Is it reasonable to use
text opacity=0
, or is there something better?
I'm asking because I would like to create an "empty" node of the same size as a given image or text. By referencing the anchors of this "empty" node, I can then animate the image or text moving in to occupy the same space. The following is an example of what I'm trying to accomplish. It uses text opacity=0
based on @percusse's suggestion.
\documentclass{minimal}
\usepackage{animate}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{animateinline}[autoplay,loop]{10}
\multiframe{11}{iframe=0+1}{
\begin{tikzpicture}[every node/.style={draw}]
\node[text opacity=0] (source) {Text};
\node[text opacity=0] (target) at (2,2) {Text};
\node at ($(source)!\iframe/10!(target)$) {Text};
\end{tikzpicture}
}
\end{animateinline}
\end{document}
- Given this ultimate goal, is it preferable to use something like
\node {\phantom{Text}};
?
minimum width
, andinner sep
, as percusse said, instead of fiddling around with strings of text that have the right size.text opacity
key is the most practical..pdf
. Opacity leaves the text selectable but\phantom
doesn't.