Graphics, Figures & TablesIssue with wrapped Figure

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
andreamizzi
Posts: 1
Joined: Sat Mar 23, 2013 1:35 pm

Issue with wrapped Figure

Post by andreamizzi »

Hello,

I'm trying to use this macro for wrapping text around a figure.

Code: Select all

\newcommand{\figuremacroN}[3]{
  \begin{wrapfigure}{l}{0.5\textwidth}
    \centering
    \includegraphics[width=0.48\textwidth]{#1}
    \caption[#2]{{\small\textbf{#2} - #3}}
    \label{#1}
  \end{wrapfigure}
}

Code: Select all

\figuremacroN{Figure3}{Comparison A and B}{\label{file1_figure3}They are different}
Instead of wrapping the figure it prints "l0.5" left of the figure in the PDF and not the caption (see attachment). What am I doing wrong?

Thanks for your help!
Attachments
wrapfigureerror.png
wrapfigureerror.png (154.05 KiB) Viewed 2468 times
Last edited by localghost on Sat Mar 23, 2013 2:01 pm, 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

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Issue with wrapped Figure

Post by cgnieder »

Hi andreamizzi,

Welcome to the LaTeX community!

Could you please complete your code snippet into a complete (i.e. compilable) Infominimal working example and possibly attach a graphic file to your post so we can test and reproduce the erroneous behavior?

Regards
site moderator & package author
Post Reply