xsim 솔루션 환경이 인쇄된 후의 설명

xsim 솔루션 환경이 인쇄된 후의 설명

solution패키지 환경 뒤에 주석을 추가하면 xsim해당 주석이 솔루션 앞에 인쇄됩니다.

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

\documentclass[]{article}
  \usepackage{xsim}

\begin{document}
   \begin{exercise} % execice 1
      Statement of exercise 1 
   \end{exercise}
   \begin{solution}[print] % I need a comment here
      Solution of exercise 1 
   \end{solution}
\end{document}

답변1

이 동작은 버그가 아닙니다. 내용을 그대로 읽은 다음 외부 파일에 쓰는 부작용입니다.

실제로 이는 매뉴얼(운동 환경 작동 방식에 대한 섹션 5)에 언급되어 있습니다.

명심해야 할 또 다른 사항은 환경이 여러 면에서 환경과 동일한 방식으로 작동한다는 것입니다 filecontents. 이는 또한 환경의 첫 번째 줄에 주석을 달 수 없다는 것을 의미합니다.

\begin{exercise}[points=2] % this comment will cause trouble
  Lorem ipsum
\end{exercise}

의견을 한 줄 더 아래에 입력하면 괜찮습니다.

\documentclass[]{article}
\usepackage{xsim}

\begin{document}

\begin{exercise}
  % execice 1
  Statement of exercise 1 
\end{exercise}
\begin{solution}[print]
  % I need a comment here
  Solution of exercise 1 
\end{solution}

\end{document}

관련 정보