Menu

#38 tikz: absolute paths to images prevent sharing it

fig2dev
closed
nobody
None
2024-12-30
2019-01-01
Juan
No

Hi,

I think xfig should use relative paths when exporting to tikz.
If absolute paths are used (as xfig currently does), an exported tikz is valid for the exporting computer only. If relative paths were used, the tikz file would be valid for any computer, as long as the referenced pictures are stored in the same relative path.

MACHINE/OS:
Linux 4.19.0-1-amd64 #1 SMP Debian 4.19.12-1 (2018-12-22) x86_64 GNU/Linux

VERSIONS:
transfig(fig2dev) Version 3.2.7a
pdfTeX 3.14159265-2.6-1.40.19 (TeX Live 2019/dev/Debian)

DESCRIPTION:
I attach a zip with several files to reproduce the reported behavior (same file than previous report). It contains:
- example.tex (main tex file loading both a pdf_t and a tikz exported from a fig)
- example.pdf (pdf version of example.tex, generated with pdflatex)
- crono/crono.fig (fig file, including several image files)
- crono/crono.pdf,pdf_t (exported pdftex files)
- crono/crono.tikz (exported tikz file. Warning: full paths will no longer be valid)
- crono/* (several included jpeg/png images)

1 Attachments

Discussion

  • tkl

    tkl - 2019-01-02

    Thanks for your observation. The matter is indeed even worse: When exporting from xfig, absolute path names are used in the output files. In contrast, when using the fig2dev backend program directly, relative path names are used. For the time being, I recommend to create figures with xfig, and to convert the figures by invoking fig2dev from the command line. This will also allow to set options that are not accessible from within xfig. Recent versions of fig2dev output help text specific for a given output language, e.g., fig2dev -L tikz -h.

     
  • Juan

    Juan - 2019-01-06

    Thanks for your response.

    Effectively, fig2dev uses relative paths, and the -i option allows tuning the desired paths.

    The incorrect tikz in the attached files can be correctly generated by fig2dev -L tikz -i crono/ -F -C 1 crono.fig crono.tikz.

     
  • tkl

    tkl - 2023-10-25

    With xfig 3.2.9, relative paths of embedded images are written to the fig file. If absolute paths are desired, an absolute path can be entered as picture filename (and must be entered manually).
    Strangely, if the absolute path to an eps file that resides in the directory where xfig was started is given, the absolute path gets lost.

     
  • tkl

    tkl - 2024-12-27
    • status: open --> pending
    • xfig / fig2dev: --> xfig
     
  • tkl

    tkl - 2024-12-27

    With 3.2.9a, relative files names are exported. Absolute paths also work.

     
  • tkl

    tkl - 2024-12-30
    • status: pending --> closed
    • xfig / fig2dev: xfig --> fig2dev
     

Log in to post a comment.