Hello!
I am currently working on a set of figures for a book (though I am no where cool enough to say it's for my own book! lol). I was told that the figures need to be in the .eps file format, but found out recently you cannot embed LaTeX code for any text used in the figure (i.e. number/axis labeling). The source of this discovery is here, under "Type B":
http://epb.lbl.gov/xfig/frm_miscellaneous.html
So per their advice at this link, is to use a font in Xfig that matches or most closely matches the font used in LaTeX. Like my previous dilemma, I am not sure what the name of the default font is that is used for text and math symbols in LaTeX.
If anyone knows, that would be great. Thanks!
Graphics, Figures & Tables ⇒ Correct font to use in Xfig
NEW: TikZ book now 40% off at Amazon.com for a short time.

Correct font to use in Xfig
Instead of using the Type B scenario, use Type C: PostScript/LaTeX format. That will render text (including math symobols) with the LaTeX fonts in your document. Follow these steps:
1. Run this command to start xfig:
2. Create your xfig figure, or open an existing one. You can put LaTeX characters in your text labels, e.g. $x^2 + y^2 = z^2$.
3. Go to File --> Export, then in the Language option select "Combined PS/LaTeX (both parts)". Save your file with a .pstex extension, e.g. myfigure.pstex. This will create two files: myfigure.pstex and myfigure_t.pstex. The first is the EPS figure and the second is a LaTeX file that handles the text for the EPS figure.
4. In your LaTeX document you input the myfigure_t.pstex file where you want the figure to appear:
Doing all this with new xfig figures should work fine. The only possible snag might be with exporting existing xfig figures that were not created with the special xfig command-line parameters from step 1. So worst case you may have to redo those figures. But in the end you'll have LaTeX fonts in your figures.
1. Run this command to start xfig:
Code: Select all
xfig -specialtext -latexfonts -startlatexFont default
3. Go to File --> Export, then in the Language option select "Combined PS/LaTeX (both parts)". Save your file with a .pstex extension, e.g. myfigure.pstex. This will create two files: myfigure.pstex and myfigure_t.pstex. The first is the EPS figure and the second is a LaTeX file that handles the text for the EPS figure.
4. In your LaTeX document you input the myfigure_t.pstex file where you want the figure to appear:
Code: Select all
\input{myfigure_t.pstex}
Correct font to use in Xfig
Thank you shadgrind for the response! Sorry it has taken me a bit to respond. I am having problems going with the Type C scenario. I feel like it might be because I am using Xfig through a cygwin/Xwin server on a Windows OS system. I might also be forgetting a package to declare in the preamble. The epsfig package is declared though, but I don't think that helps. Here is what happened when I tried the steps you gave me:
I created a triangle with the Pythagorean Theorem under it along with "This is triangle $ABC$", and exported it as triangle.pstex; after exporting I had the triangle.pstex file, but instead of the triangle_t.pstex file, I instead had a triangle.pstex_t.
In my LaTeX document, I put in as the code,
and am able to compile it (into DVI or through PS into PDF), except I get an undefined control sequence warning (for each line of text). As for the actual figure, the figure shows up, the text shows up the way it should be, except along with it there are the symbols "[rbg]0,0,0" at the beginning of each block of text.
I admit I am not familiar with operating systems outside of Windows, so I do very much appreciate the help. Also, I am using TeXnic Center as my compiler, so maybe the issue is also there. It was suggested to me that I try TeX Studio.
Thanks again!
I created a triangle with the Pythagorean Theorem under it along with "This is triangle $ABC$", and exported it as triangle.pstex; after exporting I had the triangle.pstex file, but instead of the triangle_t.pstex file, I instead had a triangle.pstex_t.
In my LaTeX document, I put in as the code,
\input{triangle.pstex_t}
and am able to compile it (into DVI or through PS into PDF), except I get an undefined control sequence warning (for each line of text). As for the actual figure, the figure shows up, the text shows up the way it should be, except along with it there are the symbols "[rbg]0,0,0" at the beginning of each block of text.
I admit I am not familiar with operating systems outside of Windows, so I do very much appreciate the help. Also, I am using TeXnic Center as my compiler, so maybe the issue is also there. It was suggested to me that I try TeX Studio.
Thanks again!
Correct font to use in Xfig
You may have to use the xcolor package. Try this basic LaTeX file (call it test.tex):
That should work with a standard latex+dvips+ps2pdf compilation, via these commands in a terminal window:
Code: Select all
Code, edit and compile here:
\documentclass{article}\usepackage{xcolor}\usepackage{graphicx}\begin{document}\begin{center}\input{triangle.pstex_t}\end{center}\end{document}
Code: Select all
latex test.texdvips -Ppdf -G0 -z test.dvips2pdf test.ps
Re: Correct font to use in Xfig
Using the xcolor package makes it work beautifully! (The preamble already had the graphicx package.) Thank you very much shadgrind!