Skillmon 提出的解决方案这里不再起作用,使用最新的 TeX 发行版:
\documentclass{article}
\usepackage{tikz}
\usepackage{tasks}
\newcommand*\Choice[1]{%
\begin{tikzpicture}[baseline=-5pt]
\node[gray,inner sep=8pt,draw=gray!50,rounded corners] {#1};
\end{tikzpicture}}
\newcounter{choicelabel}
\newcommand*\Choicelabel{%
\refstepcounter{choicelabel}%
\hskip1em\llap{\Choice{\Alph{choicelabel}}}}%
\everymath={\displaystyle}
\makeatletter
\renewcommand\normalsize{\@setfontsize\normalsize{13.5pt}{1.5em}}
\normalsize
\makeatother
\begin{document}
Question goes here.
\begin{tasks}[label=\Choicelabel](2)
\task $\frac{9}{17}$
\task $\frac{12}{17}$
\task $\frac{13}{17}$
\task $\frac{13}{17}$
\task $\frac{8}{17}$
\end{tasks}
\end{document}
我收到错误:
! Missing \endcsname inserted.
<to be read again>
\csname\endcsname
l.31 \end
{tasks}
The control sequence marked <to be read again> should
not appear between \csname and \endcsname.
是否仍然可以使用 Ti 创建任务标签钾Z?
答案1
新版本tasks
允许在环境选项中设置标签格式。MWE:
\documentclass{article}
\usepackage{tikz}
\usepackage{tasks}
\newcommand*\Choice[1]{%
\begin{tikzpicture}[baseline=-5pt]
\node[gray,inner sep=8pt,draw=gray!50,rounded corners] {#1};
\end{tikzpicture}}
\everymath={\displaystyle}
\makeatletter
\renewcommand\normalsize{\@setfontsize\normalsize{13.5pt}{1.5em}}
\normalsize
\makeatother
\begin{document}
Question goes here.
\begin{tasks}[label-format=\Choice,label=\Alph*,label-width=26pt](2)
\task $\frac{9}{17}$
\task $\frac{12}{17}$
\task $\frac{13}{17}$
\task $\frac{13}{17}$
\task $\frac{8}{17}$
\end{tasks}
\end{document}
结果: