Generalreplace a command by its starred version

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
jossojjos
Posts: 27
Joined: Tue Feb 07, 2012 4:52 pm

replace a command by its starred version

Post by jossojjos »

Hello,

Is there a way to automatically replace a command by its starred version ?
I'm using lyx, and would like it to use \vpageref* instead of \vpageref
The simple :

Code: Select all

\renewcommand{\vpageref}{\vpageref*}
didn't work, it produces the error message "Tex capacity exceeded" ...

Thanks,
Jos

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

jossojjos
Posts: 27
Joined: Tue Feb 07, 2012 4:52 pm

Re: replace a command by its starred version

Post by jossojjos »

Hmmm, I didn't think the question was that difficult ... or is it just total nonsense to redefine a command to its starred version ?
StarValkyrie
Posts: 89
Joined: Fri Jan 24, 2014 12:42 am

Re: replace a command by its starred version

Post by StarValkyrie »

You're using LyX, so do you just have a bunch of ERD boxes with the vpageref command in them? Just Find&Replace. Or is it implemented some other way?
jossojjos
Posts: 27
Joined: Tue Feb 07, 2012 4:52 pm

Re: replace a command by its starred version

Post by jossojjos »

Thanks for replying ... but yes, it's implemented differently : no need for ERT, but one can insert references through the GUI. The advantage is that one can choose the labels to refer to from a list, and on updating a label name, all references to it get updated as well.

Of course, using ERT is indeed possible, my text is scattered with those boxes, but I thought that replacing the command would be even easier ... I'm starting to doubt, however.
StarValkyrie
Posts: 89
Joined: Fri Jan 24, 2014 12:42 am

Re: replace a command by its starred version

Post by StarValkyrie »

Maybe you could try exporting it to TeX and then doing find&replace on the result using Texworks (which is part of some MikTeX installations) or another TeX or text editor, then import it to LyX again? That might cause more problems than its worth though, depending on how well LyX does at importing your particular document.
jossojjos
Posts: 27
Joined: Tue Feb 07, 2012 4:52 pm

Re: replace a command by its starred version

Post by jossojjos »

Indeed, that would be a hassle, and all it will do is putting the \vpageref* commands in ERT boxes, something I can do easily myself (I only have a few of them at the moment).

There's maybe another way of getting rid of that annoying space before vpageref ...
Post Reply