2

I have just install TeXlive 2020 listings have been changed and so lstlinebgrd seem not work. How can we get back the beautiful zebra effect?

\documentclass[12pt,a4paper]{article}
\usepackage{listings}
\usepackage{lstlinebgrd}
\lstset{%
    language=LaTeX[TeX],%
    basisstyle=\ttfamily,%
    linebackgroundcolor={%
        \ifodd\value{lstnumber}%
            \color{green}%
        \else%
            \color{yellow}%
        \fi}
}
\begin{document}
How can we get the zebra effect?
\begin{lstlisting}
$ \cos^{2}\alpha+\sin^{2}\alpha=1 $\\
$ a^{2}+b^{2}=c^{2} $\\
$ E=mc^{2} $
\end{lstlisting}
\end{document}
2

0

You must log in to answer this question.

Browse other questions tagged .