空白の PDF ドキュメント

空白の PDF ドキュメント

このサイトに記載されているとおりにLaTeXgnuplotコードを入力すると、TeXworks コンパイラを使用して出力ドキュメントに正弦曲線が出力されるはずです。コンパイルは行われますが、空のドキュメントが生成されます。 を試してみるようにというアドバイスがありました-shell-escape

試してみましたが、-shell-escapeうまくいきませんでした。他に何を試せばいいでしょうか?

これはTexWorksに入力したコードです。pdfLaTexとpdflatex+makeIndex+Bibtexの両方でコンパイルされています。

\documentclass{scrreprt}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[miktex]{gnuplottex} % for MiKTeX,`pdflatex -shell-escape` enabled 
%\usepackage{gnuplottex} I have used this line to compile on TeXLive 2013
\usepackage{graphicx}
%\usepackage{epstopdf} % for MiKTeX,`pdflatex -shell-escape` enabled
\begin{document}
\begin{figure}[htbp]
\centering
\begin{gnuplot}[terminal=epslatex,terminaloptions=color]
plot [0:2*pi] sin(x) title 'Sine', cos(x) title 'Cosine'
\end{gnuplot}
\end{figure}
\end{document}

答え1

上記のコードは2013年のものです。gnuplottexのLaTeXターミナルを使用してカラフルなプロットを作成しますか?
回答はTeXworksでは次のようになります。

ここに画像の説明を入力してください

実際、他の gnuplot 呼び出しと比較すると、gnuplottex には奇妙な点がいくつかあります。そのため、私は Preamble を次のように変更します。

\documentclass{scrreprt}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}

% gnuplot functions may not work if -aux-directory or  a /sub dir is set.
% The ".gnuplot" file(s) may be correctly written in the aux directory,
% but may not correctly pass through gnuplot to generate the ".table" file(s).
% there are some env vars for subdirectories read all the gnuplot docs

% WINDOWS TeX USERS need this option to pass `pdflatex -shell-escape` test (TeX Live & W32TeX not just MiKTeX)
\usepackage[miktex]{gnuplottex} 

% a Linux / Mac entry for Tex Live or even MiKTeX on NON windows ?
%\usepackage{gnuplottex}  

% Gnuplottex example could do with an update to define use of gnuplot.exe (i.e. you must RENAME wgnuplot or pgnuplot)
% also how to \def\gnuplotexe{/opt/local/bin/gnuplot} for me on windows this worked just as well as using a script or path or editor setting
%\def\gnuplotexe{H:/gnuplot/gp530-20190105-win32-mingw/gnuplot/bin/gnuplot.exe}

\usepackage{graphicx}
%\usepackage{epstopdf} % MiKTeX,`pdflatex -shell-escape` enabled (unknown if still needed in Windows ?)

\begin{document}
\begin{figure}[htbp]
\centering
\begin{gnuplot}[terminal=epslatex,terminaloptions=color]
plot [0:2*pi] sin(x) title 'Sine', cos(x) title 'Cosine'
\end{gnuplot}
\end{figure}
\end{document}

要するに、空白ページは通常、gnuplotが\def\gnuplotexe{…}の使用またはシェルのシステムパスのデフォルトによって呼び出されなかったことを意味します。これを解決する最良の方法は、最新のgnuplotがhttp://www.gnuplot.info/(この実行ではバージョン 5.3 を使用しましたが、今年の最新リリースは 5.2.6 です。) インストールしたら、TeXworks で gnuplotexe フォルダー (. . ./gnuplot/bin) が次のように Typesetting Preference パスに含まれていることを確認します。

ここに画像の説明を入力してください

関連情報