larskotthoff / gnuplottex

Gnuplot graphs in LaTeX. See http://www.ctan.org/pkg/gnuplottex
3 stars 1 forks source link

Gnuplottex does not work when inside frame of beamer #6

Closed jds11111 closed 7 years ago

jds11111 commented 7 years ago

Here is my minimal tex file:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \documentclass{beamer} \usecolortheme{seahorse}

\usepackage{gnuplottex} \usepackage{graphicx}

\begin{document}

\begin{frame}

\begin{gnuplot}[terminal=latex] plot [0:2*pi] sin(x) title 'Sine', cos(x) title 'Cosine' \end{gnuplot}

\end{frame}

\end{document} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

I run this on ubuntu 16.04. If I comment out the \begin{frame} and \end{frame} lines, everything works fine, no errors. The output is not great, but that is not the issue.

However, when these commands inside of a frame (like shown above) I get the output to the logfile:


PDFLaTeX output: cd "/home/..." ***** pdflatex -synctex=1 --shell-escape -interaction=nonstopmode test2.tex


This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015/Debian) (preloaded format=pdflatex) \write18 enabled. entering extended mode (./test2.tex LaTeX2e <2016/02/01>

......

Opening gnuplot stream test2-gnuplottex-fig1.gnuplot Runaway argument? plot [0:2*pi] sin(x) title 'Sine', cos(x) title 'Cosine' \end {gnuplo\ETC. ! Paragraph ended before \verbatim@ was complete.

\par l.15 \end{frame} ! LaTeX Error: \begin{gnuplot} on input line 15 ended by \end{beamer@framepause s}. See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. ... l.15 \end{frame} ! Extra }, or forgotten \endgroup. \endbeamer@frameslide ...amer@framepauses}\egroup \ifx \beamer@frametitle \@... l.15 \end{frame} ! LaTeX Error: \begin{beamer@framepauses} on input line 15 ended by \end{beamer @frameslide}. See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. ... l.15 \end{frame} ! Package catchfile Error: File `test2.gnuploterrors' not found. See the catchfile package documentation for explanation. Type H for immediate help. ... l.17 \end{document} ) Runaway argument? \ifx \gnuploterrors@ \@empty \else \PackageWarningNoLine {gnuplottex}\ETC. ! File ended while scanning use of \gnuploterrors@eatpar. \par <*> test2.tex ! Emergency stop. <*> test2.tex ! ==> Fatal error occurred, no output PDF file produced! Transcript written on test2.log. Putting gnuplot inside of a figure environment improves the look of the output, but does not eliminate the errors.
uhoefel commented 7 years ago

Hi,

You need to use it like

...

\begin{frame}[fragile]

...

Best regards,

Udo

Am 03.11.2016 um 17:45 schrieb jayschieber:

Here is my minimal tex file:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \documentclass{beamer} \usecolortheme{seahorse}

\usepackage{gnuplottex} \usepackage{graphicx}

\begin{document}

\begin{frame}

\begin{gnuplot}[terminal=latex] plot [0:2*pi] sin(x) title 'Sine', cos(x) title 'Cosine' \end{gnuplot}

\end{frame}

\end{document} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

I run this on ubuntu 16.04. If I comment out the \begin{frame} and \end{frame} lines, everything works fine, no errors. The output is not great, but that is not the issue.

However, when these commands inside of a frame (like shown above) I get the output to the logfile:


* PDFLaTeX output: * cd "/home/..." ***\ pdflatex -synctex=1 --shell-escape -interaction=nonstopmode test2.tex


This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015/Debian) (preloaded format=pdflatex) \write18 enabled. entering extended mode (./test2.tex LaTeX2e <2016/02/01>

......

Opening gnuplot stream test2-gnuplottex-fig1.gnuplot Runaway argument? plot [0:2*pi] sin(x) title 'Sine', cos(x) title 'Cosine' \end {gnuplo\ETC. ! Paragraph ended before \verbatim@ was complete.

\par l.15 \end{frame} ! LaTeX Error: \begin{gnuplot} on input line 15 ended by \end{beamer@framepause s}. See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. ... l.15 \end{frame} ! Extra }, or forgotten \endgroup. \endbeamer@frameslide ...amer@framepauses}\egroup \ifx \beamer@frametitle @... l.15 \end{frame} ! LaTeX Error: \begin{beamer@framepauses} on input line 15 ended by \end{beamer @frameslide}. See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. ... l.15 \end{frame} ! Package catchfile Error: File `test2.gnuploterrors' not found. See the catchfile package documentation for explanation. Type H for immediate help. ... l.17 \end{document} ) Runaway argument? \ifx \gnuploterrors@ @empty https://github.com/empty \else \PackageWarningNoLine {gnuplottex}\ETC. ! File ended while scanning use of \gnuploterrors@eatpar mailto:gnuploterrors@eatpar. \par <*> test2.tex ! Emergency stop. <*> test2.tex ! ==> Fatal error occurred, no output PDF file produced! Transcript written on test2.log. Putting gnuplot inside of a figure environment improves the look of the output, but does not eliminate the errors. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/larskotthoff/gnuplottex/issues/6, or mute the thread https://github.com/notifications/unsubscribe-auth/AEqK5pGUTvThQvwtXB2kaviKD2siS0LBks5q6g--gaJpZM4Koo0m.

