Graphics, Figures & Tables! Paragraph ended before \@tempa was complete.

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Adazea
Posts: 4
Joined: Wed Apr 28, 2021 12:23 pm

! Paragraph ended before \@tempa was complete.

Post by Adazea »

I'm having troubles with \includegraphics

Code: Select all

\documentclass[12pt]{report}
\usepackage{epsfig}
\usepackage{color}
\usepackage{graphicx}
\usepackage{enumitem}

\begin{document}

\begin{figure}  [htbp]
 \centering
 \includegraphics[width=100mm]{cubicroot.ps}
 \caption{ $f(x)=x^3-3x+1$.}
 \label{cubicroot}
\end{figure}

\end{document}


It gives me an error message
! Paragraph ended before \@tempa was complete.
I'm using MikTex, latest version (just installed). Can somebody help me? It used to work with an older version.
Thank you in advance,

Adazea
Last edited by Stefan Kottwitz on Fri Apr 30, 2021 10:24 am, edited 1 time in total.
Reason: code marked

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

! Paragraph ended before \@tempa was complete.

Post by Ijon Tichy »

Unfortunately your code is neither a Infominimal working example nor correctly marked as code. If you convert it into working code and mark it correctly:

Code: Select all

\documentclass[12pt]{report}
\usepackage{epsfig}% This package is deprecated. You should use the user
                   % interface of also loaded graphicx!
\usepackage{color}
\usepackage{graphicx}
\usepackage{enumitem}

\begin{document}

\begin{figure} [htbp]
\centering
\includegraphics[width=100mm]{example-image}
\caption{ $f(x)=x^3-3x+1$.}
\label{cubicroot}
\end{figure}

\end{document} 
I cannot reproduce the problem. So please, try to show us a Infominimal working example and mark the code as code.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

! Paragraph ended before \@tempa was complete.

Post by Stefan Kottwitz »

Hi Adazea,

welcome to the forum! I marked the code in your example for better reading, and for direct compiling within the forum.

Just like Ijon, I tested your code and cannot see the issue. It runs fine when I use some example image. Feel free to test yourself with the forum compiler:

Code: Select all

% !TEX LaTeX
\documentclass[12pt]{report}
\usepackage{epsfig}
\usepackage{color}
\usepackage{graphicx}
\usepackage{enumitem}

\begin{document}

\begin{figure}  [htbp]
 \centering
 \includegraphics[width=100mm]{elephant.ps}
 \caption{ $f(x)=x^3-3x+1$.}
 \label{cubicroot}
\end{figure}

\end{document}
What's different:
  • I used elephant.ps (from TLC2)
  • I added a comment that ensures that LaTeX runs in classic DVI mode, instead of running the default pdfLaTeX
And that runs fine here. So, potential issues:
  • perhaps you don't run classic LaTeX that supports Postscript .ps files
  • your cubicroot.ps might be not valid
  • MiKTeX has an issue - we run TeX Live here.
Perhaps post your .log file here, as attachment.

Stefan
LaTeX.org admin
Adazea
Posts: 4
Joined: Wed Apr 28, 2021 12:23 pm

! Paragraph ended before \@tempa was complete.

Post by Adazea »

Thank-you very much Ijon and Stephan for your help.
I really think MikTeX has an issue, it works with an older version.
I'm changing to TeXLive.
Adazea
Adazea
Posts: 4
Joined: Wed Apr 28, 2021 12:23 pm

! Paragraph ended before \@tempa was complete.

Post by Adazea »

I'm having the same trouble after changing to Live TeX and using your figure.

I hope I'm marking this correctly as code. I attach the .log file

Thanks again,
Adazea

Code: Select all

% !TEX LaTeX
\documentclass[12pt]{report}
\usepackage{epsfig}
\usepackage{color}
\usepackage{graphicx}
\usepackage{enumitem}

\begin{document}

\begin{figure}  [htbp]
 \centering
 \includegraphics[width=100mm]{elephant.ps}
 \caption{ $f(x)=x^3-3x+1$.}
 \label{cubicroot}
\end{figure}

\end{document}
Attachments
prueba2.log
(4.09 KiB) Downloaded 351 times
elephant.ps
(20.69 KiB) Downloaded 404 times
User avatar
Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

! Paragraph ended before \@tempa was complete.

Post by Ijon Tichy »

It seems, you have several very, very, very old package files in the document folder. Please remove all packages from the document folder, that available as part of the TeX distribution, e.g. epsfig.sty, graphicx.sty, graphics.sty, trig.sty. Several of them are incompatible with current version of LaTeX or driver files, that are used from the distribution. Using up-to-date packages from the TeX distribution seem to work.

BTW: Package epsfig should not be used any longer. You should always use \includegraphics from package graphicx instead of the commands of epsfig.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

! Paragraph ended before \@tempa was complete.

Post by Stefan Kottwitz »

Quick thought: is the document (and so the image) deep in your directory structure? I remember that there can be such an issue if the file paths are very long.

Stefan
LaTeX.org admin
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

! Paragraph ended before \@tempa was complete.

Post by Stefan Kottwitz »

Ah, very good observation, Ijon is right. ./graphicx.sty etc. are packages in your document folder ./. Just be careful that you delete only files that are not your own content. ;-)

Stefan
LaTeX.org admin
Adazea
Posts: 4
Joined: Wed Apr 28, 2021 12:23 pm

! Paragraph ended before \@tempa was complete.

Post by Adazea »

It finally worked! I removed the package \graphics from the folder and it worked. I do not know why this package was there if \graphicx was in use.

I cannot stress enough how much I thank you . Thanks for your time and your advice.
Post Reply