> I had a look at the source code and found that we only need to change
> lib/scripts/lypreview2bitmap.sh. If you allow, I will try to figure out a
> patch.

The following works for 1.4cvs: a black WrongFormula box will be shown 
in place of wrong formula. This is just to show the idea, no efficiency  
has been considered.


edit lib/scripts/lyxpreview2bitmap.sh, remove line 131:
BAIL_OUT "Failed: ${LATEX} ${TEXFILE}"

replace it with

head -`grep -n 'begin{preview}' ${TEXFILE} | cut -d: -f1` ${TEXFILE} > wrongformula.tex
cat >> wrong formula.tex  <<EOF
\fbox{WrongFormula}
\end{preview}
\end{document}
EOF
${LATEX} wrongformula.tex
/bin/mv -f wrongformula.log ${LOGFILE}
/bin/mv -f wrongformula.dvi ${DVIFILE}


The idea is simple:
1. replace the wrong formula with \fbox{WrongFormula} and write to file 
   wrongformula.tex. grep is used to find the line number of \being{preview}. 
2. compile and replace LOGFILE and DVIFILE by wrongformula.log and .dvi

-- 
Bo Peng

Reply via email to