
시험 수업에서 학생들을 위해 답안란과 동일한 크기의 고정된 미니페이지를 삽입함으로써 답안이 인쇄될 때나 답안이 인쇄되지 않을 때 동일한 공간을 생성합니다. 왜 깊이가 여전히 다른가요? 나에게 \vspace를 사용하라고 말하지 마세요.
\documentclass[11pt,a4paper,addpoints]{exam}
\unframedsolutions
\usepackage{tikz}
\usepackage{graphicx}
\usepackage{geometry}
\usepackage{calc}
\usepackage[skins]{tcolorbox}
\usepackage{calc}
\newgeometry{left=2cm,top=2cm,right=2cm,bottom=2cm}
\newtcolorbox{greenbox}[1][]{%
size=fbox,
arc=5mm,
boxsep=0.7cm,
colframe=green,
colback=green!8,
beforeafter skip=5mm,% <--- Space setting before and after
#1%
}
%\printanswers
\begin{document}
\begin{questions}
\begin{greenbox}
\question[2] What is the first question?
\begin{solutionorlines}[4cm] %heidht no answers=4cm
\begin{minipage}[t][4cm]{\textwidth-1.4cm} %height answers =4cm
The depth of this box is larger when answers are printed compared to answers not printed. How do I make "answers" and "no answers" the same dimension?
\end{minipage}
\end{solutionorlines}
\end{greenbox}%
\end{questions}
\end{document}
답변1
클래스 자체에서 질문에 대한 해결책을 제공해야 한다고 생각 exam
하지만 구성 문제인지 알 수 있을 만큼 익숙하지 않습니다.
문제를 피하려면 솔루션 부분을 다른 minipage
. 다음 코드는 답변과 줄에 항상 같은 양의 공간을 사용합니다.
\documentclass[11pt,a4paper,addpoints]{exam}
\unframedsolutions
\usepackage{tikz}
\usepackage{graphicx}
\usepackage{geometry}
\usepackage{calc}
\usepackage[skins]{tcolorbox}
\usepackage{calc}
\newgeometry{left=2cm,top=2cm,right=2cm,bottom=2cm}
\newtcolorbox{greenbox}[1][]{%
size=fbox,
arc=5mm,
boxsep=0.7cm,
colframe=green,
colback=green!8,
beforeafter skip=5mm,% <--- Space setting before and after
#1%
}
%\printanswers
\begin{document}
\begin{questions}
\begin{greenbox}
\question[2] What is the first question?
\par\begin{minipage}[t][4cm]{\linewidth} %height answers =4cm
\begin{solutionorlines}[4cm] %heidht no answers=4cm
\begin{minipage}[t][4cm]{\linewidth-1.9cm} %height answers =4cm
The depth of this box is larger when answers are printed compared to answers not printed. How do I make "answers" and "no answers" the same dimension?
\end{minipage}%
\end{solutionorlines}
\end{minipage}
\end{greenbox}%
\end{questions}
\end{document}