wrap LaTeX command in environment

后端 未结 5 1986
谎友^
谎友^ 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:52

    This can be done with the environ package as follows:

    \usepackage{environ}
    ...
    \NewEnviron{very-important}{\emph{\BODY}}
    

    \BODY contains the body of the environment, and environments may be nested. See the documentation for more details.

提交回复
热议问题