Is it possible to abbreviate the cumbersome commands \begin{}...\end{}
once and for all?
I mean, except for \begin{document} ... \end{document}
, I would like to have the environments such as \begin{theorem}...\end{theorem}
become simply one-line command.
Best Answer
This uses an environment - wrapper, via
\NewDocumentCommand
fromxparse
package for possible better configurability (and\par
content as argument values).Possible vertical spacing issues are not addressed.
It's however not possible to say
\mytheorem{Title} content ...
since the environment needs a clear end.Edit: Update ... a 'generic' wrapper command for such theorem environments
This defines a generic wrapper command for such
newtheorem
issues:\GenericWrapper[section]{theoremname}{Theoremname}
will generate a command\mytheoremname
with is wrapper for\begin{theoremname}...\end{theoremname}
and reset every section (default value of the optional 1st. argument). (xparse
is used with\NewDocumentCommand
for this, in order to facilitate the usage of optional arguments in contrast to the\newcommand[][]
way.)The command changes the theorem label to
\arabic{theoremname}
.