How do I create boldface and subscripts in verbatim mode? I've seen mention of a fancyvrb
package that might be able to help. Can anyone provide working LaTeX code, either with or without fancyvrb
?
[Tex/LaTex] Boldface and subscripts in verbatim mode
boldsubscriptsverbatim
Best Answer
Using the
fancyvrb
package, with thecommandchars
option you can introduce escape sequences in verbatim code; in particular, you can get boldfaced fonts (provided you are using a suitable font. Using thecodes
option you can specify catcode changes ; in particualr, this allows you to include formatted mathematics in verbatim text:Using the more powerful
listings
package, you can escape to LaTeX using theescapeinside
option and you can activate themathescape
option:The above solutions treted subscripts as mathematical expressions; you can get non-math subscripts using
\textsubscript
from thefixltx2e
package; a little example usingfancyvrb
: