
LaTeX 파일에 google-fu로 해결할 수 없는 문제가 있습니다. 동일한 오류에 대한 대부분의 답변은 \end{frame}
들여쓰기가 되지 않을 수 있다고 말합니다. 사용하지 않아 \end{frame}
.
내 목표
"응답"이라는 환경을 정의하고 싶습니다. 포함된 텍스트를 렌더링하는 것은 전역 매개변수에 따라 선택 사항이어야 합니다. 이를 위해 저는 유연성과 사용 편의성을 위해 "태깅" 패키지를 사용하기로 결정했습니다.
문제
선택적 텍스트를 렌더링하면 작동하지만 이를 숨기면 오류가 발생합니다. pdflatex를 사용하여 컴파일합니다.
프리앰블을 통해 선택적 블록을 표시하고 \usetag{instructeur}
, 를 통해 숨깁니다 \usetag{whatever_else}
. 다음 MWE를 참조하세요.
\documentclass[12pt]{exam}
\usepackage{tagging}
\newenvironment{reponse}[0]{\begin{taggedblock}{instructeur}}{\end{taggedblock}}
\usetag{instructeur}
\begin{document}
This is normal text, always displayed.
\begin{reponse}
This text should only be displayed if we do \texttt{\textbackslash usetag\{instructeur\}} in the preamble.
It should disappear if we remove \texttt{instructeur}, but throws and error instead.
\end{reponse}
\end{document}
태그 지정은 자체적으로 잘 작동하도록 추가해야 하며, 내 환경의 begin
및 명령으로 배치할 때만 중단됩니다.end
"답변"과 같이 다른 패키지를 사용하는 솔루션을 제공하지 마십시오. 나는 "태깅"을 사용하고 싶고 내가 달성하려는 것이 꽤 가능하다고 믿습니다.
미리 감사드립니다!
답변1
@campa의 답변이 작동합니다. 를 사용하면 \taggedblock{instructeur}
실제로 \endtaggedblock
오류 없이 컴파일되어 원하는 출력이 생성됩니다.
그렇다면 공식 매뉴얼에는 왜 \taggedblock
and \endtaggedblock
구문이 언급되지 않습니까?
수동 푸드 위치CTAN