Hi,
I'd like to do a \renewcommand inside an \ifthenelse. There is some discussion on various boards how this relates to scopes, \global\let etc. - but that did not help me since I want to renew a macro with a parameter. I failed to get this done with \global\let, \xdef, ...
Ideally, I'd like to write:
I know this doesn't work on account of scoping, but I'm at a loss for alternative ideas (background: conditional use of commands from the fixme package).
Any help much appreciate.
Thanks & best,
Holger
General ⇒ Renew Command inside '\ifthenelse'
Renew Command inside '\ifthenelse'
Last edited by hkarl on Fri Feb 03, 2012 2:37 pm, edited 2 times in total.
NEW: TikZ book now 40% off at Amazon.com for a short time.

Re: Renew Command inside '\ifthenelse'
Hi,
please provide a full minimal example.
regards
Marco
please provide a full minimal example.
regards
Marco
i am German. I can not use difficult words. 

Renew Command inside '\ifthenelse'
marco_d is right: without a MWE it is very difficult to help. On first sight I don't really see the problem:
Code: Select all
Code, edit and compile here:
\documentclass{article}\usepackage{ifthen}\begin{document}\newboolean{mybool}\newcommand*\test[1]{old: #1!}\test{bla}\ifthenelse{\boolean{mybool}}{true: \renewcommand*\test[1]{new: #1!}}{false: }\test{bla}{\setboolean{mybool}{true}\ifthenelse{\boolean{mybool}}{true: \renewcommand*\test[1]{new: #1!}}{false: }\test{bla}}\test{bla}\end{document}
site moderator & package author
Renew Command inside '\ifthenelse'
Hi,
nice example. At this point I want to recommend the etoolbox package. It is really a nice package with a lot of capabilities.
Regards
Marco
nice example. At this point I want to recommend the etoolbox package. It is really a nice package with a lot of capabilities.
Regards
Marco
i am German. I can not use difficult words. 

Renew Command inside '\ifthenelse'
I actually thought about an example using etoolbox and nearly added it but didn't go along since the question was about ifthen.
site moderator & package author
Re: Renew Command inside '\ifthenelse'
Hello,
I'm impressed - fast and competent
.
The example by cgnieder put me on the right track (it was +/- exactly what I was trying to do) - sorry, I was just being stupid.
Thanks and best!
Holger
I'm impressed - fast and competent

The example by cgnieder put me on the right track (it was +/- exactly what I was trying to do) - sorry, I was just being stupid.
Thanks and best!
Holger