The easiest way to install Lyx on Windows is to use the LyxWinInstaller, which installs Lyx together with the software it needs, including performing a basic install of Miktex.
If Lyx still doesn't find Miktex after installation, which I have heard can happen if it is installed separately, check that the Windows system variable miktexdir
is set to the path of the Miktex program directory.
Here's a possibility for a Unix systems, with error redirection:
\documentclass{article}
\usepackage{gnuplottex}
\usepackage{etoolbox,catchfile}
\patchcmd{\gnuplotgraphicsprocess}
{\gnuplotexe\space \subfolder\figname.gnuplot}
{\gnuplotexe\space \subfolder\figname.gnuplot\space 2>>\jobname.gnuploterrors}
{}{}
\AtBeginDocument{\immediate\write18{rm -f \jobname.gnuploterrors}}
\makeatletter
\long\def\gnuploterrors@eatpar#1#2\@nil{\def\gnuploterrors@{#2}}
\AtEndDocument{%
\CatchFileDef\gnuploterrors@{\jobname.gnuploterrors}{\endlinechar=`^^J \catcode`\ =12 }%
\expandafter\gnuploterrors@eatpar\gnuploterrors@\@nil
\ifx\gnuploterrors@\@empty\else
\PackageWarningNoLine{gnuplottex}{There were gnuplot errors^^J%
*************^^J%
\detokenize\expandafter{\gnuploterrors@}%
*************^^J}%
\fi
}
\makeatother
\begin{document}
\begin{figure}[h]
\begin{gnuplot}
set terminal cairolatex
plot [-100:100] tan(sin(x))
\end{gnuplot}
\caption{Working Figure}
\end{figure}
\begin{figure}[h]
\begin{gnuplot}
set terminal cairolatex
plot [-100a:100] tan(sin(x))
\end{gnuplot}
\caption{Broken Figure}
\end{figure}
Some sample text
\end{document}
This adds to the command line calling gnuplot
the redirection of STDERR
to a file \jobname.gnuploterrors
. This file, removed at the start of the job, if already existing, is loaded at end document; if it contains just an empty line, no error has been found; otherwise, it is printed on the terminal and the log file in the form of a warning that Texmaker should be able to see.
In the case of your example file, that I saved as santen.tex
, I get the warning
Package gnuplottex Warning: There were gnuplot errors
*************
plot [-100a:100] tan(sin(x))
^
"santen-gnuplottex-fig2.gnuplot", line 4: ':' or keyword 'to' expected
*************
If I move \end{document}
before the second figure, there's no warning. I tested it also with two correct figures.
Best Answer
The Document menu has an item "LaTeX Log", which shows the last log file for the current file if it exists, otherwise is greyed out.