Angus Leeming <[EMAIL PROTECTED]> writes:

> You need to refresh the MikTeX databases. It's some obvious entry in the
> package manager's menus. If you can't find it then this is a FAQ on the
> MikTeX list.
> 
> (Sorry I can't be less vague :()

Easy, Angus. I wasn't asking for help there ;-)
It is not that simple, I'll have a look at it. Btw, the MikTeX databases
can also be refreshed from the command line by "initexmf -u".

> > Another problem I faced is the following. When not specifying a
> > \preview_scale_factor in preferences, the instant-preview inlined
> > equations are perfectly aligned on the baseline, but specifying, for
> > example, "\preview_scale_factor 1.02" causes the inlined images to be
> > shifted down by a noticeable amount.
> > 
> > I obviated to this by hardcoding in the conversion script "frac =
> > 1.02*frac", after frac is evaluated in extract_metrics_info(), where 1.02
> > matches my \preview_scale_factor. I think that this should be done in the
> > LyX sources but I didn't had a look at it.
> 
> Hmmmmm. But we already pass preview_scale_factor to the script in the form
> of the dpi variable. Why do we need to use it twice?

Perhaps you mean that the dpi variable is *proportional* to
preview_scale_factor. Indeed, when not setting preview_scale_factor I
obtain dpi=112, whereas setting it to 1.02 I obtain dpi=127. However, I
don't know the default value of preview_scale_factor (and obviously it is
not equal to 1), so I am not able to evaluate preview_scale_factor from
the knowledge of dpi.

As regards why we need to use it twice, I don't know the way the images
are imported. What I know is that if leave untouched the value of the
frac variable *and* preview_scale_factor is set to something different
than its default value, then the inlined images do not perfectly line up
with the surrounding text.

> The patch looks good to me but I guess that this block in
> legacy_lyxpreview2bitmap.py (renamed ) will need to be specialised for
> ppm files only...
> 
>     # Crop the images
>     if pnmcrop != None:
>         crop_files(pnmcrop, latex_file_re.sub("", latex_file))

You're right, I overlooked that. But it is easy to fix, isn't it ? ;-)

      # Crop the images
-     if pnmcrop != None:
+     if pnmcrop != None and output_format == "ppm":
          crop_files(pnmcrop, latex_file_re.sub("", latex_file))

> I guess that's there's going to be some interaction between this cropping
> and the veracity of the metric info...

I don't think so. The images are cropped to the left and to the right,
so the vertical dimensions are preserved. As the only information that is
passed back through the metrics file is the percentage of the height with
respect to the sum of height and depth, there should be no interaction.

--
Enrico



Reply via email to