
저는 교수이고 exam
LaTeX에서 이 수업을 자주 사용합니다.
\begin{solutionorlines}[4cm]
학생들이 답할 수 있도록 4cm의 공간을 만듭니다. 입력하면\printanswers
답변이 표시되지만 답변이 인쇄되지 않을 때와 동일한 공간이 유지되지 않습니다. 질문과 해결 환경을 어떻게 동일하게 유지할 수 있나요?답변이 동일한 솔루션 라인에 인쇄되기를 원합니다. 있지만
\fillin[fill this in][12cm]
줄 바꿈은 아닙니다.censor
패키지( ) 도 시도했지만\xblackout
이것이 마지막 줄을 만들지 못하고hfill
실제로 학생들에게 제공되는 솔루션 라인과 동일하지 않습니다.- 솔루션의 문자 수를 계산하여 손글씨를 위한 더 많은 공간을 남겨 둘 수 있습니까? (학생들이 답할 수 있도록 솔루션의 문자 수를 줄 수로 변환할 수 있습니까?)
여기에 예가 있습니다.
\documentclass[11pt,a4paper,addpoints]{exam}
\unframedsolutions
%\printanswers
\usepackage{tikz}
\usepackage{graphicx}
\usepackage{geometry}
\usepackage{calc}
\newgeometry{left=2cm,top=2cm,right=2cm,bottom=2cm}
%----------blanks----------------------
\usepackage{censor}
\censorruledepth=-.2ex
\censorruleheight=.1ex
%\StopCensoring %text xblackout comes visible or not
%--------------------------------------
\begin{document}
\begin{questions}
\begin{figure*}[h]
\begin{tikzpicture}[rounded corners=5mm]
\path node[rectangle,draw=green,fill=green!8,inner sep=.70cm] {\parbox{\textwidth-1.4cm-\fboxrule}{
\question[2] What is the first question?
\begin{solutionorlines}[4cm]
This box is smaller than when the solutions are not printed. How do I make this the same dimension as when answers are not printed?
\end{solutionorlines}
}};
\end{tikzpicture}
\end{figure*}
\xblackout{This solutionline doesn't fill untill the right margin = bad}
\end{questions}
\end{document}
답변1
Parbox의 높이를 지정하여 고정할 수 있습니다. 이는 다음과 같습니다.
\parbox[t][4.5cm]{\textwidth-1.4cm-\fboxrule}{...}
단순히 대신에
\parbox{\textwidth-1.4cm-\fboxrule}{...}
이런 방식으로 답이 인쇄될 때와 그렇지 않을 때 모두 항상 동일한 공간을 갖게 됩니다.
MWE:
\documentclass[11pt,a4paper,addpoints]{exam}
\unframedsolutions
%\printanswers
\usepackage{tikz}
\usepackage{graphicx}
\usepackage{geometry}
\usepackage{calc}
\newgeometry{left=2cm,top=2cm,right=2cm,bottom=2cm}
\begin{document}
\begin{questions}
\begin{figure*}[h]
\begin{tikzpicture}[rounded corners=5mm]
\path node[rectangle,draw=green,fill=green!8,inner sep=.70cm] {\parbox[t][4.5cm]{\textwidth-1.4cm-\fboxrule}{
\question[2] What is the first question?
\begin{solutionorlines}[4cm]
This box is smaller than when the solutions are not printed. How do I make this the same dimension as when answers are not printed?
\end{solutionorlines}
}};
\end{tikzpicture}
\end{figure*}
\end{questions}
\end{document}
출력(왼쪽은 비교 \printanswersfalse
용, 오른쪽은 \printanswerstrue
비교용):