How to Wrap Text Around Figures in LaTeX?

  • Context: LaTeX 
  • Thread starter Thread starter member 428835
  • Start date Start date
  • Tags Tags
    Text
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
5 replies · 5K views
member 428835
picture.png
Hi PF!

I am trying to wrap text around figures in the article document class. The code I type is

\usepackage{wrapfig}

\begin{wrapfigure}{R}{0.5\textwidth}
\centering
\includegraphics[width=5.7in]{Schematic}
\caption{Schematic of double-drained wetting capillary liquid in an interior corner. The draining locations are symmetric at z=L at volumetric sink flow rates Q.}
\label{fig:ddrain}

\end{wrapfigure}However, this produces the image attached. I would prefer to have the drawing in the text and on either left or right, with the text wrapping around it orderly. What mistake am I making?

Thanks for your help!

Edit: for some reason it will not display the text I've written. If you click reply I think you can see it though. Sorry, I don't know how to fix this.
 

Attachments

  • picture.png
    picture.png
    46.5 KB · Views: 1,656
Last edited by a moderator:
Physics news on Phys.org
When you write your begin statements the forum thinks you are trying to write math and MathJax takes over. You can add a small error to your begin statement and it won't.

\begin{wrapfigure }{R}{0.5\textwidth}
\centering
\includegraphics[width=5.7in]{Schematic}
\caption{Schematic of double-drained wetting capillary liquid in an interior corner. The draining locations are symmetric at z=L at volumetric sink flow rates Q.}
\label{fig:ddrain}
\end{wrapfigure}
 
Orodruin said:
When you write your begin statements the forum thinks you are trying to write math and MathJax takes over. You can add a small error to your begin statement and it won't.
I have fixed the post. Note that you can also add BB codes, like making one letter black in "begin", that will make it such that MathJax won't recognize it as LaTeX.

As for the problem at hand, you can use the same designation of width, 0.5\textwidth, in \includegraphics, to ensure that the image is the same size.
 
Thank you both for your help!

DrClaude, I actually did do that but still did not place the picture in the correct spot. A working example is here.\documentclass[12pt]{article}
%
\usepackage{bm}%
\usepackage{mathtools}%
\usepackage{cases}%
\usepackage{amsmath}%
\usepackage{amsfonts}%
\usepackage{amssymb}%
\usepackage{amsthm}%
\usepackage{mathrsfs}%
\usepackage{graphicx}
\usepackage{float}
\usepackage{fancyhdr}% for header
\usepackage{changepage} % for the adjustwidth environment
\usepackage[numbers]{natbib}
\usepackage[margin=1.4in,tmargin=1in]{geometry}
\usepackage{caption}

\usepackage{calc}
\usepackage{enumitem}

\usepackage[english]{babel}% color
\usepackage{color}% color

\usepackage{booktabs}% fancy table
\newcommand{\ra}[1]{\renewcommand{\arraystretch}{#1}}% fancy table

\usepackage{wrapfig}

\usepackage{blindtext}
%------------------------------------------------------------

% Theorem like environments

\newtheorem*{claim*}{Claim}
\newtheorem{exercise}{Exercise}

\renewcommand{\d}{\mathrm{d}} %differential d
\newcommand{\bx}{\bar{x}} % x overbar

\pagestyle{fancyplain}%
\rhead{\today}

%\pagestyle{fancy}

\setlength{\belowcaptionskip}{-15pt}
\renewcommand\refname{References and Citations}
%\pagestyle{empty}
%--------------------------------------------------------

\begin{document }
\section*{Response to Prior Review}
\subsection*{Data Submitted in the Project Description}
\blindtext[3]

\begin{wrapfigure }{r}{0.8\textwidth}
\centering
%\begin{figure }[H]
%\begin{center }
\includegraphics[width=0.78\textwidth]{Schematic}
\caption{Schematic of double-drained wetting capillary liquid in an interior corner. The draining locations are symmetric at z = \pm L at volumetric sink flow rates Q.}
\label{fig:ddrain}
%\end{center}
%\end{figure}
\end{wrapfigure}
\section*{Response to Prior Review}
\blindtext[3]
\end{document}
 

Attachments

I have never used the wrapfig package before, so I'm not sure how much I can help. It appears that wrapfig is not calculating the space of the caption. Putting the figure in a minipage makes things a bit better:

Code:
\begin{wrapfigure}{r}{0.8\textwidth}
\centering
\begin{minipage}{0.6\textwidth}
\includegraphics[width=0.78\textwidth]{Schematic}
\caption{Schematic of double-drained wetting capillary liquid in an interior corner. The draining locations are symmetric at $z = \pm L$ at volumetric sink flow rates Q.}
\label{fig:ddrain}
\end{minipage}
\end{wrap figure}