Andrew has answered your question.  Another possibility is to have a latex file 
for each tikz-picture which produces pdf file for the corresponding figure. 
These pdf files can be inserted as figures in LyX.  This approach has two 
advantages: Firstly, you can use a good editor with syntax highlighting to edit 
your pictures. Secondly, the compilation of the latex document is much faster.  
You will automatically see the change in LyX, whenever any of these pdf files 
is updated.  In those latex files I am using 

\usepackage[active,tightpage,psfixbb]{preview}
\PreviewEnvironment{pgfpicture}
\setlength\PreviewBorder{0pt}

in order to just produce the figures without any surrounding white space. I 
don’t remember whether one actually needs the second and third line, but you 
certainly need the package tightpage.

Regards
Marcus

> On 21 Feb 2025, at 23:39, Duarte Maia <dm...@uchicago.edu> wrote:
> 
> Hi everyone,
> 
> I like to use the preview feature to put Tikz pictures on my documents and 
> see the effect of my changes in real time. This works fine when I don't mess 
> up: If I change a line and put my cursor elsewhere, the preview updates 
> accordingly, which is faster and more convenient than recompiling the whole 
> file. However, if I make a mistake (e.g. miss a semicolon), the preview 
> simply doesn't appear. Worse, I get no indication that LyX tried to compile 
> it and failed. I have to compile the entire file to figure out what went 
> wrong.
> 
> So, my question is: Is there a way to distinguish between "this preview is 
> taking a bit to compile" vs. "this preview got a compilation error", and in 
> the latter case is there a way to see the error that came up?
> 
> Thanks in advance,
> -Duarte Maia
> -- 
> lyx-users mailing list
> lyx-users@lists.lyx.org
> https://lists.lyx.org/mailman/listinfo/lyx-users

-- 
lyx-users mailing list
lyx-users@lists.lyx.org
https://lists.lyx.org/mailman/listinfo/lyx-users

Reply via email to