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.
KK12
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

Hello,
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

Tags:

User avatar
Johannes_B
Site Moderator
Posts: 3725
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: 8792
Joined: Mon Mar 10, 2008 9:44 pm

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

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

Stefan
Site admin


Return to “General”

Who is online

Users browsing this forum: No registered users and 11 guests