换行设置

换行设置

问题:

我的问题是,第三个问题中的第二行从左侧开始。我想将其移动到稍右侧,正好在第一行下方。我该怎么做?

梅威瑟:

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{parskip}
\usepackage{graphicx}
\usepackage[left=0.60in, right=0.60in, top=0.60in, bottom=0.60in]{geometry}
%\setlength{\parindent}{4em}
%\setlength{\parskip}{1em}
\renewcommand{\baselinestretch}{1.15}
\begin{document}
\textbf{Question:~ Choose the correct alternative (Explanation is not necessary) }

\textbf{(1)}~ Body of first question

\qquad(A)~\hfill(B)~\hfill(C)~\hfill(D)~

\textbf{(2)}~ Body of second question

\qquad(A)~\hfill(B)~\hfill(C)~\hfill(D)~

\textbf{(3)}~ Body of third question Body of third question Body of third question Body of third question Body of third question Body of third question

\qquad(A)~\hfill(B)~\hfill(C)~\hfill(D)~


\end{document}

答案1

我根据enumitemtasks(对于水平枚举)提出以下建议:

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{parskip}
\usepackage{graphicx}
\usepackage[margin=0.60in]{geometry}
\usepackage{enumitem}
\usepackage{tasks}
\settasks{counter-format =(tsk[A]), label-width=1.5em, item-indent=0pt, column-sep=1em}

%\setlength{\parindent}{4em}
%\setlength{\parskip}{1em}
\renewcommand{\baselinestretch}{1.15}

\begin{document}
\textbf{Question:~ Choose the correct alternative (Explanation is not necessary) }

\begin{enumerate}[label=(\arabic*), font=\bfseries, wide=0pt, widest=(9), labelsep=-2pt, leftmargin=*]
\item Body of first question

\begin{tasks}(4)
  \task
  \task
  \task
  \task
\end{tasks}

\item Body of second question

\begin{tasks}(4)
  \task
  \task
  \task
  \task
\end{tasks}

\item Body of third question Body of third question Body of third question Body of third question Body of third question Body of third question

\begin{tasks}(4)
  \task
  \task
  \task
  \task
\end{tasks}

\end{enumerate}

\end{document} 

在此处输入图片描述

答案2

使用列表。

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{parskip}
\usepackage{graphicx}
\usepackage[left=0.60in, right=0.60in, top=0.60in, bottom=0.60in]{geometry}
%\setlength{\parindent}{4em}
%\setlength{\parskip}{1em}
\renewcommand{\baselinestretch}{1.15}
\usepackage{enumitem}
\begin{document}
\textbf{Question:~ Choose the correct alternative (Explanation is not necessary) }

\begin{enumerate}[font=\bfseries]
\item  Body of first question

\qquad(A)~\hfill(B)~\hfill(C)~\hfill(D)~

\item Body of second question

\qquad(A)~\hfill(B)~\hfill(C)~\hfill(D)~

\item Body of third question Body of third question Body of third question Body of third question Body of third question Body of third question

\qquad(A)~\hfill(B)~\hfill(C)~\hfill(D)~

\end{enumerate}

\end{document}

在此处输入图片描述

答案3

看起来你正在写考试。这是exam文档类的一个案例,它还可以提供自动计算总分等有用的功能,所以我建议你看看。

使用考试包后,您的代码将变成:

\documentclass[12pt,a4paper]{exam} %note the new document class
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{parskip}
\usepackage{graphicx}
\usepackage[left=0.60in, right=0.60in, top=0.60in, bottom=0.60in]{geometry}
%\setlength{\parindent}{4em}
%\setlength{\parskip}{1em}
\renewcommand{\baselinestretch}{1.15}
\renewcommand{\choicelabel}{(\thechoice)} % brackets around choices
\renewcommand{\thequestion}{\textbf{\arabic{question}}} % bold question numbers

\begin{document}
Choose the correct alternative (Explanation is not necessary) 
\begin{questions}

\question Body of first question

\begin{oneparchoices}
\choice{}
\choice{}
\choice{}
\choice{}
\end{oneparchoices}

\question Body of second question

\begin{oneparchoices}
\choice{}
\choice{}
\choice{}
\choice{}
\end{oneparchoices}

\question Body of third question Body of third question Body of third question Body of third question Body of third question Body of third question 

\begin{oneparchoices}
\choice{}
\choice{}
\choice{}
\choice{}
\end{oneparchoices}


\end{questions}
\end{document}

上述代码的输出

您可能希望实际向选项中添加文本。请查看考试包文档的第 5 部分。

相关内容