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

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

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