Jean-Marc Lasgouttes wrote: > Angus> Hmmm. I don't think I am suggesting 'too smart'. I'm suggesting > Angus> that we augment these tokens understood by the converters > > Angus> string const token_from("$$i"); string const > Angus> token_base("$$b"); string const token_to("$$o"); string const > Angus> token_path("$$p"); with string const > Angus> token_bufferpath("$$bufferpath"); > > Angus> why might that be a problem? > > Because $$bufferpath is too long wrt the other names. Use $$bp or > something instead. > > Does this answer your question? > JMarc > > PS: actually I agree with your other post about the fact that the special > code is in a separate script.
Actually, it turns out that we don't need the path to the buffer. We need the path to the original .fig file as it's this that all relative names stored in the .fig file are relative to. Placing the attached file, figtools.sh, in lib/scripts and hacking fig2pdftex.sh, fig2pstex.sh, (buffer dir is 'tree2', .fig file is to found in 'acinus3D_11x11x22_boundary') works beautifully. Index: fig2pdftex.sh =================================================================== # Fail silently if the file doesn't exist test -r $input || exit 0 +working_dir=`dirname $0` +test -r "${working_dir}/figtools.sh" && { + . "${working_dir}/figtools.sh" + manipulate_fig_file_if_needed \ + "$input" "$HOME/Acinus/docs/tree2/acinus3D_11x11x22_boundary" +} I therefore suggest a new token '$$orig_i', being the name of the original file from which '$$i' was copied into the temp directory. Ok? Now, Georg, could you expand on your ideas for when this magic should and should not be invoked? I'm afraid I don't see why it shouldn't be used every time that fig2pstex.sh is called. -- Angus
figtools.sh
Description: application/shellscript