On 03/19/2014 02:41 AM, Liviu Andronic wrote:
On Wed, Mar 19, 2014 at 5:09 AM, aparsloe <apars...@clear.net.nz> wrote:
On 18/03/2014 8:48 p.m., Vincent van Ravesteijn wrote:
On Tue, Mar 18, 2014 at 2:33 AM, Richard Heck <rgh...@lyx.org> wrote:
On 03/17/2014 06:51 PM, aparsloe wrote:

On 18/03/2014 11:07 a.m., Liviu Andronic wrote:
On Mon, Mar 17, 2014 at 10:30 PM, aparsloe <apars...@clear.net.nz>
wrote:
If an instant preview inset is wrapped around something that produces
empty
LaTeX output, the preview inset becomes invisible in the LyX work-area
window, and can sometimes be quite hard to re-locate.

Is this related to: http://www.lyx.org/trac/ticket/8636 ?

Liviu
Yes. Thanks for pointing me to this ticket Liviu, which is essentially
the
same problem as http://www.lyx.org/trac/ticket/7522, although from a
quick
scan neither ticket makes any mention of possible malicious use of this
"feature", as suggested below. A \gobble command really does "eat" into
the
pdf, and with more elaborate coding could do real damage while being
invisible in the LyX document.

I agree this is a problem. It seems to me that if we have problems
compiling, then we should simply fail and not try to display a preview
image. Of course, that does not deal with the invisible image. I don't
know
what to do there other than to test its size and, again, refuse to
display
the preview if it is too small.

Richard

It is then adviced to make the background of the previews slightly
different than the background of the text area.

For the empty images (with size 0x0), we should indeed paint something
else (on my long, long todo list).

Vincent
I'm not a developer and so have no idea of the feasibility of this. I wonder
if it is possible to have alternative views of a preview inset? One would be
the current one, trying to give a faithful rendering of the inset's
contents; the other would be in the style of Note insets with a label and
different background. Even for empty insets the label would be there to
alert the reader, so there would be no need for code to test the inset's
contents.

I agree. Instead of issuing a warning or whatever if the preview image
is less than 5px, we could simply add label (or red frame) to any
preview less than 5px. And no label for any preview bigger than that.
This should take care of making small or inexistent previews
immediately visible.

Here are a couple patches that do this sort of thing for math, at least. There are two parts: (i) If compilation fails, then we return an error and so not attempt to display a preview image (that seems right not matter what else we do); (ii) If the image is too small, we draw a 2px frame around it in the error color.

Thoughts?

Richard

Reply via email to