我怎样才能在这里实现相同的水平对齐?

我怎样才能在这里实现相同的水平对齐?

当我从下面显示的代码开始时,遇到以下对齐问题:

在此处输入图片描述

我如何才能使其正确对齐?

另外,我想圈出一些特殊的问题编号...我该怎么做?

\documentclass[]{exam}

\begin{document}


        \begin{center}
        \fbox{SECTION-A}
       \end{center}

\begin{itemize}
\item Answer all the 15 questions.  
\item  Each question contains four options. Choose the most suitable answer from the four alternatives.         
\item Each question carries 1 mark   \hfill{$15\times 1=15$}
\end{itemize}

\begin{questions}
 \question 
     \begin{center}
         \fbox{SECTION-B}
        \end{center}
 \begin{itemize}
 \item Answer 10 questions. 
 \item  Answer any 9 questions from the first 14 questions. Question no. 30 is compulsory.      
 \item Each question carries 2 marks.   \hfill{$10\times 2=20$}
 \end{itemize}
 \end{questions}

\end{document}

答案1

你可以

  1. 使用\section/\section*
  2. 使用\uplevel

我曾经titlesec将标题居中并框起来。但将章节编号放上去是个坏主意。但由于我不太了解您的需求,所以我保留了这些编号。我还曾经enumitem压缩项目间距。

以下是示例代码:

\documentclass[]{exam}
\usepackage{enumitem}
\usepackage{titlesec}
\newcommand{\myframed}[1]{\fbox{\MakeUppercase{#1}}}
\titleformat{name=\section,numberless}
{\normalfont\Large\bfseries\filcenter}{}{0em}{\myframed}

\begin{document}
\section*{Section-A}
\begin{itemize}[nosep]
\item Answer all the 15 questions.
\item  Each question contains four options. Choose the most suitable answer from the four alternatives.
\item Each question carries 1 mark   \hfill{$15\times 1=15$}
\end{itemize}
\begin{questions}
  \question One of these things is not like the others; one of these
       things is not the same. Which one is different?
          \begin{oneparchoices}
            \choice John
            \choice Paul
            \choice George
            \choice Ringo
            \CorrectChoice Socrates
          \end{oneparchoices}
  \question One of these things is not like the others; one of these
       things is not the same. Which one is different?
          \begin{oneparchoices}
            \choice John
            \choice Paul
            \choice George
            \choice Ringo
            \CorrectChoice Socrates
          \end{oneparchoices}
  \question One of these things is not like the others; one of these
       things is not the same. Which one is different?
          \begin{oneparchoices}
            \choice John
            \choice Paul
            \choice George
            \choice Ringo
            \CorrectChoice Socrates
          \end{oneparchoices}

\uplevel{%
\section*{Section-B}
 \begin{itemize}[nosep]
 \item Answer 10 questions.
 \item  Answer any 9 questions from the first 14 questions. Question no. 30 is compulsory.
 \item Each question carries 2 marks.   \hfill{$10\times 2=20$}
 \end{itemize}
}
  \question What is the other question?
  \question What is the other question?
  \question What is the other question?
 \end{questions}

\end{document}

在此处输入图片描述

相关内容