How could I set up a verbatim-environment which has
- black background
- white text in scriptsize ?
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityHow could I set up a verbatim-environment which has
Here is a solution inspired by the code of the moreverb
package and using code lines of it:
\documentclass{article}
\usepackage{color}
\usepackage{verbatim}
\makeatletter
\def\inverseverbatim{%
\color{white}\scriptsize
\def\verbatim@processline{%
{\setbox0=\hbox{\the\verbatim@line}%
\hsize=\wd0 \the\verbatim@line\par}}%
\@minipagetrue
\@tempswatrue
\@totalleftmargin\z@
\setbox0=\vbox\bgroup \verbatim
}
\def\endinverseverbatim{%
\endverbatim
\unskip\setbox0=\lastbox
\egroup
\colorbox{black}{\box0}%
}
\makeatother
\begin{document}
Test:
\begin{inverseverbatim}
\begin{document}
\end{document}
\end{inverseverbatim}
\end{document}