Firstly, before posting my LaTeX code I will explain, what I want to have.
In one chapter I am introducing some kind of pseudo-code. The pseudo-code should be within a gray box and every line should have a number. Then a description is following, outside the gray box and without line numbers and then the next lines of pseudo-code are following (again in a gray box). The second pseudo-code example should continue with the line numbers, according to the first one. My problem, I have either a gray box or the line numbers. I tried it like that:
Code: Select all
\colorbox{hellgrau{
\parbox{\columnwidth}{
\textbf{pseudo-code 1}\par
\begin{linenumbers}
\textbf{create} text\par
\textbf{for each}text \newline
text \newline
text \newline
\end{linenumbers}
}
}
\colorbox
within the linenumbers
environment, the gray box is interpreted as one line. I already tried {minipage}
, but then the line numbers are not working.I am thankful for every advice!