5

Am looking for an elegant way to include line numbers in my mdframed documents. Unfortunately, the following produces a 85 page docuement with \linenumbers (either before or after the \begin{mdframed}. Document is only 4 pages without the \linenumbers.

References:

  • Am ok with a post processing solution, but was not able to get Jake's solution from Add page and line numbers to a pdf to work. And yes I know that saying "it doesn't work" does not help to figure out what the problem is -- might post a separate question, but thought that using lineno package would be easier.

Code:

\documentclass{article}
\usepackage{lineno}
\usepackage{mdframed}
\usepackage{tikz}
\usepackage{lipsum}
\begin{document}
\begin{mdframed}\linenumbers
    \lipsum
    \begin{tikzpicture}
        \draw [fill=yellow!25] (0,0) rectangle (3,4);
    \end{tikzpicture}
    \lipsum
\end{mdframed}
\end{document}
Peter Grill
  • 223,288

0 Answers0