在考试类别中添加星号

在考试类别中添加星号

我正在为exam课堂上的学生编写一些练习。我希望一些问题是课后练习,并通过在问题编号后加一个星号来表示,例如(a)*。我试过了\part[*],但这会给出(* point)。请问我该怎么办?谢谢!我的代码如下。

\documentclass[english]{exam}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{bigints}
\usepackage{amssymb}
\usepackage{amsthm}

\begin{document}

\begin{questions}

\question

\begin{parts}

\part $*$ bla bla

\end{parts}

\end{questions}

\end{document}

答案1

以下是定义两个命令\afterclasspart\standardpart给出所需格式的一种方法:

\documentclass{exam}

\newcommand\afterclasspart{\renewcommand\partlabel{(\thepartno)$^\ast$}}  
\newcommand\standardpart{\renewcommand\partlabel{(\thepartno)}}
  
\begin{document}

\begin{questions}
\question[10]
Why is there air?
\question
What if there were no air?
\begin{parts}
\part[5]
Describe the effect on the balloon industry.
\afterclasspart
\part[5]
Describe the effect on the aircraft industry.
\standardpart
\part[5]
Describe the effect on the wool industry.
\end{parts}
\question[20]
\begin{parts}
\afterclasspart
\part
Define the universe.
Give three examples.
\standardpart
\part
If the universe were to end, how would you know?
\part
If the universe were not to end, how would you know?
\end{parts}
\end{questions}

\end{document}

结果:

在此处输入图片描述

也许这个变体可以使标签更好地对齐:

\documentclass{exam}

\newcommand\afterclasspart{\renewcommand\partlabel{(\thepartno)\makebox[0pt]{$\ ^\ast$}}}  
\newcommand\standardpart{\renewcommand\partlabel{(\thepartno)}}
  
\begin{document}

\begin{questions}
\question[10]
Why is there air?
\question
What if there were no air?
\begin{parts}
\part[5]
Describe the effect on the balloon industry.
\afterclasspart
\part[5]
Describe the effect on the aircraft industry.
\standardpart
\part[5]
Describe the effect on the wool industry.
\end{parts}
\question[20]
\begin{parts}
\afterclasspart
\part
Define the universe.
Give three examples.
\standardpart
\part
If the universe were to end, how would you know?
\part
If the universe were not to end, how would you know?
\end{parts}
\end{questions}

\end{document}

结果:

在此处输入图片描述

更新

可以采用类似的程序将星号添加到选定的问题:

\documentclass{exam}

\newcommand\afterclasspart{\renewcommand\partlabel{(\thepartno)\makebox[0pt]{$\ ^\ast$}}}  
\newcommand\standardpart{\renewcommand\partlabel{(\thepartno)}}
\newcommand\afterclassquestion{\renewcommand\questionlabel{\thequestion.\makebox[0pt]{$^\ast$}}}  
\newcommand\standardquestion{\renewcommand\questionlabel{\thequestion.}}  

\begin{document}

\begin{questions}
\afterclassquestion
\question[10]
Why is there air?
\standardquestion
\question
What if there were no air?
\begin{parts}
\part[5]
Describe the effect on the balloon industry.
\afterclasspart
\part[5]
Describe the effect on the aircraft industry.
\standardpart
\part[5]
Describe the effect on the wool industry.
\end{parts}
\question[20]
\begin{parts}
\afterclasspart
\part
Define the universe.
Give three examples.
\standardpart
\part
If the universe were to end, how would you know?
\part
If the universe were not to end, how would you know?
\end{parts}
\end{questions}

\end{document}

在此处输入图片描述

相关内容