This code draws sequence of words, each word in a separate block.
I want to manipulate it as one block. For example, how can I get next picture?
(I want to add $\rho$ in front of it).
\documentclass[border=3pt]{article}
\usepackage{tikz}
\usepackage{xstring,calc}
\usetikzlibrary{calc}
\newlength{\NodeSize}
\tikzset{DNA Style/.style={minimum size=0.5cm, draw=gray, line width=1pt, inner sep = 2pt}}{}
\newcounter{ColumnCounter}% Prefix for node labels
\newlength{\CurrentXPos}
\newcommand*{\PreviousNode}{}%
\newcommand*{\DNASequence}[2][Mark]{%
% https://tex.stackexchange.com/questions/12091/tikz-foreach-loop-with-macro-defined-list
\def\Sequence{#2}%
\def\PreviousNode{}%
\foreach [count=\xi] \Label/\Color in \Sequence {%
\IfStrEq{\Color}{}{\def\Color{white}}{}
\edef\NodeName{#1-\arabic{ColumnCounter}}
\IfStrEq{\PreviousNode}{}{%
\node [DNA Style, fill=\Color, anchor=west] (\NodeName) {\Label};
\xdef\PreviousNode{\NodeName}%
}{
\node [DNA Style, fill=\Color, anchor=west, xshift=-\pgflinewidth] at (\PreviousNode.east)(\NodeName) {\Label};
\xdef\PreviousNode{\NodeName}%
}
\stepcounter{ColumnCounter}
}
}%


label=left:{$\rho$:}in the options of the first node, maybe withlabel distance=.5cmor something like that. – Qrrbrbirlbel May 06 '13 at 08:43\IfStrEq. The correct syntax would be\DNASequence[mysec]{C/cyan, B/red}. But the\DNASequencedoesn’t reset theColumnCounter, so you might end-up withmysec-10instead of-0if the previous\DNASequencehad 10 nodes. – Qrrbrbirlbel May 06 '13 at 09:03\IfStrEqbut it does not draw two nodes. – ashim May 06 '13 at 09:16