# Label above node in TikZ

I wish to add a label above a node that already contains a label.

\begin{tikzpicture}[scale=0.8,every node/.style={draw=black,circle}]
\node (a) at (0,0) {a};
\node (b) at (2,0) {b};
\draw[->] (a) to (b);
\end{tikzpicture}


The markup above will give me this:

But I want something like this:

Is there any easy way to solve this? I am not looking for solutions using \tikzlibrary{background}

• Welcome to TeX.SX! Try: \node (a) [label=above:{1/16}] at (0,0) {a}; BTW, next time please provide a complete minimal working example (MWE) including \documentclass and \begin{document}, \end{document} and the packages you loaded. – Pier Paolo Dec 10 '14 at 21:02

Actually, tikz nodes have text inside and labels outside:

\documentclass{standalone}
\usepackage{tikz}
\begin{document}

\begin{tikzpicture}[scale=0.8,every node/.style={draw=black,circle}]
\node[label={\small 1/16}] (a) at (0,0) {a};
\node (b) at (2,0) {b};
\draw[->] (a) to (b);
\end{tikzpicture}

\end{document}

• Let me noted: since label is node, its features is influenced by options determined in every node style. To see this, change every node/.style={draw=black,circle} to every node/.style={draw, red,circle} ... Therefore it is sensible in similar cases to define labels' style with something as every label/.append style={rectangle, font=\small}. – Zarko Apr 20 '17 at 20:40

A PSTricks solution using the pst-node (for the drawing itself) and xfp packages (for the floating point calculations):

\documentclass{article}

\usepackage{pst-node}
\usepackage{xfp}

% parameters
\def\arrowLength{1.8}

\begin{document}

% change 0.35 in the calculation of the height of the bounding box
% according to the contents on top of the node

• \ncline{->}{A}{B} – user2478 Dec 11 '14 at 21:38