It's often required to include latex symbols in publication ready figures. For example Greek symbols in LaTex can be written as \alpha which appear as the actual alpha symbol when compiled.
The same effect can be embedded in figures and these figures can be separately compiled for convenience. This means that you don't have to create any intermediate files (such as pstex) in your actual tex file but rather have standalone pdf figures.
You need to have a few things in hand and this is done in Ubuntu (or any Linux system)
1. Dia
2. fig2pdf (sudo apt-get install fig2pdf) - this will install a whole range of other converters, fig2eps etc.
3. XFig (this will be installed from the fig2pdf command itself)
4. Latex (comes with the Ubuntu distribution)
OK. In Ubuntu you can test if everything is available by typing in the commands, e.g. if you type fig2pdf it should know the command and should tell you the usage.
Now we proceed to create a figure in Dia.
You see that this figure has a shape, text and latex special text which represents the alpha symbol.
Once you create the figure you should export it as a fig so that it can be opened/edited via the XFig software.
OK, now you should have saved your .dia file and you should've exported it to XFig format with the .fig extension.
You can also directly create .fig files via the XFig software itself but it's easier with Dia.
Now you should do the following steps to successfully convert this to a postscript or a pdf figure.
Here are the steps.
OK, so we do it all in a script thanks to modified script take from here. :-)
We can easily use the pdfcrop tool which comes with tex live distribution to get rid of the white space around figures.
The same effect can be embedded in figures and these figures can be separately compiled for convenience. This means that you don't have to create any intermediate files (such as pstex) in your actual tex file but rather have standalone pdf figures.
You need to have a few things in hand and this is done in Ubuntu (or any Linux system)
1. Dia
2. fig2pdf (sudo apt-get install fig2pdf) - this will install a whole range of other converters, fig2eps etc.
3. XFig (this will be installed from the fig2pdf command itself)
4. Latex (comes with the Ubuntu distribution)
OK. In Ubuntu you can test if everything is available by typing in the commands, e.g. if you type fig2pdf it should know the command and should tell you the usage.
Now we proceed to create a figure in Dia.
You see that this figure has a shape, text and latex special text which represents the alpha symbol.
Once you create the figure you should export it as a fig so that it can be opened/edited via the XFig software.
OK, now you should have saved your .dia file and you should've exported it to XFig format with the .fig extension.
You can also directly create .fig files via the XFig software itself but it's easier with Dia.
Now you should do the following steps to successfully convert this to a postscript or a pdf figure.
Here are the steps.
- Convert fig to pstex
- You should embed this pstex in a minimal .tex file
- Compile this tex file to produce the dvi figures
- convert this .dvi figure to .ps via dvips
- Convert the .ps to pdf via epstopdf
- Clean the auxiliary files
OK, so we do it all in a script thanks to modified script take from here. :-)
We can easily use the pdfcrop tool which comes with tex live distribution to get rid of the white space around figures.
Comments
Post a Comment