Graphics, Figures & Tableswrapfig | Incomprehensible Error Message

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
tomerbr
Posts: 8
Joined: Thu Dec 08, 2011 11:20 pm

wrapfig | Incomprehensible Error Message

Post by tomerbr »

Hi to all.

I'm very new to LaTeX and hence may be asking a trivial question...but...I really need to figure this one out. Here is me code:

Code: Select all

\documentclass[12pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{makeidx}
\usepackage{graphicx}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{sidecap}

\begin{document}
\maketitle

\begin{abstract}
blablabla
\end{abstract}
\newpage
\section{XYZ}
blablabla

\begin{wrapfigure}{r}{\textwidth}
  \begin{center}
    \fbox{\includegraphics[width=0.5\textwidth]{D://Quanter}}
  \end{center}
  \caption{demo}
\end{wrapfigure}
\end{document}
compiling using PDFLaTeX (using TeXstudio) I'm getting "unrecognized command" mark on the \begin{wrapfigure} command...
No errors on the \usepackage{wrapfig}....
and on the MikTex directory there is a wrapfig.sty file....
What seems to be the problem ????
Last edited by Stefan Kottwitz on Fri Dec 09, 2011 12:04 am, edited 1 time in total.

Recommended reading 2024:

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

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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

wrapfig | Incomprehensible Error Message

Post by localghost »

tomerbr wrote:[…] I'm getting "unrecognized command" mark […]
I don't know such an error message. Please echo the exact error message from the log file. Compiling your example, I get this error message due to a missing title.
! LaTeX Error: No \title given.

See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...

l.13 \maketitle
And next time please provide a proper minimal example that is reduced to only relevant code. More than half of the packages are not necessary here.

Regardless of the described problem you should use the wrapfigure environment correctly.

Code: Select all

\begin{wrapfigure}{r}{0.5\textwidth}
  \centering
  \fbox{\includegraphics[width=\linewidth]{D://Quanter}}
  \caption{Demo}\label{fig:demo}
\end{wrapfigure}

Best regards and welcome to the board
Thorsten
tomerbr
Posts: 8
Joined: Thu Dec 08, 2011 11:20 pm

Re: wrapfig | Incomprehensible Error Message

Post by tomerbr »

Thorsten.
Thanks for the answer. I'm working on some project which I decided will be my first trail in the Tex world. This is a semester project in which I'm stuck at the moment because the error message and hence was very eager to find a solution...
I'll try to explane my problem in a bit more detailed way:
I'm using the program "TexStudio" and using the PDFLatex compiler within it. The program has an interactive Latex compiler check that marks errors and problem with your code interactivly (It will "mark" the errors inside the code) . As part of this, the phrases "begin{wrapfigure}" and "end{wrapfigure}" are being marked and hover the mouse on the marked area will lead to a massage : "unrecognized command" . No error masages are being generated when compiling the code, However, the wrapfigure command is actully not being executed as the result PDF file is not showing wrap figure characteristic and it looks like only the \fbox{\includegraphics[width=0.5\textwidth]{D://Quanter}} command was executed.
I thought what it may be as a result of in proper or lack of the package "wrapfig" - but I checked my MikTex2.9 directory and the package was there including the .tsy file. Furthermore, no error massage was generated on the line "\usepackage{wrapfig}".
I couldn't find the reason for the compiler not executing the wrapfig environment...
Is it more clear now ??? (by the way, you can delete the "maketitle" command and try to ran the scrip without it...)
Thank you in advance.
Tomer
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

wrapfig | Incomprehensible Error Message

Post by localghost »

Deleting the \maketitle command lets me compile your example flawlessly if I replace your graphics file with a dummy picture (created by a \rule command) or add the »demo« option to the graphicx package.

Since I don't use TeXstudio, I can't be of help in this regard. But the editor doesn't mark code with this "unrecognized command" tag without a reason. Please submit the complete log file of your example by upload to the forum server.
tomerbr
Posts: 8
Joined: Thu Dec 08, 2011 11:20 pm

Re: wrapfig | Incomprehensible Error Message

Post by tomerbr »

Hi.
Again, thanks for the quick answer...
Few more quistions to clear things up for me...
1) If the compiler compile the command "\usepackage{wrapfig}" without any error. Dose it means the package was seccesfully loaded, or not necceseraly so ?
2) What do you mean be "complete log file " - is there a way to generate this ?

I'll work on it....I just HAVE to solve this!!!

Yours,
Tomer
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

wrapfig | Incomprehensible Error Message

Post by sommerfee »

tomerbr wrote:1) If the compiler compile the command "\usepackage{wrapfig}" without any error. Dose it means the package was seccesfully loaded, or not necceseraly so ?
Yes and no. Some packages delay the execution of specific code. AFAIK the wrapfig package does not, so in this case we have a "yes".
2) What do you mean be "complete log file " - is there a way to generate this ?
It will be generated by TeX automatically and have the file name *.log, e.g. test.log if your document is named test.tex.
tomerbr
Posts: 8
Joined: Thu Dec 08, 2011 11:20 pm

Re: wrapfig | Incomprehensible Error Message

Post by tomerbr »

sommerfee
saying that, and based on the previous massages - What you think causeing my problem ?
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Re: wrapfig | Incomprehensible Error Message

Post by sommerfee »

Without log file I can't say either.
Post Reply