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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In this page, Andrew Swann points me a way to make verbose formatting of algorithms (I need this only for pedagogical reasons).

The problem with this solution is that it produces unwanted warnings with my second algorithm in the following example. Is there a way to not have this warnings ?



    \newcommand\BlockIf[1]{\KwSty{Start If} \\ #1 \\ \KwSty{End If}}
    \newcommand\BlockElseIf[1]{\KwSty{Start Else If} \\ #1 \\ \KwSty{End Else If}}
    \newcommand\BlockElse[1]{\KwSty{Start Else} \\ #1 \\ \KwSty{End Else}}



    \uElseIf{2}{else if...}

    \uElseIf{2}{\ForAll{$i$}{Action $i$}}


Unwanted warning

! LaTeX Error: There's no line here to end.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.

l.26     \uElseIf{2}{\ForAll{$i$}{Action $i$}}
share|improve this question
up vote 2 down vote accepted

You have a choice, depending on the layout you want.

Either make sure that LaTeX is in a paragraph before forcing a linebreak, so replace each \\ in your example by


or don't force a linebreak if you are between paragraphs so replace each \\ by

share|improve this answer
Very tricky solution ! That's do the job. Thanks. – projetmbc Oct 30 '12 at 16:28

Your Answer


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.