GeneralWhy are my minipages overlapping?

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
jgombos
Posts: 4
Joined: Tue Oct 07, 2008 9:52 pm

Why are my minipages overlapping?

Post by jgombos »

Code: Select all

\documentclass{letter}

\usepackage[margin=2cm]{geometry}
\usepackage{graphicx}
\usepackage{wrapfig}

\signature{Cookie Monster}

\address{Cookie Monster\\
	 Sesame Street}

\begin{document}

\begin{letter}{Kermit the Frog\\
	       Sesame Street}

\opening{Dear Kermit the Frog,}

\begin{minipage}{7.5in}
\begin{wrapfigure}{L}{12cm}
  \begin{center}
     \rule{2in}{4in}
  \end{center}
\end{wrapfigure}
text text text text text text 
text text text text text text 
\end{minipage}

\begin{minipage}{7.5in}
  \begin{wrapfigure}{L}{12cm}
    \begin{center}
      \rule{4in}{2in}
    \end{center}
  \end{wrapfigure}
\end{minipage}

\begin{minipage}{7.5in}
  \begin{wrapfigure}{L}{12cm}
  \end{wrapfigure}
\end{minipage}

\closing{Sincerely,}
\end{letter}
\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Why are my minipages overlapping?

Post by Juanjo »

If you really add text, things look quite different. Try this modified version of your code:

Code: Select all

\documentclass{letter}

\usepackage[margin=2cm]{geometry}
\usepackage{graphicx}
\usepackage{wrapfig,lipsum}

\signature{Cookie Monster}

\address{Cookie Monster\\
    Sesame Street}

\begin{document}

\begin{letter}{Kermit the Frog\\
          Sesame Street}

\opening{Dear Kermit the Frog,}

%\begin{minipage}{7.5in}
\begin{wrapfigure}{l}{12cm}
  \begin{center}
     \rule{2in}{4in}
  \end{center}
\end{wrapfigure}
\lipsum[1-2]
%\end{minipage}

%\begin{minipage}{7.5in}
  \begin{wrapfigure}{l}{12cm}
    \begin{center}
      \rule{4in}{2in}
    \end{center}
  \end{wrapfigure}
  \lipsum[4-5]
%\end{minipage}

\closing{Sincerely,}
\end{letter}
\end{document}
The widths of the minipages are not well chosen (too wide). By the way, do you really need minipages?
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
Post Reply