On Thursday 08 February 2007 13:36, Gerard Ateshian wrote:
> Hi,
>
> I wrote a perl script, renumber.pl, for renumbering equations in LyX
> (attached). It will take existing equation labels and renumber them
> according to the section heading. For example, in Chapter 1, section
> 4, subsection 2, equations will be labeled 1.4.2.1, 1.4.2.2, etc.
> The script will not create equations labels where there were none.
>
> Usage (at a command prompt, assuming you have perl on your system):
>
> perl renumber.pl oldfile.lyx newfile.lyx [ oldprefix [ newprefix ] ]
>
> It searches oldfile.lyx for equation labels of the form "\label{eq:"
> where "eq:" is the default prefix. After renumbering equations (and
> all references to them) it saves the revised document in
> newfile.lyx. (newfile.lyx will be overwritten without prompting.)
>
> If you use another prefix for equations, such as "EQ-", specify it in
> oldprefix, e.g.,
>
> perl renumber.pl oldfile.lyx newfile.lyx EQ-
>
> You can also specify a new prefix for equation labels, e.g.,
>
> perl renumber.pl oldfile.lyx newfile.lyx EQ- Eqs:
>
> If you want to experiment with it I suggest making a safe copy of
> your document first. Also note that this is one of my first attempts
> at perl scripting, so I may not have written this script in the most
> efficient manner.
>
> I don't know if others will find it useful, but if so, is there a
> website where one can post contributions? I couldn't find it on the
> LyX wiki.
>
> Thanks,
>
> Gerard Ateshian
That is too cool! Thanks Gerard.
I think before you can post this on the Internet and have people use it, you
need to give it a license -- GPL V2, GPL V3, BSD, whatever. Until you do that
it's just proprietary software, and it's unlikely anyone will improve upon
it.
SteveT
Steve Litt
Author: Universal Troubleshooting Process books and courseware
http://www.troubleshooters.com/