
私は教授であり、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[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
):