Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a diagram which I drew in Xfig which I included latex maths in, I want to include it in my latex doc, I am not too sure how to go about it. I read the manual and it says that xfig should produce a .pstex and a .pstex_t file but all I get is an eps and a text doc with file extension _t.
Following the manual I put \input{psfig} and that throws up errors, what am I doing wrong, do I need to download anything more?
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,785
Rep:
I haven't done this for a bit (but this is a good review for me because I've got another extensive documentation session coming up soon :-) ) but here's what I've done to incorporate an EPS file into a LaTeX document:
Code:
\usepackage{dvips}[graphics,color]
\usepackage{boxedminipage}
.
.
.
\begin{figure}
\begin{boxedminipage}{\textwidth}
\begin{center}
\includegraphics{xyz_overview.ps}
\end{center}
\caption{\label{fig:xyz_overview}Overview of the XYZ Process.}
\end{boxedminipage}
\end{figure}
I'm not sure if this will work for your Xfig drawings -- I use gviz for most of my diagrams -- but it ought to get you started.
The only reason why I use Xfig is that you can add latex commands in the text and LaTeX will format them in LaTeX fonts, so I could add some equations to a drawing and I just do the appropriate LaTeX and hey presto out pops the equations, all nicely typeset.
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,785
Rep:
Yep. Sounds like what I'd use LaTeX for. I imagine that the EPS file you get out of that tool will be usable in the markup snippet I showed (or one like it). I'll make no judgements about Xfig versus graphviz (sorry I abbreviated it last time). I've only dabbled a little bit with Xfig and that was some time ago; it was probably pre-v1.0. I find that graphviz works well enough for my needs (documenting processes) and the files that define the figure are easy to stash in an RCS library for version control along with the documents.
Hope you get this working. Post back here if it doesn't and I'll see if I spot anything.
(Braces aren't the same as brackets and vice versa. :-) )
Anyway, I created a silly Xfig file and exported it as "Combined PS/LaTeX" giving me "two-boxes.ps" and "two-boxes.ps_t". You can get this figure into your LaTeX document two ways:
1.) Use your editor's "include text/file" command to pull the "_t" file directly into your document. This will work fine if you only have a figure or two but gets real ugly, real fast if you have lot's of figures or you change one of them appreciably (perhaps any change will screw things up, dunno).
2.) Rename the "_t" file to have a ".tex" suffix. In my case, I'd issue:
Code:
mv two-boxes.ps_t two-boxes.ps_t.tex
Now you can use the TeX/LaTeX "\include{}" statement to pull the file into your document:
Code:
\include{two-boxes.ps_t}
Note that you do not specify the ".tex" suffix! If you do, LaTeX's error message will show you your error quite nicely.
Code:
No file two-boxes.ps_t.tex.tex.
If you look at the "_t" file generated by Xfig, you'll notice that it contains an "\includegraphics{}" statement that drags in the PostScript file with your drawing.
Careful, though. One thing I discovered is that if you are working on a large document and you break it up into a master file and separate the major sections or chapters as "include" files, you won't be able to use the "\include{}" statements in the chapter files you are including into the master. LaTeX won't let you nest "\includes{}"; a file brought in using "\include{}" can contain an "\includegraphics{}" but not another "\include{}" (Someone really ought to fix that. It be easier to drag in boilerplate text.)
I went and did as the manual asked me and I got to the point where it couldn't find the diagram that I wanted to insert, so I am told that Linux doesn't look at the file extensions, is this also the case for LaTeX though?
I will have a little look at graphviz, can you add equations to your picture like Xfig claims?
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,785
Rep:
As good as I think graphviz is, it will come up short, I suspect, for what you want to do. It's strength is in drawing graphs (No, not X-Y plots but graphs. There's a difference.) It does not allow you to add equations in the output. Actually, that's not strictly true. There is a way to include graphics files that can be used to represent nodes on your graph. I suppose there's no reason why that included graphics file couldn't contain equations but it would be extremely clunky to do it that way. Especially when TeX's equations are just so beautifully typeset.
I'm not quite sure I understood what trouble you encountered with the file extensions. It is true that Linux does not make any distinction about how to handle a file based on it file extension; it uses what are called "magic numbers" to decide what to do with a particular file. (BTW, there's a good article in this month's Linux Magazine -- print edition only AFAICT -- regarding magic numbers in case you want to read about it.) That said, there are applications that assume certain file extensions for certain type of files. For LaTeX, included files are assumed to have a ".tex" at the end of the file name. In fact, it also assumes that you know this and will not specify it in the name of the file. Of course, it's not consistent as an "\includegraphics{}" does expect the file extension to be specified. (At least that's my experience with PS and EPS files that I've pulled into LaTeX documents.)
Can you post the "\include{}" statement you're trying to use and the error message that you are seeing? And, just out of curiousity, what manual are you referring to?
Lyx is a graphical front end for LaTeX. If you do a few minutes of reading the instructions and looking at the pulldown menus, inserting eps files (or other formats) is not a problem.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.