1

I have have an issue with wrapping and alignment of the an image within a paragraph.

MWE:

\documentclass[11pt]{article}

\textwidth 165mm \textheight 230mm \topmargin -5mm
\oddsidemargin 0mm

\usepackage{graphicx}
\usepackage{natbib}
\usepackage{textcomp}

\usepackage{url}
\usepackage{amstext}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{multicol}
\setlength{\columnsep}{1cm}
\usepackage{tikz}
\usepackage[export]{adjustbox}
\usepackage{wrapfig}
\allowdisplaybreaks
\usepackage[export]{adjustbox}
\usepackage{ragged2e}
\usepackage{subfig}
\usepackage{float}
\usepackage[colorlinks=true,linkcolor=black, citecolor=blue, urlcolor=blue]{hyperref}

\begin{document}

    \bibliographystyle{plainnat}
    \setcitestyle{semicolon,round,aysep={,}}
 The following sections.\\ \noindent\rule{\textwidth}{1pt}
\section*{Introduction} \label{sec: intro}
This is the intro
\section{Problem} \label{sec: prob}
This is the problem description. This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.
\vfill
\begin{minipage}{0.35\linewidth}
    \includegraphics[width=\linewidth]{download}
\end{minipage}\hfil
\begin{minipage}{0.55\linewidth}
\end{minipage}
This is the problem description. This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem

\end{document}
  • What are you trying to obtain, exactly? – Bernard Oct 3 '18 at 19:00
  • 2
    Try moving your \end{minipage} (minipage is currently empty) to be after the content. – Peter Grill Oct 3 '18 at 19:02
  • @Bernard, hey Bernard, I want the text on the left and the image on the right sides of the page. and not exceeding the margins. Wrapping issues – B. Bornay Oct 3 '18 at 19:03
  • You didn't even use the wrapfigure environment! What did you load the package for? – Bernard Oct 3 '18 at 19:05
  • Have you tried setting the text width, margins, and margin paragraph spacings with the geometry package and then using a \marginpar command to put the figure on the right? – Jeffrey J Weimer Oct 4 '18 at 1:06
1

The problem was that \end{minipage} was before the content. So instead of

\begin{minipage}{0.35\linewidth}
    \includegraphics[width=\linewidth]{download}
\end{minipage}\hfil
\begin{minipage}{0.55\linewidth}
\end{minipage}% <------------------- Too early
 ... content ...

You should have had

\begin{minipage}{0.35\linewidth}
    \includegraphics[width=\linewidth]{download}
\end{minipage}\hfil
\begin{minipage}{0.55\linewidth}
 ... content ...
\end{minipage}% <------------------- Moved from above

Notes:

  • The demo option was used on the graphicx package as I don't access to the figure "download". This option should be removed in your actual use case.

  • Consider using the geometry package to set the page dimensions.

  • Also, please try to eliminate code that is not needed to reproduce the problem.

Code:

\documentclass[11pt]{article}

\usepackage[demo]{graphicx}% <--- "demo" option as I don't have access to "download" image.

\begin{document}
\begin{minipage}{0.35\linewidth}
    \includegraphics[width=\linewidth]{download}
\end{minipage}\hfil
\begin{minipage}{0.55\linewidth}
%\end{minipage}% <------------------- Moved this line to end
This is the problem description. This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem description.This is the problem
\end{minipage}% <------------------- Moved from above
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.