Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

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.

share|improve this answer
    
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
3  
@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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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