Udo Höfel Max Planck Institute for Plasma Physics, Branch Greifswald Wendelsteinstraße 1 (Room: 7.1 003), D-17491, Greifswald, Germany Phone: +49 (0)3834 88 1825 Fax: +49 (0)3834 88 2509

jds11111 commented 7 years ago

Hi Udo,

many thanks for the clarification. By the way, I did quite a bit of searching for this issue, and did not find it documented anywhere.

Best, Jay

On Thu, Nov 3, 2016 at 11:54 AM, uhoefel notifications@github.com wrote:

Hi,

You need to use it like

...

\begin{frame}[fragile]

...

Best regards,

Udo

Am 03.11.2016 um 17:45 schrieb jayschieber:

Here is my minimal tex file:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \documentclass{beamer} \usecolortheme{seahorse}

\usepackage{gnuplottex} \usepackage{graphicx}

\begin{document}

\begin{frame}

\begin{gnuplot}[terminal=latex] plot [0:2*pi] sin(x) title 'Sine', cos(x) title 'Cosine' \end{gnuplot}

\end{frame}

\end{document} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

I run this on ubuntu 16.04. If I comment out the \begin{frame} and \end{frame} lines, everything works fine, no errors. The output is not great, but that is not the issue.

However, when these commands inside of a frame (like shown above) I get the output to the logfile:


* PDFLaTeX output: * cd "/home/..." ***\ pdflatex -synctex=1 --shell-escape -interaction=nonstopmode test2.tex


This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015/Debian) (preloaded format=pdflatex) \write18 enabled. entering extended mode (./test2.tex LaTeX2e <2016/02/01>

......

Opening gnuplot stream test2-gnuplottex-fig1.gnuplot Runaway argument? plot [0:2*pi] sin(x) title 'Sine', cos(x) title 'Cosine' \end {gnuplo\ETC. ! Paragraph ended before \verbatim@ was complete.

\par l.15 \end{frame} ! LaTeX Error: \begin{gnuplot} on input line 15 ended by \end{beamer@framepause s}. See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. ... l.15 \end{frame} ! Extra }, or forgotten \endgroup. \endbeamer@frameslide ...amer@framepauses}\egroup \ifx \beamer@frametitle @... l.15 \end{frame} ! LaTeX Error: \begin{beamer@framepauses} on input line 15 ended by \end{beamer @frameslide}. See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. ... l.15 \end{frame} ! Package catchfile Error: File `test2.gnuploterrors' not found. See the catchfile package documentation for explanation. Type H for immediate help. ... l.17 \end{document} ) Runaway argument? \ifx \gnuploterrors@ @empty https://github.com/empty \else \PackageWarningNoLine {gnuplottex}\ETC. ! File ended while scanning use of \gnuploterrors@eatpar mailto:gnuploterrors@eatpar. \par <*> test2.tex ! Emergency stop. <*> test2.tex ! ==> Fatal error occurred, no output PDF file produced! Transcript written on test2.log. Putting gnuplot inside of a figure environment improves the look of the output, but does not eliminate the errors. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/larskotthoff/gnuplottex/issues/6, or mute the thread .

Udo Höfel Max Planck Institute for Plasma Physics, Branch Greifswald Wendelsteinstraße 1 (Room: 7.1 003), D-17491, Greifswald, Germany Phone: +49 (0)3834 88 1825 Fax: +49 (0)3834 88 2509

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/larskotthoff/gnuplottex/issues/6#issuecomment-258203731, or mute the thread https://github.com/notifications/unsubscribe-auth/AOf-FF5EhgyfkRfqaSrE8Uoqfv-0YxlUks5q6hGvgaJpZM4Koo0m .

SIP: jay.schieber@iptel.org email: jay.schieber@gmail.com on skype

uhoefel commented 7 years ago

I agree, it should go in the documentation. Besides, I would suggest switching to the cairolatex (or even tikz) terminal, it will probably provide better looking plots.