The v0.8 of adjustbox from 2011/11/14 has now a \stackbox[<hor>][<vert>]{<content>} macro (and a matching stackbox environment and stack key). It accepts vertical and horizontal alignment and uses the varwidth package internally.
To remove the usual skip between lines, you can use \baselineskip=0pt at the begin and \par at the end. I might add an option for this later.
\documentclass{article}
\usepackage{adjustbox}
\begin{document}
surrounding text
\fbox{\stackbox[r][t]{something\\something else\\foo}}
surrounding text
surrounding text
\fbox{\stackbox[l][b]{something\\something else\\foo}}
surrounding text
surrounding text
\adjustbox{stack=cc,fbox}{something\\something else\\foo}
surrounding text
% No interline skip:
surrounding text
\fbox{\stackbox[c][b]{\baselineskip=0pt something\\something else\\foo\par}}
surrounding text
\end{document}
Best Answer
Here is a version that uses the DNA sequence, splits it into the bases and does the complement as well, each stored in an
expl3
-\seq
variable.The display is done with
TikZ
and building up nodes, the5'
and3'
end markers are added later on.