4

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.

3

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
  • 4
    @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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.