This is a follow-on question to a previous question on SE where it was suggested I create a new question.
Question: How to add lines (NOT a box) above and below non-verbatim text while maintaining access to ALL the traditional LaTeX text attributes including but not limited to fontfamily, fontshape (including italics, bolding, etc.), text color, etc.
This would include the ability to control the attributes of the lines above and below (together or separately) including but not limited to the line thickness, separation (above and/or below, together or separately) of the lines from the text, the color(s) of the lines (together or separately, single or progressive), and the fill color(s) (single or progressive) between the lines.
The numerous SE questions and answers I've reviewed do NOT meet the criteria I am looking for.
I've been able to meet a few of the above requirements using a combination of verbatim and fancyvrb in the following MWE:
\documentclass[varwidth]{article}
\usepackage{fancyvrb}
\usepackage{varwidth}
\usepackage{verbatim}
\usepackage{xcolor}
\begin{document}
{\centering
\begin{varwidth}{0.33\linewidth}
\begin{Verbatim}[commandchars=\{}, fontfamily=courier, fontshape=it, numbers=none, frame=lines, framerule=0.7mm, framesep=3mm, rulecolor=\color{red}, fillcolor=\color{yellow}]
\textbf{Source} \textrightarrow \textbf{Migration}
\end{Verbatim}
\end{varwidth}
\par}
\end{document}
which results in:
However, if I try to substitute $\rightsquigarrow$ for \textrightarrow, I get the following LaTeX error:
Undefined control sequence.
<argument> Source $\rightsquigarrow
$ Migration
l.12 Source $\rightsquigarrow$ Migration
So for some reason, my attempt to insert the equivalent of an Inline Equation results in an error.
Also, my attempt to fill in the space between the two lines (e.g. fillcolor=\color{yellow}) fails when employing the above verbatim and fancyvrb code.
As outlined in the previous question on SE, I am attempting to reproduce the image that appeared in Dr. Thomas F. Sturm's sanitize-umlaut package for verbatim text:
but for straightforward, run-of-the-mill, non-verbatim text (e.g. \textbf{}, $<equation>$, etc.).
I'm looking for a way to present text in the format (displayed above) in Sturm's documentation without the limitations I've encountered when using verbatim based code.
(Special thanks to egreg and Marcel Krüger for their assistance!)
Thanks for reading.






\rightsquigarrowis a symbol that is not available in base latex. You have to load one of the symbol fonts to access it (e.g.amssymb). But even if you load the font, compilation will still fail, but this time because the math environment. – Willie Wong Jul 14 '22 at 01:24frame=linesbyframe=singlethe color shows up. If you replace byframe=leftlineyou see a bit of an issue: the color only shows between the left line and the start of verbatim text. – Willie Wong Jul 14 '22 at 01:40