Menu

Cool stuff for xfig

2024-11-30
2024-12-03
  • Peter Smith

    Peter Smith - 2024-11-30

    Dear All,
    I have been using xfig for ages, but unfortunately, with my new Mac PC, I am not able to insert figures. Hope this problem can be fixed soon. Let me share with you a script (see attachment) that converts xfig with latex stuff inside into a clean pdf image. Enjoy! The synthax is:

    ./xfig2pdf file_name.fig

    and it generates the equivalent file_name.pdf

     
  • tkl

    tkl - 2024-12-02

    Note, though, that the epic, eepic, pict2e, pstricks and tikz output drivers of fig2dev have the "-P" option, to produce a complete document. With tikz output, any fig file can be rendered, while, e.g., the pict2e output can not fill objects with patterns. With epic and eepic, postscript fonts are not used. After creating a figure, try

    fig2dev -L tikz -P drawing.fig drawing.tex
    lualatex drawing.tex

    to generate drawing.pdf.

     
  • Peter Smith

    Peter Smith - 2024-12-02
    I had problems with the commands you suggested. fig2dev went well. But when I ran lualatex I got:
    ....
    ! error: (file path.to.file/name.tiff) (pdf backend): internal error
    unknown image type
    ! ==> Fatal error occurred, no output PDF file produced!%

    the script I suggested worked great for the same xfig file, which has latex math, a tiff image and arrows and squares.

     
  • tkl

    tkl - 2024-12-02

    The commands I suggested rely on latex (pdflatex, lualatex, xelatex, ...) to be able to read the image format. png, pdf, jpeg might work, but not tiff.

     
  • Peter Smith

    Peter Smith - 2024-12-03

    In this sense, the script I shared with the community looks more general.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.