I have a way to denote functors in my articles. To do so I use the following piece of code:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
\usetikzlibrary{decorations.pathreplacing}
\begin{document}
\begin{tikzpicture}[>=stealth]
\draw[->] (2,0)--(4,0);
\draw[->] (1.2,-1.26)--(1.2,-2.8);
\draw[->] (4.8,-1.26)--(4.8,-2.8);
\draw[|->] (2,-1)--(3.6,-1);
\draw[|->] (2,-2)--(3.6,-2);
\draw[|->] (2,-3)--(3.6,-3);
\node at (0, 0) {${F}:$};
\node at (1.2, 0) {${\mathbf{Top}}$};
\node at (4.8, 0) {${\mathbf{Set}}$};
\node at (1.2, -1) {${(X, \tau)}$};
\node at (1.2, -3) {${(Y, \sigma)}$};
\node at (1, -2) {${f}$};
\node at (4.8, -1) {${X}$};
\node at (4.8, -3) {${Y}$};
\node at (5.4, -2) {${f}$};
\draw[decoration={brace,mirror,raise=6pt},decorate,line width=1pt]
(5.6,-3.2)--(5.6,-0.8);
\draw[decoration={brace,mirror,raise=6pt},decorate, line width=1.2pt]
(6,-3.2)--(6,0.2);
\end{tikzpicture}
\end{document}
This draws the picture. But I have to do this each time afresh and hence
I want to make this as a template with \newcommand in LaTeX. When I try to do so, how do I make sure that the braces do not overlap with the nodes just on its left? Note: the nodes can be of variable width, depending on the objects of a category.

\documentclassand ending on\end{document}... We miss libraries to compile – koleygr Sep 01 '18 at 11:31