使用 LaTeX 编写问题

使用 LaTeX 编写问题

我正在写一份报告,想按照\subsubsection{}以下格式提出几个问题(问题出现在页面中间)

1.2. 问题

                          *This is the question one*

这是对第一个问题的回答。

                          *This is another question*

这是第二个问题的答案。

答案1

作为克尼德他在评论中提到,锻炼软件包为您提供了可立即使用的环境和命令,它们可能对您的目的有用。举个小例子:

\documentclass{article}
\usepackage{exercise}
\usepackage{lipsum}% just to produce filler text

\renewcommand\ExerciseName{Question~}
\renewcommand\AnswerName{Answer to question}
\renewcommand\ExerciseHeader{%
  \noindent\parbox[t]{.18\textwidth}{%
    \bfseries\large\ExerciseName\ExerciseHeaderNB\hfill}%
  \parbox[t]{.72\textwidth}{%
    \centering\bfseries\large%
    \ExerciseHeaderTitle\ExerciseHeaderOrigin}%
  \par\medskip
}

\begin{document}

\section{Questions}
\begin{Exercise}[title={Some easy question}, label=que1]
\lipsum[2]
\end{Exercise}
\begin{Answer}[ref=que1]
\lipsum[2]
\end{Answer}
\begin{Exercise}[title={Some difficult question with a really really long title}, label=que2]
\lipsum[2]
\end{Exercise}
\begin{Answer}[ref=que2]
\lipsum[2]
\end{Answer}

\end{document}

在此处输入图片描述

答案2

考虑一下exam班级。在下面的示例中,注释或取消注释\printanswers命令,以使用您自己排版的内容替换学生写答案的标尺空间。问题跨越多页也没有问题。

\documentclass{exam}
\usepackage{lipsum}
%\printanswers

\begin{document}

\section{Questions}

\begin{questions}
\question[10] Why is there air?
\begin{solutionorlines}[1in]
For several reasons.
\end{solutionorlines}

\question What if there were no air?
\begin{parts}
\part[5] Describe the effect on the balloon industry.
\begin{solutionorlines}[0.5in]
Bad.
\end{solutionorlines}
\part[5] Describe the effect on the aircraft industry.
\begin{solutionorlines}[0.5in]
Worse,
\end{solutionorlines}
\end{parts}

\question[20]
\begin{parts}
\part Define the universe. Give three examples.
\part If the universe were to end, how would you know?
\begin{solutionorlines}[1in]
Something else goes here.
\end{solutionorlines}
\end{parts}

\question[60] \lipsum

\end{questions}

\end{document}

在此处输入图片描述

相关内容