시험 문서 클래스에서 선택한 들여쓰기 설정

시험 문서 클래스에서 선택한 들여쓰기 설정

이 들여쓰기 형식으로 객관식 질문을 만들고 싶습니다.

1. ########
   A. ###
   B. ###
   C. ###
2. ########
   ########
   A. ###
   B. ###
   C. ###

선택 항목은 질문 텍스트와 동일한 들여쓰기를 갖습니다.

하지만 기본 exam문서 클래스를 사용하면 다음 형식을 얻게 됩니다.

1. ########
     A. ###
     B. ###
     C. ###
2. ########
   ########
     A. ###
     B. ###
     C. ###

따라서 나는 내가 원하는 것을 얻기 위해 환경 내부 \leftmargin를 설정하려고 노력합니다.0ptchoices

\documentclass{exam}
\begin{document}
\begin{questions}
  \question
  How old are you?
  \begin{choices}
    \setlength{\leftmargin}{0pt}
    \choice 14
    \choice 17
    \choice 19
    \choice 20
    \choice 23
  \end{choices}
\end{questions}
\end{document}

하지만 아무데도 가지 않습니다.

그렇다면 documentclass choice에서 들여쓰기를 설정하는 올바른 방법은 무엇입니까 ?exam

답변1

섹션 4.10에 따라exam문서, 나는 당신이 찾고 있다고 생각합니다 choiceshook. 예를 들어 다음과 같이 사용할 수 있습니다.

\renewcommand{\questionshook}{%
    \setlength{\leftmargin}{30pt}%
}
\renewcommand{\choiceshook}{%
    \setlength{\leftmargin}{50pt}%
}

다음은 완전한 MWE입니다.geometry데모용으로만 포함된 패키지 showframe=true.

% arara: pdflatex
% !arara: indent: {overwrite: true}
\documentclass{exam}
\usepackage[showframe=true]{geometry}

\renewcommand{\questionshook}{%
    \setlength{\leftmargin}{30pt}%
}
\renewcommand{\choiceshook}{%
    \setlength{\leftmargin}{50pt}%
}
\begin{document}
\begin{questions}
    \question
    How old are you?
    \begin{choices}
        \choice 14
        \choice 17
        \choice 19
        \choice 20
        \choice 23
    \end{choices}
\end{questions}
\end{document}

exam참고로 문서 의 인용문은 다음과 같습니다.

시험 문서 클래스는 이를 다음과 같이 정의합니다.

\newcommand{\questionshook}{} 
\newcommand{\partshook}{}
\newcommand{\subpartshook}{} 
\newcommand{\subsubpartshook}{}
\newcommand{\choiceshook}{} 
\newcommand{\checkboxeshook}{} 

따라서 기본값은 이러한 명령이 아무런 효과가 없다는 것입니다. 그러나 \renewcommand 명령을 사용하여 명령을 변경할 수 있습니다.

답변2

이것을 시도하고보십시오

\uplevel{
\begin{choices}
    \choice 
    \choice 
    \choice 
    \choice 
\end{choices}}

답변3

  1. 라텍스 폴더에서 "exam.cls"를 찾으세요.

  2. 열어 봐,

\settowidth{\leftmargin}{W.\hskip\labelsep\hskip 2.5em}% 로 변경 \settowidth{\leftmargin}{W.\hskip\labelsep\hskip 0em}%

  1. 구하다.

관련 정보