outlines
根据第二个答案,我正在使用多级列表包这里因为这是一个非常好的解决方案,到目前为止效果很好。但是,我想知道如果我将命令\2
或更改\3
为类似的东西,是否可以专门使用复选框。最好将复选框放在行末的右侧,但即使它是标签\2c
或\3c
标签旁边也可以。如果我只是使用enumerate
,我可以这样做这但我不确定是否可以针对该outlines
包进行定制。虽然在这种情况下可能没有太大帮助,但还是给出了 MWE。
\documentclass{book}
\usepackage{outlines}
\begin{document}
\begin{outline}[enumerate]
\1 This item should not have a check box beside it
\2 This item should not have a check box beside it
\2 This item should have a check box beside it
\3 This item should have a check box beside it
\end{outline}
\end{document}
答案1
我以三种不同的方式定义了宏、、\C1
等,以不同的方式将复选框添加到大纲列表中:\C2
\C3
- 第一种变体:标签旁边的复选框,
- 第二种方案:用复选框代替标签,
- 第三种变体:行尾的复选框,但这需要用花括号括住项目文本。
以下是代码:
\documentclass{book}
\usepackage{outlines}
\usepackage{amssymb}
\newcommand{\checkbox}{$\square$}
\begin{document}
\newcommand{\C}[1]{\ifcase#1\relax\or\1\or\2\or\3\or\4\or\5\or\6\fi\checkbox}
\begin{outline}[enumerate]
\C1 This item should not have a check box beside it
\C2 This item should not have a check box beside it
\C2 This item should have a check box beside it
\C3 This item should have a check box beside it
\end{outline}
\renewcommand{\C}[1]{\ifcase#1\relax\or\1[\checkbox]\or\2[\checkbox]\or\3[\checkbox]\or\4[\checkbox]\or\5[\checkbox]\or\6[\checkbox]\fi}
\begin{outline}[enumerate]
\C1 This item should not have a check box beside it
\C2 This item should not have a check box beside it
\C2 This item should have a check box beside it
\C3 This item should have a check box beside it
\end{outline}
\renewcommand{\C}[2]{\ifcase#1\relax\or\1\or\2\or\3\or\4\or\5\or\6\fi#2\hfill\checkbox}
\begin{outline}[enumerate]
\C1{This item should not have a check box beside it}
\C2{This item should not have a check box beside it}
\C2{This item should have a check box beside it}
\C3{This item should have a check box beside it}
\end{outline}
\end{document}