Jun/065
LaTeX and XFig Troubles
Are any LaTeX experts reading this blog? I want to create a simple figure in xfig and use it in my LaTeX document with proper LaTeX math fonts. I have tried the supposedly standard way of marking text "special" and use LaTeX fonts in XFig and export the figure in name.pstex and name.pstex_t files. I then use \input{name.pstex_t} inside a figure enviroment to actually use the figure. The result is weird, the text is fine but the overlayed postscript included from the pstex_t file is not shown, instead a bounding box and a label is drawn. I have tried to open the pstex file in a postscript viewer, and that looks correct.
Here is the LaTeX code:
\begin{figure}[tbh]
\centerline {
\input{isect.pstex_t}
}
\caption{Finding intersectings}
\label{fig:correctness}
\end{figure}
And the output can be seen in the attached screenshot.
![]()
The body of the pstex_t file includes the pstex file by starting a picture enviroment and then use \includegraphics:
\begin{picture}(0,0)%
\includegraphics{isect.pstex}%
\end{picture}%
June 19th, 2006
I only have vague memories about Latex, but I did make xfig drawings with Latex fonts when I was writing my theses four years ago. Looking in the Makefile that generated the report, I can see that I converted my xfig drawings to eepic format using a command line tool, “fig2dev -L eepic -s10 foo.eepic”. The eepic files contain Latex codes. I then included these in Latex using \input{foo.eepic}.
Drop me a line, if you want the source files.
June 19th, 2006
I agree that exporting using eepic macros is a first step to getting a better picture (TeX can not draw lines of arbitrary slopes). When I export a picture like that I get a file which starts a picture environment. Simply including the file using \input should work (possible first when you’ve converted the stuff to PostScript). If you want the picture centered, then use the \centering command — I haven’t heard about \centerline before, maybe it’s the same?
June 19th, 2006
Thank you for your answers.
But I would like to make the pstex_t/pstex method works since it seems so popular. What will happen with my math mode LaTeX text snippets if I export to eepics? I suppose I could try again when I get in tomorrow. (I am tired now, someone kept me up late yesterday with move and loads of carbs)
\\centerline seems to work fine for centering, I got the code from the manual to the llncs.sty style I use (it\’s the Springer Lecture Notes in Computer Science style).
I guess the crux is the following: Why \\includegraphics\’ing my pstex file not work?
June 20th, 2006
Well… I’ve never seen that particular method mentioned before, so it’s not universally recognized. What should be universally recognized is a picture environment using eepic macros :-)
As I remember it, then you tell Xfig that the text is “special” which means that it leaves stuff like $a_x^2$ alone — the markup survives to the LaTeX step and is thus translated into nice math (it could have espaced $ as \textdollor, etc…). Or something along those lines… I haven’t used Xfig in many, many years.
June 20th, 2006
Problem solved. Martin pointed out that I was using draft mode (in order to use the fixme package) and that mode inhibits figures. I have now moved the draft mode to only apply to the fixme package.