如何在两个不同的页面上创建两个对应的列表,以便两个列表中的对应项目在两个页面上的绝对高度相同?我想解释我正在寻找的东西的最好方法是通过一个例子。一个中学数学竞赛 MATHCOUNTS 有时会在他们的问答页面上这样做。请参阅https://mathcounts.org/Page.aspx?pid=295。打开 2011 年州际竞赛冲刺赛和 2011 年州际竞赛答案 PDF。您会注意到,在答案上,答案是分开的,这样如果学生完成的试卷和答案并排排列,线条就会匹配,便于评分。
我甚至不知道如何开始...谢谢。
答案1
一种可能性就是在文档中放置一个开关,使用\rlap
和\vphantom
使问题消失,但在问题的位置留下垂直空间。
\documentclass{article}
\let\myrlap\relax
\let\myvphantom\relax
\newcommand\questionsoff{\let\myrlap\rlap\let\myvphantom\vphantom}
%
\begin{document}
%\questionsoff % <--- activate to create answer sheet
\noindent
\myrlap{\myvphantom{\begin{minipage}[t]{0.6\textwidth}%
This is a really hard question, which you are
not going to be able to answer. You may as well go
home now.
\end{minipage}}\hfill}%
\begin{minipage}[t]{0.2\textwidth}
Answer:
\end{minipage}
\bigskip\noindent
\myrlap{\myvphantom{\begin{minipage}[t]{0.6\textwidth}%
This is another really hard question, which you are
not going to be able to answer. You should have
given up by now.
\end{minipage}}\hfill}%
\begin{minipage}[t]{0.2\textwidth}
Answer:
\end{minipage}
\end{document}
要使其成为可行的解决方案还有很多工作要做,但这是一个开始。