任务包框架标签

任务包框架标签

这里我需要task允许列表水平分布的包选项按以下顺序。我需要一个enumitem可以让我随意格式化项目标签的包选项。

有没有解决方案可以合并这两种设置?

\documentclass{article}

\usepackage{tikz}
\usepackage{enumitem}
\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}[counter-format={tsk[A]}](2)
    \task $\frac{9}{17}$
    \task $\frac{12}{17}$
    \task $\frac{13}{17}$
    \task $\frac{13}{17}$
    \task $\frac{8}{17}$
\end{tasks}


Second question goes here.
\begin{enumerate}[itemsep=5pt,label=\protect\Choice{\Alph*},itemindent=10pt]
    \item $\frac{9}{17}$
    \item $\frac{12}{17}$
    \item $\frac{13}{17}$
    \item $\frac{5}{17}$
    \item $\frac{8}{17}$
\end{enumerate}

\end{document}

在此处输入图片描述

答案1

新答案

定义您自己的标签:

\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}

在此处输入图片描述

旧答案

使用multicol包:

\documentclass{article}

\usepackage{tikz}
\usepackage{enumitem}
\usepackage{tasks}
\usepackage{multicol}

\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}[counter-format={tsk[A]}](2)
    \task $\frac{9}{17}$
    \task $\frac{12}{17}$
    \task $\frac{13}{17}$
    \task $\frac{13}{17}$
    \task $\frac{8}{17}$
\end{tasks}


Second question goes here.
\begin{multicols}{2}
\begin{enumerate}[itemsep=5pt,label=\protect\Choice{\Alph*},itemindent=10pt]
    \item $\frac{9}{17}$
    \item $\frac{12}{17}$
    \item $\frac{13}{17}$
    \item $\frac{5}{17}$
    \item $\frac{8}{17}$
\end{enumerate}
\end{multicols}

\end{document}

在此处输入图片描述

相关内容