5

I'm a high school teacher, and I usually prepare class tests with LaTeX. I face the following problem: I can organize text so that - let's say - from 4 to 8 (different in content, but with the same pattern and space occupation) tests can be contained in a page. The first halves of the tests on one side, the second halves of the tests on the back, so that duplex printing permits to cut the paper in stripes containing each a whole test text (half on one side of the stripe, half on the back).

For the moment, I'm splitting and adjusting the heights manually, so that the two halves have the same height on the front and back side of the sheet, splitting the whole test appropriately. I'm working (very much) with \vspace, \\[....] etc.

It would be very helpful for me to have something like an environment

\begin{duplexprint}

<< Text of the test >>

\end{duplexprint}

That automatically divides the << Text of the test >> in two parts with equal height (or minimizing the difference of the two heights), putting the first half where it should currently appear, and the second in the following page, at the same height. The following page can contain text above it. My idea, actually, would be to have something like

\begin{duplexprint}

\item << Text of test 1 >>

\item << Text of test 2 >>

...

\item << Text of test n >>

\end{duplexprint}

so that the result is something like this - see front and back side on https://testlatex.jimdo.com/

I hope I was sufficiently clear. Do you think is it feasible? Can I use some already available command (or combination of commands) or should a new package be written?

2

This is not the fully automated solution you hoped for, but it may be helpful.

The idea is to lay out the questions on pages with a very small height and then assemble them in a second file, using pdfpages.

Here you only have to adjust paperheight and textheight of the first file and the textheight of the second. This is done using geometry. The textheight in the first file should be a little smaller then the pageheight in order to get a bit of white space above and below the text. Paperwidth and textwidth are the same in both files.

The lines for cutting are realized using pdfpages option frame.

The first file containing the questions:

\documentclass[10pt]{article}
\usepackage{geometry}
\usepackage{multicol}

\geometry{paperheight=4cm,paperwidth=21cm,textheight=3.2cm,textwidth=15cm,centering}
\pagestyle{empty}
\parindent0pt

\begin{document}
\textbf{Math Question 1}
\begin{multicols}{2}
\begin{enumerate}
\item Subquestion 1 \[1 + 1 =\]
\item Subquestion 2 \[1 + 2 =\]
\item Subquestion 3 \[1 + 3 =\]
\item Subquestion 4 \[1 + 4 =\]
\item Subquestion 5 \[1 + 5 =\]
\item Subquestion 6 \[1 + 6 =\]
\item Subquestion 7 \[1 + 7 =\]
\item Subquestion 8 \[1 + 8 =\]
\end{enumerate}
\end{multicols}

\textbf{Math Question 2}
\begin{multicols}{2}
\begin{enumerate}
\item Subquestion 1 \[2 + 1 =\]
\item Subquestion 2 \[2 + 2 =\]
\item Subquestion 3 \[2 + 3 =\]
\item Subquestion 4 \[2 + 4 =\]
\item Subquestion 5 \[2 + 5 =\]
\item Subquestion 6 \[2 + 6 =\]
\item Subquestion 7 \[2 + 7 =\]
\item Subquestion 8 \[2 + 8 =\]
\end{enumerate}
\end{multicols}

\textbf{Math Question 3}
\begin{multicols}{2}
\begin{enumerate}
\item Subquestion 1 \[3 + 1 =\]
\item Subquestion 2 \[3 + 2 =\]
\item Subquestion 3 \[3 + 3 =\]
\item Subquestion 4 \[3 + 4 =\]
\item Subquestion 5 \[3 + 5 =\]
\item Subquestion 6 \[3 + 6 =\]
\item Subquestion 7 \[3 + 7 =\]
\item Subquestion 8 \[3 + 8 =\]
\end{enumerate}
\end{multicols}

\textbf{Math Question 4}
\begin{multicols}{2}
\begin{enumerate}
\item Subquestion 1 \[4 + 1 =\]
\item Subquestion 2 \[4 + 2 =\]
\item Subquestion 3 \[4 + 3 =\]
\item Subquestion 4 \[4 + 4 =\]
\item Subquestion 5 \[4 + 5 =\]
\item Subquestion 6 \[4 + 6 =\]
\item Subquestion 7 \[4 + 7 =\]
\item Subquestion 8 \[4 + 8 =\]
\end{enumerate}
\end{multicols}

\textbf{Math Question 5}
\begin{multicols}{2}
\begin{enumerate}
\item Subquestion 1 \[5 + 1 =\]
\item Subquestion 2 \[5 + 2 =\]
\item Subquestion 3 \[5 + 3 =\]
\item Subquestion 4 \[5 + 4 =\]
\item Subquestion 5 \[5 + 5 =\]
\item Subquestion 6 \[5 + 6 =\]
\item Subquestion 7 \[5 + 7 =\]
\item Subquestion 8 \[5 + 8 =\]
\end{enumerate}
\end{multicols}

\textbf{Math Question 6}
\begin{multicols}{2}
\begin{enumerate}
\item Subquestion 1 \[6 + 1 =\]
\item Subquestion 2 \[6 + 2 =\]
\item Subquestion 3 \[6 + 3 =\]
\item Subquestion 4 \[6 + 4 =\]
\item Subquestion 5 \[6 + 5 =\]
\item Subquestion 6 \[6 + 6 =\]
\item Subquestion 7 \[6 + 7 =\]
\item Subquestion 8 \[6 + 8 =\]
\end{enumerate}
\end{multicols}

\end{document}

This results in pages like this:

enter image description here

The second file assembles these pages. Here nup=1x6 arranges the pages in one columnn and 6 rows. The 6 has to be adapted to the number of questions per sheet of paper. And for each page one \includepdf line is needed.

\documentclass[10pt]{article}
\usepackage{geometry}
\usepackage{pdfpages}

\geometry{paper=a4paper,textheight=24cm,textwidth=15cm,centering}

\begin{document}
\includepdf[pages={1,3,5,7,9,11},nup=1x6,frame]{first-file}
\includepdf[pages={2,4,6,8,10,12},nup=1x6,frame]{first-file}
\end{document}

This results in these pages:

enter image description here

  • I'm using GP-Pari to generate the numbers in my questions: the LaTeX file I use is actually "automatically" generated (written on a file and then pdflatex-ed by commands in a GP-program of mine). Your solution should therefore, with a minimum of adjustments in my current program, be more in the direction of what I need: the new point is that I can decide in advance the height of each question (so that if duplex-ly fits, obviously), and the only "centralized" thing that should be set to have a satisfactory final result are the parameters paperheight,paperwidth, etc. I'll try next week, thanks ! – Alberto Oct 21 '17 at 8:41
  • Anyway...does anyone knows if there a command or an environment that can splits texts in two blocks that can be put not aside one other (as the multicols environment does) but, so to say, one half above the other or one half on a page, the other half on another page ? – Alberto Oct 21 '17 at 8:50
  • @Alberto be aware, that geometry does not allow to change the paperheight mid document. So you need different files for questions with different heights. But of course you only need one file to assemble them. – Mike Oct 23 '17 at 0:44
  • I'm lucky, because I'll prepare tests having all the same height. After some work, I was able to organize everything following your advice. Now the "frame" is ready and correct: after some final pdf pages shuffling everything is quite fine. Now I can finally just prepare the questions and setting the heights and the number of tests I want on a page so that the duplex printing satisfies me: no more manual splitting of questions into two blocks (front and back sides). That's what I wanted. Maybe it is not fully automated, but It's more than sufficient for my needs. Thank you one thousand times. – Alberto Oct 23 '17 at 16:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.