配置任务包

配置任务包

任务包形成如下列表

* a * b
* c * d
* e * f

如何配置包以显示此类列表

* a * d
* b * e
* c * f

也需要进行线对齐tasksmulticols不这样做

在此处输入图片描述

答案1

一个快速而又粗糙的解决方案。

只需一点手动干预:将最高项目保存在此处(在列表之前) \sbox{\myhighitem}{<write here your highest item>}:。

解释

\newlist{mylist}{enumerate}{10}

创建新的列表环境mylist,如enumerate,最大深度为 10 级。

\setlist[mylist]{label =\alph*),
  before = \raggedcolumns\begin{multicols}{2},
  after = \end{multicols}}

使用 将字母标签和列表设置为两列multicols

\newsavebox{\myhighitem}

创建盒子\myhighitem,要知道什么是盒子,请参见此处:https://en.wikibooks.org/wiki/LaTeX/Boxes

\newcommand{\myitem}{\item\vphantom{\usebox{\myhighitem}}}

为 创建一个新命令\item,该命令还将项目的垂直尺寸设置为 的高度\myhighitem。使用\vphantom可以设置垂直尺寸,而无需编写任何内容。

\sbox{\myhighitem}{$\dfrac{e+f}{g-h}$}

保存在\myhighitem字符串中$\dfrac{e+f}{g-h}$

\documentclass{article}
\usepackage{amsmath}
\usepackage{enumitem}
\usepackage{multicol}
\newlist{mylist}{enumerate}{10}
\setlist[mylist]{label =\alph*),
    before = \raggedcolumns\begin{multicols}{2},
    after = \end{multicols}}

\newsavebox{\myhighitem}
\newcommand{\myitem}{\item\vphantom{\usebox{\myhighitem}}}

\begin{document}
You can use a trick:
\sbox{\myhighitem}{$\dfrac{e+f}{g-h}$}% write here your highest item
\begin{mylist}
\myitem $\dfrac{a+b}{b}$
\myitem $c+d$
\myitem $\dfrac{e+f}{g-h}$
\myitem $m-n$
\myitem $o-p$
\myitem $\dfrac{i+j}{k-l}$
\end{mylist}

You can do it also at ``row level'':
\begin{mylist}
\sbox{\myhighitem}{$\dfrac{a+b}{c}$}% write here your highest item of the first row
\myitem $\dfrac{a+b}{b}$
\sbox{\myhighitem}{$cp$}% write here your highest item of the third row
\myitem $c+d$
\sbox{\myhighitem}{$\dfrac{e+f}{g-h}$}% write here your highest item of the third row
\myitem $\dfrac{e+f}{g-h}$
\sbox{\myhighitem}{$\dfrac{a+b}{c}$}% write here your highest item of the first row
\myitem $m-n$
\sbox{\myhighitem}{$cp$}% write here your highest item of the third row
\myitem $o-p$
\sbox{\myhighitem}{$\dfrac{e+f}{g-h}$}% write here your highest item of the third row
\myitem $\dfrac{i+j}{k-l}$
\end{mylist}
\end{document}

在此处输入图片描述

相关内容