How to Wrap Text Around Figures in LaTeX?

  • LaTeX
  • Thread starter member 428835
  • Start date
  • Tags
    Text
In summary, the individual is having trouble with wrapping text around figures in the article document class using the wrapfig package. They are unsure what mistake they are making as the code seems fine, but the image appears too big and the wrapping is only done in the section title. They have tried adding an error to the begin statement and using the same designation of width in \includegraphics, but it has not solved the issue. A suggested solution is to use a minipage within the wrapfigure environment.
  • #1
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,561
Last edited by a moderator:
Physics news on Phys.org
  • #2
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}
 
  • #3
That being said, the code itself looks fine. However, your image looks too big to fit in the allotted half textwidth and it seems as if the wrapping is done only in the section title. It is difficult to tell without seeing the rest of your code.
 
  • #4
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.
 
  • #5
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

  • Schematic.pdf
    47.9 KB · Views: 364
  • #6
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}
 

Related to How to Wrap Text Around Figures in LaTeX?

1. What is text wrapping around figures?

Text wrapping around figures is a formatting technique where text is arranged to flow around an image or graphic instead of remaining in a straight line.

2. Why is text wrapping around figures important?

Text wrapping around figures can enhance the visual appeal of a document and make it easier to read by breaking up large blocks of text. It can also help to provide context and more effectively illustrate the content being discussed.

3. How do you wrap text around a figure?

To wrap text around a figure, you can use a word-processing or design software that has a text wrapping feature. This feature allows you to select an image and choose how the text should flow around it, such as on the left or right side, or on all sides.

4. What types of figures can you wrap text around?

You can wrap text around various types of figures, including images, charts, graphs, and tables. The key is to have a figure that has a defined shape and is easy to integrate into the text layout.

5. Are there any guidelines for text wrapping around figures?

Yes, there are some guidelines to keep in mind when wrapping text around figures. These include avoiding large or complex images, ensuring the figure is relevant to the text, and adjusting the spacing and alignment to maintain readability. It's also important to test the layout on different devices and screen sizes to ensure it looks consistent.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
796
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
11
Views
15K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
477
Back
Top