I'm using LaTeX for writing math tests. Every task I wrap into an environment, which I defined like this:
\NewEnviron{beispiel}[1]{\begin{minipage}[t]{0.76\textwidth}
\BODY
\end{minipage} \hfill
\begin{minipage}[t]{0.1\textwidth} \begin{flushright} \small{\_\_\_/#1}\end{flushright}\addtocounter{punkte}{#1}\end{minipage}}
So I actually want two columns (with different width) and the left one includes the example and the right one includes the points for that example.
My environment works perfectly well, but I need automatic page breaks for long examples. Is there a way to do this?
I also tried out the longtable-package (no page breaks within a row) parcolumns-package (enumeration, vspace don't work) – but I didn't manage to get what I want.
Example:
\documentclass[a4paper,12pt]{report}
\usepackage{geometry}
\geometry{a4paper,left=18mm,right=18mm, top=3cm, bottom=2cm}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage{setspace}
\usepackage{environ}
\usepackage{blindtext}
\onehalfspacing
\newcounter{punkte}
\NewEnviron{beispiel}[1]{\begin{minipage}[t]{0.76\textwidth}
\BODY
\end{minipage} \hfill
\begin{minipage}[t]{0.15\textwidth} \begin{flushright} \small{\_\_\_/#1 Pkt.}\end{flushright}\addtocounter{punkte}{#1}\end{minipage}}
\begin{document}
\begin{enumerate}
\item \begin{beispiel}{3} %points of the example
\blindtext \\
\blindtext \\
\blindtext \\
\blindtext \\
\end{beispiel}
\end{enumerate}
\end{document}
I hope someone can help… Cheers
Best Answer
Almost always in such cases you need a list rather than minipages or tables.
here I use a list that borrows from
enumerate
anddescription
to handle the enumeration counter but use the optional argument of\item
to set the points.