LaTeX `exam` 클래스의 `align` 환경에 `\fillin[]`을 넣는 적절한 방법이 있나요?

LaTeX `exam` 클래스의 `align` 환경에 `\fillin[]`을 넣는 적절한 방법이 있나요?

\fillin[]라텍스 클래스에서 명령을 사용하여 exam다음 출력을 생성하고 있습니다.

여기에 이미지 설명을 입력하세요

Convert the following angles from degrees to radians:
\begin{questions}
    \begin{multicols}{4}
        \question
        \begin{align*}
            180 \degree 
            &= \fillin[$1$] \pi \\
            &= \fillin[$\frac{1}{2}$] \tau \\
            &\approx \fillin[$3.14159$]
        \end{align*}

        \columnbreak

        \question
        \begin{align*}
            90 \degree
            &= \fillin[$\frac{1}{2}$] \pi \\
            &= \fillin[$\frac{1}{4}$] \tau \\
            &\approx \fillin[$1.57079$]
        \end{align*}

        \columnbreak

        \question
        \begin{align*}
            270 \degree
            &= \fillin[$\frac{3}{2}$] \pi \\
            &= \fillin[$\frac{3}{4}$] \tau \\
            &\approx \fillin[$4.71238$]
        \end{align*}

        \columnbreak

        \question
        \begin{align*}
            360 \degree
            &= \fillin[$2$] \pi \\
            &= \fillin[$1$] \tau \\
            &\approx \fillin[$6.28318$]
        \end{align*}
    \end{multicols}
    \vspace*{\stretch{1}}
\end{questions}

출력은 실제로 내가 기대했던 것과 정확히 일치합니다. 그러나 Overleaf에서 몇 가지 오류가 발생합니다.

여기에 이미지 설명을 입력하세요

\fillin[]나는 환경 안에 두는 것이 적절하지 않다고 생각합니다 align. 또한 일반적으로 환경 내에서 허용되지 않는 달러 기호를 제거하려고 시도했지만 align도움이 되지 않았고 분수가 올바르게 렌더링되지 않게 되었습니다.

\fillin[]환경 내부 를 처리하는 적절한 방법이 있습니까 align?

\fillin[]또한 별도의 질문을 위해 저장하는 것이 더 나을 수 있지만 클래스 외부 exam(예: 클래스 내부) 에서 작동하는 명령 을 만드는 방법이 있습니까 kaobook?

답변1

이는 결코 오류가 아닙니다. Overleaf 편집기는 $알려진 수학 표시 환경 내부에 기호 가 있는 경우를 표시하도록 지시받습니다 .

괄호 안에 제공하는 텍스트는 정답이며 \fillin수학 모드에 있는지 여부를 "알지" 못합니다. 어쨌든 텍스트 모드에서 인수를 사용합니다.

다음을 사용하면 "오류" 신호를 피할 수 있습니다.

\fillin[\ensuremath{\frac{1}{2}}]

또는 수학 모드에서 사용할 인수에 대한 별칭을 정의합니다.

\documentclass[answers]{exam}
\usepackage{multicol,amsmath}

\NewDocumentCommand{\mathfillin}{oo}{%
  \IfNoValueTF{#1}{\fillin}{%
    \IfNoValueTF{#2}{\fillin[$#1$]}{%
      \fillin[$#1$][#2]%
    }%
  }%
}

% guesses to make the code to compile
\newcommand{\degree}{\ensuremath{^\circ}}
\setlength{\fillinlinelength}{3em}
%%%

\begin{document}

Convert the following angles from degrees to radians:

\begin{questions}
  \begin{multicols}{4}
        \question
        $\begin{aligned}[t]
            180 \degree 
            &= \mathfillin[1] \pi \\
            &= \mathfillin[\frac{1}{2}] \tau \\
            &\approx \mathfillin[3.14159]
        \end{aligned}$

        \question
        $\begin{aligned}[t]
            90 \degree
            &= \mathfillin[\frac{1}{2}] \pi \\
            &= \mathfillin[\frac{1}{4}] \tau \\
            &\approx \mathfillin[1.57079]
        \end{aligned}$

        \question
        $\begin{aligned}[t]
            270 \degree
            &= \mathfillin[\frac{3}{2}] \pi \\
            &= \mathfillin[\frac{3}{4}] \tau \\
            &\approx \mathfillin[4.71238]
        \end{aligned}$

        \question
        $\begin{aligned}[t]
            360 \degree
            &= \mathfillin[2] \pi \\
            &= \mathfillin[1] \tau \\
            &\approx \mathfillin[6.28318]
        \end{aligned}$
    \end{multicols}
    \vspace*{\stretch{1}}
\end{questions}

\end{document}

align*작업에 적합한 도구는 아니라는 점에 유의하십시오 . `$\begin{aligned}[t]...\end{aligned}$가 훨씬 좋습니다.

여기에 이미지 설명을 입력하세요

옵션이 없는 경우 answers:

여기에 이미지 설명을 입력하세요

관련 정보