## LaTeX forum ⇒ Graphics, Figures & Tables ⇒ ! Paragraph ended before \@tempa was complete. Topic is solved

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

### ! Paragraph ended before \@tempa was complete.

I'm having troubles with \includegraphics

\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

Ijon Tichy
Posts: 464
Joined: Mon Dec 24, 2018 10:12 am
Unfortunately your code is neither a minimal working example nor correctly marked as code. If you convert it into working code and mark it correctly:
\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 minimal working example and mark the code as code.

Stefan Kottwitz
Site Admin
Posts: 9685
Joined: Mon Mar 10, 2008 9:44 pm
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:

% !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
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
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

% !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 6 times
elephant.ps
(20.69 KiB) Downloaded 6 times

Ijon Tichy
Posts: 464
Joined: Mon Dec 24, 2018 10:12 am
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.

Stefan Kottwitz
Site Admin
Posts: 9685
Joined: Mon Mar 10, 2008 9:44 pm
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

Stefan Kottwitz
Site Admin
Posts: 9685
Joined: Mon Mar 10, 2008 9:44 pm
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
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.

Return to “Graphics, Figures & Tables”

### Who is online

Users browsing this forum: Google [Bot] and 12 guests