Hello,
Would it be a good idea to make LyX "clip" inserted EPS figures to their
bounding boxes? Some programs produce EPS files with extra whitespace
around the bounding box. The bounding box may, however, correctly
surround the actual picture and nothing else. A file like this is
illustrated below:
-----------------
| | Symbols: -- and | = visualisation of the file
| | xx = picture
| | ...= bounding box
| |
|................|
|.xxxxxxxxxxxxxx.|
|.xxxxxxxxxxxxxx.|
|.xxxxxxxxxxxxxx.|
|................|
-----------------
Now, when an EPS file like this is inserted as a figure float in a LyX
document, the whitespace covers the text above/around it in the PostScript
output. This applies to LyX versions up to and including 1.0.1. This
behaviour can be corrected by making LyX clip EPS figures to their
bounding boxes. All that is needed is to add two characters to the source
code file 'figinset.C', as explained below.
When you insert a figure float in your document, LyX generates LaTeX code
like this, for example:
\begin{figure}[hbt]
{\par\centering \resizebox*{8cm}{!}{\includegraphics{example.eps}} \par}
\caption{\label{An example figure} Label text }
\end{figure
The important thing here is the LaTeX command \includegraphics. It has
also another form, written with an asterisk (*) at the end, i.e.
\includegraphics*. The file grfguide.dvi, which comes with the package
'graphics', explains the difference between these two variants as
"If * is present, then the graphic is 'clipped' to the size specified. If
* is omitted, then any part of the graphic that is outside the specified
'bounding box' will over-print the surrounding text."
So in LyX, EPS figures are not clipped by default. If the document
contains EPS figures that extend beyond their bounding boxes, the result
is quite ugly. If the LyX document is exported as LaTeX and each
occurrence of \includegraphics is changed to \includegraphics*, the output
looks ok. The correction can be automated by changing the commands in the
file 'figinset.C' before compiling. There are two instances of the
\includegraphics command. Also the \includegraphics* command is there
once, but inside a comment (AFAIK, I don't know much about programming).
I don't subscribe to this list, so please cc me when replying.
Tero Kesti [EMAIL PROTECTED]
Institute of Materials Chemistry
Tampere University of Technology