10 \newenvironment和\NewDocumentEnvironment命令的作用域问题?

发布于 2024-08-19 15:15:54

\newenvironment\NewDocumentEnvironment命令的<end-code>作用域

对于下面的MWE,\newenvironment\NewDocumentEnvironment<end-code>调用传入参数#1的差异?

\documentclass{ctexart}
\usepackage{xparse}
\newenvironment{env}[1]{
    \def\tmp{#1}
    first use:#1 \par
}{
    second use:#1
    %second use:\tmp
}
\NewDocumentEnvironment{envv}{m}{
    first use:#1 \par
}{second use:#1}
\begin{document}

\begin{env}{321}
    some text.\par
\end{env}

\begin{envv}{123}
    some text.\par
\end{envv}
\end{document}

我的问题是:\newenvironment能否直接在<end-code>使用参数#1

image.png

查看更多

关注者
0
被浏览
155
1 个回答

撰写答案

请登录后再发布答案,点击登录

发布
问题

分享
好友

手机
浏览

扫码手机浏览