[Xcircuit-dev] XCircuit & LaTeX
Brought to you by:
rtedwards
|
From: R. T. E. <ti...@st...> - 2003-12-10 16:54:18
|
Dear Makram, Okay, you caught my interest, and I spent a whole day on it, and now XCircuit can handle LaTeX-formatted strings. The new functionality is in the xcircuit-3.1.32 distribution on the XCircuit website. It works similarly to the xfig-style handling of LaTeX strings, but with a few differences. You create a text label in the file, and select "Text->LaTeX mode" from the XCircuit menu, setting a bit which tells XCircuit to treat this as a LaTeX string, not an XCircuit string. Then you can throw in any valid LaTeX syntax into the string. When you write the file back to disk, XCircuit will note if there is at least one LaTeX-formatted string on the page. If so, it will generate an accompanying ".tex" file, containing an "epsfig" statement to include the original XCircuit file, followed by a flattened list of all the LaTeX labels, positioned in the coordinate system of LaTeX. If you run ghostview on the XCircuit file itself, you will find that the labels do not appear in the output. The PostScript interpreter ignores them, and lets the LaTeX compiler handle them instead. Because the "epsfig" line is embedded in the file XCircuit writes, the only way to resize the figure is by adjusting the scale of the figure in XCircuit before writing the output. This is a minor inconvenience, and I may do something about it in the future. Another thing to note is that LaTeX controls the size of all the labels, not XCircuit. So the default text size will match the size of the surrounding text in the LaTeX document, and any resizing can be done by the usual LaTeX font sizing statements just prior to including the XCircuit ".tex" file. This feature is intentional; it prevents text on a figure from being unreadable. If you want control over the scale of each label, LaTeX size formatting commands can be put directly into the label string. I think this is a very useful feature for XCircuit, and I thank you for sending on the example files which let me figure out how to make it work. Note that I have only barely tested the function, so you should let me know of any problems or quirky behavior. Regards, Tim |