我正在为 matric 编写 MCQ,但我遇到了如何编写 MCQ 选项的问题,如图所示。
我提供我的代码和包的完整文档:
\documentclass[10pt]{book}
\usepackage[paperheight=10in,paperwidth=9in, top=1in, bottom=0.8in, twocolumn, twoside]{geometry}
\setlength{\columnseprule}{0.4pt}
\usepackage{amssymb,amsfonts}
\usepackage{mathrsfs}
\usepackage[centertags]{amsmath}
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}
\usepackage{epsfig}
\usepackage{graphicx}\graphicspath{{Graphics/}}
\usepackage{amsthm}
\usepackage{mathptmx}
\usepackage[square,sort&compress]{natbib}
\usepackage{pgf,tikz,pgfplots}
\pgfplotsset{compat=1.15}
\usetikzlibrary{arrows}
\usepackage[T1]{fontenc}
\usepackage{fancyhdr}\pagestyle{fancy}
\usepackage{xcolor}
\usepackage{setspace}
\usepackage{booktabs}
%\usepackage{hyperref}
\usetikzlibrary{arrows.meta}
\renewcommand{\baselinestretch}{1.5}
\newcommand\aug{\fboxsep=-\fboxrule\!\!\!\fbox{\strut}\!\!\!}
\theoremstyle{definition}
\newtheorem{Thm}{Theorem}[section]
\newtheorem{lem}[Thm]{Lemma}
\newtheorem{pro}[Thm]{Proposition}
\newtheorem{de}[Thm]{Definition}
\newtheorem{re}[Thm]{Remark}
\newtheorem{ex}[Thm]{Example}
\newtheorem{cor}[Thm]{Corollary}
\numberwithin{equation}{section}
\definecolor{uuuuuu}{rgb}{0.26666666666666666,0.26666666666666666,0.26666666666666666}
\begin{document}
\frontmatter
%\include{frontmatter/colophon}
%\include{fronmatter/frontpiece}
%\include{frontmatter/dedication}
%\include{frontmatter/preface}
%\twocolumn
\tableofcontents
\mainmatter
\include{mainmatter/Chapter-1}
\include{mainmatter/Chapter-2}
\end{document}
我无法添加如图所示的 MCQ 选项的空圆圈。
答案1
您可以使用软件包轻松完成此操作tasks
,但使用您的页面布局,您没有足够的空间在同一行上放置 4 个选项。我使用了\begin{tasks}(2)
,但我的选择文本很短。
我保留了你的序言,即使它不是最小的。请记住不要加载两次包。
序言中的关键指令是:
\usepackage{enumitem}
\setlist[enumerate,2]{label=(\roman*).}% <-- This set the second level of enumerate with (i.), (ii.), etc.
\usepackage{tasks}
\settasks{label=$\circ$}% <-- This set the label of the horizontal list with a circle
完整的例子如下:
\documentclass[10pt]{book}
\usepackage[paperheight=10in,paperwidth=9in, top=1in, bottom=0.8in, twocolumn, twoside]{geometry}
\setlength{\columnseprule}{0.4pt}
\usepackage{amssymb,amsfonts}
\usepackage{mathrsfs}
\usepackage[centertags]{amsmath}
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}
\usepackage{epsfig}
\usepackage{graphicx}\graphicspath{{Graphics/}}
%\usepackage{amsthm}<--- DO NOT LOAD PACKAGES TWICE!
\usepackage{mathptmx}
\usepackage[square,sort&compress]{natbib}
\usepackage{pgf,tikz,pgfplots}
\pgfplotsset{compat=1.15}
\usetikzlibrary{arrows}
\usepackage[T1]{fontenc}
\usepackage{fancyhdr}\pagestyle{fancy}
\usepackage{xcolor}
\usepackage{setspace}
\usepackage{booktabs}
\usepackage{enumitem}
\setlist[enumerate,2]{label=(\roman*).}
\usepackage{tasks}
\settasks{label=$\circ$}
%\usepackage{hyperref}
\usetikzlibrary{arrows.meta}
\renewcommand{\baselinestretch}{1.5}
\newcommand\aug{\fboxsep=-\fboxrule\!\!\!\fbox{\strut}\!\!\!}
\theoremstyle{definition}
\newtheorem{Thm}{Theorem}[section]
\newtheorem{lem}[Thm]{Lemma}
\newtheorem{pro}[Thm]{Proposition}
\newtheorem{de}[Thm]{Definition}
\newtheorem{re}[Thm]{Remark}
\newtheorem{ex}[Thm]{Example}
\newtheorem{cor}[Thm]{Corollary}
\numberwithin{equation}{section}
\definecolor{uuuuuu}{rgb}{0.26666666666666666,0.26666666666666666,0.26666666666666666}
\begin{document}
\begin{enumerate}
\item Some text
\begin{enumerate}
\item Some sub item
\begin{tasks}(2)
\task Choice A
\task Choice B
\task Choice C
\end{tasks}
\item Some other sub item
\begin{tasks}(2)
\task Choice D
\task Choice E
\task Choice F
\task Choice G
\end{tasks}
\end{enumerate}
\item Some other text
\begin{enumerate}
\item Some sub item
\begin{tasks}(2)
\task Choice H
\task Choice I
\task Choice J
\task Choice K
\task Choice L
\end{tasks}
\item Some other sub item
\begin{tasks}(2)
\task Choice M
\task Choice N
\end{tasks}
\end{enumerate}
\end{enumerate}
\end{document}