跳轉到內容

LaTeX/教師園地

來自華夏公益教科書,開放的書籍,開放的世界

LaTeX

入門
  1. 介紹
  2. 安裝
  3. 安裝額外包
  4. 基礎
  5. 如何獲得幫助

常用元素

  1. 文件結構
  2. 文字格式
  3. 段落格式
  4. 顏色
  5. 字型
  6. 列表結構
  7. 特殊字元
  8. 國際化
  9. 旋轉
  10. 表格
  11. 標題建立
  12. 頁面佈局
  13. 自定義頁面頁首和頁尾‎
  14. 匯入圖形
  15. 浮動、圖形和標題
  16. 腳註和邊注
  17. 超連結
  18. 標籤和交叉引用
  19. 首字母

機制

  1. 錯誤和警告
  2. 長度
  3. 計數器
  4. 盒子
  5. 規則和支撐

技術文字

  1. 數學
  2. 高階數學
  3. 定理
  4. 化學圖形
  5. 演算法
  6. 原始碼列表
  7. 語言學

特殊頁面

  1. 索引
  2. 詞彙表
  3. 參考文獻管理
  4. 更多參考文獻

特殊文件

  1. 科學報告(學士報告、碩士論文、博士論文)
  2. 信件
  3. 簡報
  4. 教師園地
  5. 簡歷
  6. 學術期刊(MLA、APA 等)

建立圖形

  1. 介紹過程式圖形
  2. MetaPost
  3. 圖片
  4. PGF/TikZ
  5. PSTricks
  6. Xy-pic
  7. 建立 3D 圖形

程式設計

  1. Plain TeX
  2. 建立包
  3. 建立包文件
  4. 主題

雜項

  1. 模組化文件
  2. 協作編寫 LaTeX 文件
  3. 匯出到其他格式

幫助和建議

  1. 常見問題解答
  2. 技巧和竅門

附錄

  1. 作者
  2. 連結
  3. 包參考
  4. LaTeX 文件示例
  5. 索引
  6. 命令詞彙表

編輯此框編輯 TOC

LaTeX 具有專門針對教師的功能。我們介紹了 exam[1],它非常適合設計帶有答案的考試和練習。有興趣的人也可以看看 probsoln[2]mathexm 文件類[3] 或者 exsheets[4]

我們介紹 exam 類。exam 類非常適合設計帶有答案的考試。你只需要在前言中指定是否要列印答案。你也可以統計分數。

在前言中,你可以指定以下幾行 

\documentclass[a4paper,11pt]{exam}
\printanswers % If you want to print answers
% \noprintanswers % If you don't want to print answers
\addpoints % if you want to count the points
% \noaddpoints % if you don't want to count the points
% Specifies the way question are displayed:
\qformat{\textbf{Question\thequestion}\quad(\thepoints)\hfill}
\usepackage{color} % defines a new color
\definecolor{SolutionColor}{rgb}{0.8,0.9,1} % light blue
\shadedsolutions % defines the style of the solution environment
% \framedsolutions % defines the style of the solution environment
% Defines the title of the solution environment:
\renewcommand{\solutiontitle}{\noindent\textbf{Solution:}\par\noindent}

你可以用以下幾行替換前三行 

\documentclass[a4paper,11pt,answers,addpoints]{exam}
  • 考試包含在 questions 環境中。
  • 命令 \question 引入一個新的問題。
  • 分數在方括號中指定。
  • 答案在 solution 環境中給出。它只在前言中指定了 \printanswersanswers 作為 \documentclass 的選項時才會出現。

下面是一個示例 

\begin{questions} % Begins the questions environment
\question[2] What is the solution? % Introduces a new question which is worth 2 points
\begin{solution} 
Here is the solution 
\end{solution}
\question[5] What is your opinion?
\begin{solution}
This is my opinion
\end{solution}
\end{questions}

也可以使用 \ifprintanswers 命令新增只有在答案列印時才會顯示的內容。

\ifprintanswers
Only if answers are printed
\else
Only if answers are not printed
\fi

\numquestions 給出問題的總數。宏 \numpoints 給出分數的總數。

\begin{minipage}{.8\textwidth}
This exam includes \numquestions\ questions. The total number of points is \numpoints.
\end{minipage}

\numquestion 後面的反斜槓阻止宏像往常一樣吞噬後面的空格。

exsheets 包是 exam 類的替代方案。它可以用來建立試卷、包含答案的課本等。很多選項可以用來調整輸出風格。以下是一個演示示例。

\documentclass{article}
\usepackage{booktabs}
\usepackage{exsheets}
\usepackage{tasks}
\SetupExSheets[question]{type=exam}
\SetupExSheets{
	counter-format=se.qu,
	counter-within=section,
	headings=runin,
}
\begin{document}
\section{Chemistry}
\begin{question}{2}
	Which one of the entries does not fit with the others?
	\begin{tasks}(4)
		\task mercury
		\task iron
		\task lead
		\task zinc
	\end{tasks}
\end{question}
\begin{question}{4}
	Explain your decision for the answer above.

	\blank[width=5\linewidth,linespread=1.5]{}
\end{question}

\section{Physics}
\settasks{
	counter-format=(tsk[r]),
	label-width=4ex
}
\begin{question}{1}
	What is a funkyton?
	\begin{tasks}(2)
		\task A dancing electron
		\task A dancing proton
		\task A dancing neutron
		\task A Dixie Dancing Duck
	\end{tasks}
\end{question}

\begin{center}
\begin{tabular}{l*{\numberofquestions}{c}c}\toprule
	Question & \ForEachQuestion{\QuestionNumber{#1}\iflastquestion{}{&} } & Total \\ \midrule
	Points   & \ForEachQuestion{\GetQuestionProperty{points}{#1}\iflastquestion{}{&} } & \pointssum* \\ 
	Reached  & \ForEachQuestion{\iflastquestion{}{&} } & \\ \bottomrule
\end{tabular}
\end{center}
\end{document}

A sample exam sheet

exsheets 的後續版本將是 xsim 包。

參考文獻

[編輯 | 編輯原始碼]
  1. examdoc 使用 exam 文件類
  2. Probsoln 建立帶有可選答案的問題單
  3. mathexm 文件
  4. exsheets 文件 建立練習單和考試


上一個:簡報 索引 下一個:簡歷
華夏公益教科書