wrap LaTeX command in environment

后端 未结 5 1984
谎友^
谎友^ 2021-02-05 06:22

How can I wrap a LaTeX command in an environment? In essence, how can I turn \\somecommand{contents} into \\begin{somecommand} contents \\end{somecommand}? I have tried the obvi

5条回答
  •  既然无缘
    2021-02-05 06:41

    New environment somecommand defines the macro \somecommand. You can not use macro with the same name \somecommand inside.

    Moreover you should write

    \newenvironment{name}{openning command}{closing commands}
    

    rather than

    \newenvironment{somecommand}[0]{ \somecommand{ } { } }
    

    You obviously have a problem with closing commands.

提交回复
热议问题