# Context-sensitive newline macro

I'd like to write a new command putOnNewLine such that \putOnNewLine{ABC} puts ABC on a new line, with exactly one line's vertical space separating it from what has gone before.

It must also respect the boundaries of any environment it is inside. For example, if I have a \putOnNewLine at the start of an environment (say at the start of a proof following a theorem) then I don't want a new line in that case.

So I suppose I am also looking for some sort of logic that is sensitive to the context in which the command appears.

-

You could use something like

\newcommand{\putOnNewLine}[1]{\par\vspace{\baselineskip}#1}


or

\newcommand{\putOnNewLine}[1]{\newline~\newline#1}


Although it depends a bit on the purpose you would like to use this for.

-
Thanks for this. The only problem with it is that if I have a \putOnNewLine at the start of an environment (say at the start of a proof following a theorem) then I don't want a new line in that case. –  Alex Apr 7 '11 at 9:56
I suppose I am looking for some sort of logic that is sensitive to the context in which the command appears. –  Alex Apr 7 '11 at 9:57
@Alex you should probably mention that in your question. –  Seamus Apr 7 '11 at 10:15
I have edited the question. –  Alex Apr 7 '11 at 11:00