[Tex/LaTex] Defining ‘newcommand’ without brackets

bracketsmacros

I know that in LaTeX newcommand is defined as:

\newcommand{name}[num] {definition }

But I want to define a new command whose argument is not defined between brackets, and it is defined with between \begin and \end commands. For example, something like this:

\teststart bla-bla-bla \testend

Maybe I should define two newcommands, one for \teststart and one for \testend.

I should mention that I have seen such commands in the changebar package,
\cbstart and \cbend.

Best Answer

A higher level possibility is with xparse:

\usepackage{xparse}

\NewDocumentCommand{\teststart}{+u{\testend}}{%
  do something with #1%
}

The + allows the argument to contain blank lines.