Graphics, Figures & TablesWrapped Figure causes Error

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
DPetrov
Posts: 2
Joined: Sat Apr 20, 2013 6:02 pm

Wrapped Figure causes Error

Post by DPetrov »

Hello everyone, here is my problem:

Code: Select all

\usepackage{wrapfig}
...
\begin{wrapfigure}{r}{width=0.5\textwidth}
  \begin{center}
    \includegraphics[width=0.45\textwidth]{123.jpg} 
    \caption{123}\label{123}
  \end{center}
\end{wrapfigure} 
This piece of code produces the following error.
!Missing Number treated as zero.
I have no idea what that means and I could not find any solutions on the internet. I would be really grateful if anyone helps. Thanks in advance.
Last edited by localghost on Sun Apr 21, 2013 9:15 am, edited 1 time in total.

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

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

Wrapped Figure causes Error

Post by sommerfee »

Hi DPetrov,

The key=value syntax for options was introduced long time after the birth of LaTeX(2e), and therefore many (older) packages does not follow that pattern.

The wrapfig package is such a package and therefore you have to write this.

Code: Select all

\begin{wrapfigure}{r}{0.5\textwidth}
(especially without width=)
Post Reply