Log in

No account? Create an account

Previous Entry | Next Entry

I have been using xfig for a very long time, almost as long as I have been using gnuplot. But xfig has been getting a bit cranky lately, mostly in terms of font handling. I suspect that it is possible to make it handle fonts like it used to, but I decided to take this as a hint to try something that might actually be younger than the typical Linux kernel hacker. (Yes, I am getting a bit old to engage in ageism, but there you have it!)

I had tried inkscape some years back, but at the time it was not ready for prime time, at least not from the perspective of a long-time xfig user. But I had recently received a .svg, and had installed inkscape in order to be able to work with it. Besides, some of the more recent browsers can render directly from .svg, which may in the fullness of time remove the need to generate bitmap files for HTML documents.

So I gave inkscape a try.

The first pleasant surprise is that inkscape is able to import xfig's .fig file format. This import process is not perfect, for example, the fonts do not match exactly and arrowheads are sometimes imported as objects separate from the line that they are supposed to be attached to, but it is much nicer than recreating the diagram from scratch. In addition, in many cases, the import imperfections are not a problem, such as when the goal is simply to add something to the figure.

Of course, the menu layout is completely different than that of xfig, but this is not always a bad thing. For example, even given long familiarity with xfig, I found inkscape's object rotation to be much more powerful and easier to use than that of xfig. Object alignment and distribution is also much nicer in xfig. The manual canvas configuration in inkscape is a step back from xfig's automation, but it might well be that I just haven't yet found the corresponding inkscape setting. Finally, the ability to directly generate .pdf files works more smoothly with pdflatex, which I use heavily. The fact that they get rotated 90 degrees was a bit surprising at first, but the \rotatebox{270} directive in Latex takes care of that.

So who knows? After more years than I care to recall, it might finally be time to bid xfig a fond farewell.


( 13 comments — Leave a comment )
Apr. 22nd, 2013 08:18 am (UTC)
Inkscape and LaTeX
xfig, have not used for 6 Years - inkscape is so powerful.

For tex I have a figure/ directory where .svg are placed (saved in the git repo). Then I have the following Makefile to generate PDF files on the fly:

SVG_FILES = $(wildcard *.svg)
PDF_FILES = $(patsubst %.svg,%.pdf, $(SVG_FILES))
all: $(PDF_FILES)
%.pdf: %.svg
@ echo "convert "$<
inkscape --without-gui --export-text-to-path \
--export-pdf=$*.pdf $*.svg

Apr. 22nd, 2013 02:45 pm (UTC)
Re: Inkscape and LaTeX
Thank you for the info, I will try this out! The --export-pdf sounds a lot more convenient than having to always give the filename to the print dialog. ;-)
Apr. 22nd, 2013 07:16 pm (UTC)
The one unfortunate downside to Inkscape is that their diagram tool is very weak. I haven't used xfig to say whether it's any better, but when comparing with some proprietary products, it's a huge fail.

Hopefully some enterprising GSoC hacker will take up the cause this year?
Apr. 23rd, 2013 04:11 am (UTC)
I could easily believe that there are far more powerful proprietary products available. However, if I use them, then it is harder for random people to contribute. Besides which, I don't create -that- sophisticated of diagrams, so the open-source programs are plenty good enough for my use.
Apr. 22nd, 2013 11:25 pm (UTC)
PDF rotation; other tools
For PDF rotation, take a look at inkscape's canvas and export options more closely, and you should find information about portrait, landscape, and other orientation fun.

Also, to rotate a PDF once emitted, you could try pdftk.

You might also look at tikz, a powerful figure language built on LaTeX itself. Not as WYSIWYG, but significantly more powerful.
Apr. 23rd, 2013 04:13 am (UTC)
Re: PDF rotation; other tools
Thank you for the export hints!

I have played with tikz a bit, but was not all that enthralled. But yes, it might be worth another look.
Jun. 20th, 2013 06:42 pm (UTC)
How did you install?
ldd inkscape | grep not.found
libgtkmm-2.4.so.1 => not found
libgdkmm-2.4.so.1 => not found
libatkmm-1.6.so.1 => not found
libpangomm-1.4.so.1 => not found
libcairomm-1.0.so.1 => not found
libglibmm-2.4.so.1 => not found
libsigc-2.0.so.0 => not found
libgsl.so.0 => not found
libgslcblas.so.0 => not found
libwpg-0.1.so.1 => not found
libwpg-stream-0.1.so.1 => not found
libMagick++.so.10 => not found
libgc.so.1 => not found

Sounds like hell!
Jun. 20th, 2013 07:09 pm (UTC)
Re: How did you install?
I believe that I did "sudo apt-get install inkscape", though I might have used Ubuntu's Software Center. Either way, it installed and ran with no problems. I take it that you are building from source or some such?
Jun. 21st, 2013 01:43 pm (UTC)
Re: How did you install?
I don't have root permissions so was trying to use a prebuilt rpm.
Jun. 21st, 2013 02:32 pm (UTC)
Re: How did you install?
Interesting. It is unfortunate that those who have root access weren't willing to install for you. If you have your own laptop, perhaps you should install it there.
Mar. 23rd, 2016 03:33 am (UTC)
Excellent post
Excellent post . I loved the facts - Does anyone know where my assistant would be able to access a blank a form example to work with ?
Mar. 23rd, 2016 05:51 pm (UTC)
Re: Excellent post
If you are asking for some example files with which to play with inkscape, feel free to clone git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/perfbook.git and search for the .svg files.
Cortez Whittaker
Mar. 24th, 2016 01:04 am (UTC)
Hello , my friend got a sample forms here <http://goo.gl/Ms4ebj
( 13 comments — Leave a comment )