
다른 곳에서 사용할 수 있도록 환경의 콘텐츠를 복사하고 싶습니다. 나의 주요 목적은 툴팁 노트 안에 인쇄하는 것입니다.
내 생각은 패키지를 사용하는 것이 었습니다 environ
.
\NewEnviron{foo}
{
\xdef\bidule{\BODY}
%more stuff
}
하지만 사용하면 \bidule
오류가 발생합니다.
Undefined control sequence ....
leading text: \end{foo}
Undefined control sequence \endgroup.
leading text: \end{foo}
Missing { inserted.
leading text: \bidule
main.tex:19: File ended while scanning text of \errhelp.
내 이해가 맞다면 를 사용할 때 정의되지 않기 \def
때문에 사용할 수 없습니다 . 내 목표를 달성할 수 있는 방법이 있나요?\BODY
\foo
답변1
의 전체 확장을 원하지 않고 \BODY
한 수준만 수행하고 싶습니다.
\expandafter\gdef\expandafter\bidule\expandafter{\BODY}
또는
\xdef\bidule{\unexpanded\expandafter{\BODY}}