I want to display random strings made up of 's' and 'f' such that every s is white on a blue background and every f is white on a red background. I can make it work fine in normal text, but when I want to display it in \scriptsize it seems to not get small enough.
The code I'm using is:
\newcommand{\ss}[0]{\colorbox{blue}{\textcolor{white}{{\texttt{\scriptsize{s\strut}}}}}}
\newcommand{\ff}[0]{\colorbox{red}{\textcolor{white}{{\texttt{\scriptsize{f\strut}}}}}}
and then when I want to show a string I write something like:
\ss\ff\ss\ff\ff\ff\ss\ss
\ss
is an already defined LaTeX macro, so your code is generating errors? Correcting that, this seems to work fine:\documentclass{article} \usepackage{xcolor} \newcommand{\sss}[0]{\colorbox{blue}{\textcolor{white}{{\texttt{\scriptsize{s\strut}}}}}} \newcommand{\ff}[0]{\colorbox{red}{\textcolor{white}{{\texttt{\scriptsize{f\strut}}}}}} \begin{document} sf \sss\ff\sss\ff\ff\ff\sss\sss \end{document}