[Tex/LaTex] Text on the left, figure on the right

positioning

I have one technical text with the small figures, which must be placed on
the right side of text. I tried manny solutions /wrapfig package, table,
2 columns package, etc./ but I can't get this to work. When the picture
gets too low, it is drawn in the footer area.

So I'm starting from blank. What should I use to write text with the
following specifications:

  1. Text /TEXT/ should be placed on the left side and the picture /FIG/
    should be placed on the right – not up, not down and certainlly not
    the next page from the TEXT – should start on the SAME page. Pictures
    are small (cca. 5 cm, and the text should be in the landscape mode).
    The TEXT may be one paragraph or more so it is desirable (but not
    required) to stay in the left place, while figures stays on the
    right.

  2. When the FIG gets placed too low on the page, so it gets drawn over
    the bottom text margin, both TEXT and FIG should start on the next page,
    while leaving empty space on the bottom of the page /no vertical
    aligning/.

  3. The whole process of aligning must be automatic, so when I replace
    picture with slightly larger one, the whole process must be handled
    automatically /no manual pagebreaks and stuff/.

  4. The TEXT may or may not flow around the FIG, but the margins must be
    rellatively small /5mm/.

How can I do that?

Best Answer

From my experience, this type of design never works well by using packages. You rather build your own code around your requirements. Here is an example with rather large figures, that illustrate some of the issues (the code is in the MWE below).

enter image description hereenter image description here

Here the text is positioned either left or right depending if the page is odd or even. as you observe the height of the text is not right. So my suggestion rather describe your requirements first visually (perhaps by lifting ideas from a book you like or an article), then see how this will work in the overall deign of the class you are using.

\documentclass[imperial]{octavo}
\usepackage{geometry}
%\usepackage{textsamples}
\usepackage{graphicx,xcolor}
\usepackage{changepage}
\newcommand\lorem{Fusce adipiscing justo nec ante. Nullam in enim.
 Pellentesque felis orci, sagittis ac, malesuada et, facilisis in,
 ligula. Nunc non magna sit amet mi aliquam dictum. In mi. Curabitur
 sollicitudin justo sed quam et quadd. \par}
\begin{document}
\newpage

\newgeometry{left=10mm,right=10mm,top=1.0cm,bottom=1cm}
%%%%%%%%%%%  RENOIR NARROW
\def\ballatbougival{ballatbougival}
\def\ballatbougivalcaption{\lorem\lorem}
\def\ballatbougivaltitle{{\large\bf Ball at Bougival}}
\checkoddpage
\begin{minipage}[c]{\textwidth}%
\fboxrule0pt%
\fboxsep1pt%
\fbox{%
\ifoddpage\relax\else%
\begin{minipage}[b]{110pt}%
%% odd caption is placed at bottom
   \ballatbougivaltitle\par%
   \ballatbougivalcaption%
   \the\textwidth\rule{0pt}{180pt}
\end{minipage}%
\fi%
\begin{minipage}[b]{\the\dimexpr(\textwidth-150pt)}%
\includegraphics[width=\textwidth]{./graphics/\ballatbougival}
\end{minipage}\hspace*{10pt}%
\ifoddpage%
\begin{minipage}[b]{110pt}%
%% odd caption is placed at bottom
   \ballatbougivaltitle\par%
   \ballatbougivalcaption%
   \the\textwidth\rule{0pt}{180pt}
\end{minipage}%
\fi
}
\end{minipage}
\clearpage

%%%%%%%%%%%  RENOIR NARROW
\def\ballatbougival{ballatbougival}
\def\ballatbougivalcaption{\lorem\lorem}
\def\ballatbougivaltitle{{\large\bf Ball at Bougival}}
\checkoddpage
\begin{minipage}[c]{\textwidth}%
\fboxrule0pt%
\fboxsep0pt%
\fbox{%
\ifoddpage\relax\else
\begin{minipage}[b]{110pt}%
%% odd caption is placed at bottom
   \ballatbougivaltitle\par%
   \ballatbougivalcaption%
   \the\textwidth\rule{0pt}{180pt}
\end{minipage}%
\hspace*{10pt}%
\fi%
\begin{minipage}[b]{\the\dimexpr(\textwidth-130pt)}%
\includegraphics[height=\textheight, width=\textwidth, keepaspectratio]{./graphics/Pierre-Auguste_Renoir_019}%
\end{minipage}%
\ifoddpage%
\hspace*{10pt}%
\begin{minipage}[b]{110pt}%
%% odd caption is placed at bottom
   \ballatbougivaltitle\par%
   \ballatbougivalcaption%
   \the\textwidth\rule{0pt}{180pt}
\end{minipage}%
\fi
}
\end{minipage}
\end{document}

As you will observe from the code, the image and caption is placed within minipages, so effectively ensuring that it stays together. If you want them to float, enclose them in

\begin{figure}...\end{figure}

If you want numbered captions or the captions to go to the contents, you can style them, using the caption package.

Minor adjustments on the position of text, you can add rules (make them invisible using a zero width or add space via vspace).

Although this might appear as tedious and requiring a lot of work to set up, for a book at most you will have about 3-5 layout designs. Once you are happy you can change everything to environments or macros to make life easier.