Download
Source: Version 0.7.2 (33KB, tar.gz). You need a C compiler.News (2013-01-21)
Version 0.7.2 released (changelog.txt).
--- email begins here --- Date: Fri, 14 Sep 2012 17:20:18 +0200 From: Bugs BeastieSubject: [PATCH] fig2pstricks text.c bugfix Hello! Not sure you are still maintaining this piece of code... Nevertheless I have found a bug in a text handling code. The problem manifests itself if there are text symbols with a code > 127 in a .fig file. The assignment (integer) n = (signed char) *p at lines 43 and 47 in text.c will result in a negative n and lead to the out-of-bound access at line 141 in text.c The attached patch is a quick band-aid, it is better to check the whole code for such errors and you know the code much better than me... Thanks for the nice converter anyway! Attached: patch-fig2pstricks_text_c.txt --- email ends here ---
News (2011-02-04)
The web site is back.
News (2009-02-18)
Version 0.7.1 released.
A minor bugfix and feature enhancement
What is fig2pstricks
Fig2pstricks converts a xfig or equivalently a fig file to pstricks. Current version works with FIG 3.2. I wrote it for my personal purpose of teaching econometrics. It's not bad to use it to process an xfig (or fig) file generated by the xfig() device of R.
Go to Freshmeat project page.
Example
Here is a sample R file which generates leastsq.fig file. Then the fig file is processed by fig2pstricks to produce leastsq.tex (command: fig2pstricks leastsq.fig -o leastsq.tex -c --prosper -d -T "A Simulation"). You can run 'latex leastsq' (twice if necessary), followed by 'dvips leastsq' and 'ps2pdf leastsq.ps'. Here is the resulting pdf file.
Screenshot
A screenshot for the pdf slide generated by R and fig2pstricks with Prosper is found here. The pdf file is here. The R source is here (with data from Ramanathan, Introductory Econometrics with Applications).
Documents
No manual page is available. (I have no time to write it.) But you can use "--help" (or "-h") option for help. Here is the output of fig2pstricks --help:
$ fig2pstricks --help fig2pstricks: A fig to pstricks converter Usage: fig2pstricks [options] [input_file] Options: -o FILE Set output file to FILE, default=stdout -c Produce complete latex file -u UNIT Specify unit, (default=1cm) or ux,uy xunit is ux, yunit is uy (eg 1in,2.54cm) use in, cm or mm (default=cm) unit is unit*scale (cm) -s SCALE Scale factor is SCALE (default=0.8) or sx,sy x scale factor is sx, y scale factor is sy unit is unit*scale (cm). -12 Add '12pt' in the document option. effective only when used with -c. -11 Similar to -12 except that it adds '11pt' -p PADDING Padding in fraction of unit (default=0.5) --prosper Output with full Prosper support. -T title Set the slide title to title in prosper. Ignored in non-prosper mode -F format Prosper style format (default=default). One of frames, lignesbleues, azure, troispoints, contemporain, nuancegris, darkblue, alien glow, autumn, gyom, rico and default. Ignored in non-prosper mode. -d, --use-dot Convert ellipses to dots instead of ellipses -m, --math-label Use math (enclosed by two $'s) for labels --empty Append \thispagestyle{empty} when -c is enabled This option is good for producing eps and pdf files --latex-symbols Convert characters to latex commands --ignore-specials Ignore depth change specials See --depth-help option. --depth-help Help on bringing forward or sending backward objects. -v, --version Show version -h, --help Show this help
How to create nicely bounded eps and pdf for latex and pdflatex
Xfig (fig2dev) converts xfig files to eps and pdf format. (See man fig2dev.) But they don't take care of math symbols. We can use the --empty option to hide the page number so dvips, ps2epsi and epstopdf can create proper graphic files. This is sometimes handy. See the following example.
$ fig2pstricks -c --empty input.fig -o output.tex ### try scaling with the -s option $ latex output $ dvips output $ ps2epsi output.ps output.eps $ epstopdf output.eps
If you don't use the --empty option, then the created eps and pdf files will contain the page number as well, resulting in a strange graphic.
Copyright, excuses, porting
Fig2pstricks is released under GPL version 2.0. It may contain errors. Please do not expect any beauty in the program logic for I am just a novice amature programmer and I wrote this solely for my personal purpose.
There may be out there some good ones. But I had no time to search, and decided to write one myself.
It's written on Linux. I think no OS specific codes are included, so it should compile on other operating systems.