I am trying to generate this in my document:
The goal is to have multiple lines that are aligned, which is why I used \texttt{}
. But using \colorbox{color}{text}
from the xcolor
package, this is what I get (don't mind the different font or color):
So my questions are:
- How can I remove the spacing inside the colorboxes?
- Is there a more elegant way of doing this?
This is my MWE:
\documentclass[parskip]{scrbook}
\usepackage{xcolor}
\begin{document}
\texttt{AjuC ER7 (R) (24)
E
\color{white}\colorbox{black}{VRAAGLNF}
\color{black}L
\color{white}\colorbox{black}{DVL}
\color{black}S
\color{white}\colorbox{black}{A}
\colorbox{gray}{M}
\colorbox{black}{GM}
\colorbox{red}{R}
\color{white}\colorbox{black}{P}
\color{black}DVEPGGVPR
\color{white}\colorbox{black}{LGGECA}
}\\
\texttt{AjuE ER9 (R) (24)
R
\color{white}\colorbox{black}{V}
\color{black}E
\color{white}\colorbox{black}{AAGLNFRDVL}
\color{black}VS
\color{white}\colorbox{black}{LG}
\color{black}G
\color{white}\colorbox{red}{R}
\color{black}ID--QS
\color{white}\colorbox{black}{D}
\color{black}EII
\color{white}\colorbox{black}{LGGECA}
}
\end{document}
\setlength{\fboxsep}{0pt}
.texshade
package, see ctan.org/pkg/texshade and tug.org/texshowcase/texshade-eg.pdf for an example.\setlength{\fboxsep}{0pt}
is that it also removes the vertical space in the box, which I would like to keep.