Hello again!

I tried a minimal example (simple-example.lyx) and there it actually
worked. It also worked after seriously stripping down an actual project
file.

It turns out that the issue arose due to a command defined with
\providecommand in the body of the text and used within \AtEndDocument.
When compiling the preview, the contents of the body of the lyx document
are imported into a single preview block,

    \begin{preview}
    \input{1E_...}
    \end{preview}

Here \providecommand defines the macro locally to this environment, but
\AtEndDocument has a global effect, so when reaching \end{document} the
previously defined macro is used but undefined, preventing compilation. In
such cases, LyX tends to fail quietly, and I mistook it for standard
behaviour since it affected all my recent documents.

So, thanks for the help! Awkwardly enough, yet again "do a minimal example"
showed the origin of the issue :-/


best regards, Klaus


2015-05-04 13:09 GMT+02:00 edu Gpl <mandrivagn...@gmail.com>:

> Can you add examle.lyx .
> Regards
>
> ‏في الاثنين، ٤ مايو، ٢٠١٥, Klaus-Dieter Bauer <
> bauer.klaus.die...@gmail.com> كتب:
>
> Hello!
>>
>> When I open my existing LyX files with instant preview enabled for
>> equations, existing equations will only be rendered as instant-preview
>> after I change something in them.
>>
>> Many of my equations however contain inconvenient visual clutter, e.g.
>> empty left sides or large horizontal spaces in AMS align environments.
>> These would look much better in the editor if consistently rendered as
>> preview, rather than as the equation editor.
>>
>> Is it possible to make LyX render a preview for existing equations when
>> opening a file?
>>
>> - Klaus
>>
>

Attachment: simple-example.lyx
Description: application/lyx

Reply via email to