LaTeX forum ⇒ Generalrenewcommand\algorithmicendfor and renewcommand\algorithmicendif does not work Topic is solved

LaTeX specific issues not fitting into one of the other forums of this category.
Posts: 1
Joined: Fri Jan 12, 2018 9:36 am

renewcommand\algorithmicendfor and renewcommand\algorithmicendif does not work

Postby KK12 » Fri Jan 12, 2018 9:49 am

I'm trying to write a program for a pseudocode with while-loops, for-loops and if-else instructions in Latex.
I would like to remove the "do" of the while-loop, the "end for" of the for-loop, the "then" and the "end if" of the if-else statement.

I have the following package installed
  1. \usepackage{algorithm}
  2. \usepackage{algorithmic}

and created the following commands

  1. \newcommand\NoDo{\renewcommand\algorithmicdo{}}
  2. \newcommand\NoThen{\renewcommand\algorithmicthen{}}
  3. \newcommand\NoEndfor{\renewcommand\algorithmicendfor{}}
  4. \newcommand\NoEndif{\renewcommand\algorithmicendif{}}

The first two work, but the last two are not.
No error meassage is generated, but nothing happens. Do I have to write the last two commands differently?

Thanks in advance


User avatar
Site Moderator
Posts: 3795
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Fri Jan 12, 2018 11:12 am

Crosspost in goLaTeX
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

User avatar
Stefan Kottwitz
Site Admin
Posts: 8953
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Fri Jan 12, 2018 3:37 pm

Solved there on (link) by a guest's post, solution was: insert \NoEndWhile before the corresponding \WHILE and not later, not right before \ENDWHILE.

Site admin

Return to “General”

Who is online

Users browsing this forum: No registered users and 8 guests