3

I'm currently trying to realize an annotation on a TikZ plot, where I point out a limiting value (see picture below). Limiting value

\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}
    \draw [stealth-,thin] (0,0.9)-- +(16pt,0pt) node[right,font=\footnotesize] 
            {Limiting value: $\lim\limits_{x\rightarrow 0}\omega=0$};
\end{tikzpicture}
\end{document}

The problem that I have is that when I draw a line that connects to the node, my west anchor is not neatly centered to the text, but to the entire node.

Question: How can I get the alignement of my anchor in such a way that the arrow is nicely centered to the text rather than to the entire node?

Nick
  • 279
  • While code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it.

    This is especially important for tikz as there are numerous libraries.

    – Peter Grill Nov 16 '16 at 09:34
  • @PeterGrill Alright, I will remember this, thanks for the tip! The reason I did not do this was because the fact that I did not use any packages, but still it's better to give a complete question. So consider the question edited. – Nick Nov 16 '16 at 10:00

1 Answers1

4

One way is to use \smash on the text which you don't want to affect the plcement of the node. Alternatively, you could place the node in two steps:

enter image description here

Code:

\documentclass{article}
\usepackage{tikz}

\begin{document} \begin{tikzpicture} \draw [stealth-,thin] (0,0.9)-- +(16pt,0pt) node[right,font=\footnotesize] {Limiting value: \smash{$\lim\limits_{x\rightarrow 0}\omega=0$}}; \end{tikzpicture}

\medskip \begin{tikzpicture} \draw [stealth-,thin] (0,0.9)-- +(16pt,0pt) node[right,font=\footnotesize] (A) {Limiting value:}; \node [anchor=west,font=\footnotesize, inner sep=0pt] at (A.east) {$\lim\limits_{x\rightarrow 0}\omega=0$}; \end{tikzpicture} \end{document}

Peter Grill
  • 223,288