On Saturday 25 January 2014 22:52:50 Andrew Parsloe wrote:
> On 25/01/2014 7:13 a.m., Wolfgang Engelmann wrote:
> > Dear Lyx Users,
> > 
> > I have exported my lyx file as a lyx archive, which contains as a
> > tar.gz file the lyx file, the used bib file and the figures used.
> > This is quite handy, because only the used figures, bib are saved.
> > 
> > However, I have this problem:
> > 
> > The path to the figures should be ./Kalanchoe-closed.jpg
> > 
> > as an example and not e.g.:
> > 
> > \begin_inset Graphics
> > 
> > filename BluFloClockTar/AAAflowerclock20130909/Kalanchoe-closed.jpg
> > 
> > since I would like to move the lyx file to another folder or send it
> > away.
> > 
> > There are many figures, therefore I would prefer NOT to select each
> > figure path anew.
> > 
> > What would you recommend?
> > 
> > Using the tex file and, in an editor, replace the path, to end up with
> > ./figureFile? Or is there a way in Lyx? (Which would be handy)
> > 
> > Wolfgang
> 
> Hullo Wolfgang,
> 
> This is the kind of thing that can be done with the find-&-replace
> script of the pLyX scripting system (on the wiki under Examples/pLyX
> system) which allows you to work from within the LyX gui. In fact I was
> faced with a similar task a couple of weeks ago (and found a bug in the
> script which I've since corrected). The system takes a little setting up
> (two file formats and two converters to be defined, plus some files to
> be distributed around your personal LyX folders), and some practice to
> get a feel for how it works.
> 
> If you do go this way, then you would need to insert a .find-&-replace
> inset containing
> 
> -i -r
> 
> to specify a regular expression inset search, followed by two  .argument
> insets, the first (the find regular expression) containing
> 
> filename .+/([\w\d\-]+)\.jpg
> 
> and the second (the replace expression) containing
> 
> filename ./\1.jpg
> 
> Then click the View other formats button and select pLyX.
> 
> This assumes that all your graphics are .jpg format, and that the names
> of your images (like 'Kalanchoe-closed') are made up only from letters,
> digits, hyphens and underscores.
> 
> Andrew
> 
Thanks, Andrew, 

for pointing to this interesting addition to lyx. I have to try to 
understand and use it, sounds quite useful. In the meantime I have solved 
my problem manually, which was not that time consuming as I thought. Your 
proposal is of course much more elegant. 

Wolfgang 

Reply via email to