I would like to take two lines of column-aligned text (double-stranded DNA data) and add some boxes around some of the text, and additional labels. I normally use tikz for this kind of figure, but I am having difficulties retaining the column-aligned text in tikz.
ATTGGNAGCAGAACCCCATGCGCTGGCGCGGCTACGACAGCTAACTTGAGA...
...AGATAACNNTCGTCTTGGGGTACGCGACCGCGCCGATGCTNTCGATTGAAC
I have tried using a Verbatim (fancyvrb) and verbatim environment inside a tikz node, but this has compilation errors like this question.
\documentclass{beamer}
\usepackage{tikz}
\usepackage{fancyvrb}
\begin{document}
\begin{frame}[fragile]
\frametitle{Duplicates}
\begin{tikzpicture}
\node[align=left]{
\begin{Verbatim}
ATTGGNAGCAGAACCCCATGCGCTGGCGCGGCTACGACAGCTAACTTGAGA...
...AGATAACNNTCGTCTTGGGGTACGCGACCGCGCCGATGCTNTCGATTGAAC
\end{Verbatim}
};
\end{tikzpicture}
\end{frame}
\end{document}
! LaTeX Error: Something's wrong--perhaps a missing \item.
l.4 \begin{Verbatim}
The question above is marked as a duplicate of a question whose answer indicates to use \Verb
, which is not appropriate for my long strings.
I have also tried to use \texttt
within a tikz node, but this does not align correctly.
\node[align=left]{
\texttt{ ATTGGNAGCAGAACCCCATGCGCTGGCGCGGCTACGACAGCTAACTTGAGA...}\\
\texttt{...AGATAACNNTCGTCTTGGGGTACGCGACCGCGCCGATGCTNTCGATTGAAC}
};
I have also considered using a tikz matrix, but this seems overly complicated with one node per letter.
Is there a relatively simple way of achieving the aligned text with drawing features?