1

I would like to create a block of text (boxes on the right) that is indented by an image (boxes on the left).

enter image description here

I don't know how or with what to achieve this effect and the closest I've got to was with this code:

\documentclass[a4paper]{article}
\usepackage[czech]{babel}
\usepackage{wrapfig}
\usepackage{graphicx}
\graphicspath{ {img/} }

\def\pictureSize{0.15\textwidth}

\begin{document}
\section*{Experience}

\begin{minipage}{\dimexpr\textwidth}
    \hfill
    \begin{wrapfigure}{l}{\pictureSize}
        \includegraphics[width=\pictureSize]{image}
    \end{wrapfigure}
    \begin{minipage}{\dimexpr\textwidth-\pictureSize}
        \large
        \textbf{Title}\par
        \large
        Subtitle\par
        \normalsize
        More info\par
        \bigskip
        Multi-line 
        text.
    \end{minipage}
\end{minipage}

\end{document}

Problem with that is that it aligns the image to the bottom of whole section.

0

2 Answers 2

2

Here are two solutions: one with the adjustwidth environment from changepage another withe a simple minpage and the plainTeX macro package insbox.

The latter has a simpler code, but can break across pages,, whereas the former can.

\documentclass[a4paper, czech, twwoside]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{garamondx}
\usepackage[showframe]{geometry}
\usepackage{babel}
\usepackage{changepage, lettrine}
\usepackage{wrapfig}
\usepackage{graphicx}
\input{insbox}
\graphicspath{ {img/} }

\def\pictureSize{0.15\textwidth}

\begin{document}

\section*{Experience}

\begin{adjustwidth}{0.15\textwidth}{0pt}
\leavevmode\llap{\raisebox{\dimexpr-\height + 1.5ex}[0pt][0pt]{\includegraphics[width = \dimexpr0.15\textwidth-\marginparsep]{humpty-dumpty}}\hspace{\dimexpr\marginparsep}}%
 However, the egg only got larger and larger, and more and more human:
    when she had come within a few yards of it, she saw that it had eyes
    and a nose and mouth; and when she had come close to it, she saw clearly
    that it was HUMPTY DUMPTY himself. ‘It can’t be anybody else!’ she said
    to herself. ‘I’m as certain of it, as if his name were written all over
    his face.’

It might have been written a hundred times, easily, on that enormous
      face. Humpty Dumpty was sitting with his legs crossed, like a Turk, on
      the top of a high wall--such a narrow one that Alice quite wondered how
      he could keep his balance--and, as his eyes were steadily fixed in the
      opposite direction, and he didn’t take the least notice of her, she
      thought he must be a stuffed figure after all.

      ‘And how exactly like an egg he is!’ she said aloud, standing with her
      hands ready to catch him, for she was every moment expecting him to
      fall.

      ‘It’s VERY provoking,’ Humpty Dumpty said after a long silence, looking
      away from Alice as he spoke, ‘to be called an egg--VERY!’

      ‘I said you LOOKED like an egg, Sir,’ Alice gently explained. ‘And some
      eggs are very pretty, you know’ she added, hoping to turn her remark
      into a sort of a compliment.

    ‘Some people,’ said Humpty Dumpty, looking away from her as usual, ‘have
    no more sense than a baby!’
\end{adjustwidth}
\bigskip

\section*{Experience}%

\InsertBoxL{0}{\fbox{\includegraphics[width = 0.12\textwidth]{humpty-dumpty}}}
\begin{minipage}[t]{0.80\textwidth}
 However, the egg only got larger and larger, and more and more human:
    when she had come within a few yards of it, she saw that it had eyes
    and a nose and mouth; and when she had come close to it, she saw clearly
    that it was HUMPTY DUMPTY himself. ‘It can’t be anybody else!’ she said
    to herself. ‘I’m as certain of it, as if his name were written all over
    his face.’

It might have been written a hundred times, easily, on that enormous
      face. Humpty Dumpty was sitting with his legs crossed, like a Turk, on
      the top of a high wall--such a narrow one that Alice quite wondered how
      he could keep his balance--and, as his eyes were steadily fixed in the
      opposite direction, and he didn’t take the least notice of her, she
      thought he must be a stuffed figure after all.

      ‘And how exactly like an egg he is!’ she said aloud, standing with her
      hands ready to catch him, for she was every moment expecting him to
      fall.

      ‘It’s VERY provoking,’ Humpty Dumpty said after a long silence, looking
      away from Alice as he spoke, ‘to be called an egg--VERY!’

      ‘I said you LOOKED like an egg, Sir,’ Alice gently explained. ‘And some
      eggs are very pretty, you know’ she added, hoping to turn her remark
      into a sort of a compliment.

    ‘Some people,’ said Humpty Dumpty, looking away from her as usual, ‘have
    no more sense than a baby!’
\end{minipage}

\end{document} 

enter image description here

4
  • So I've tried both of your solutions. In the first one for some reason the second and third paragraphs were indented from the first and in the second solution, the box is still there even if I remove showframe from geometry include. Nov 26, 2017 at 11:28
  • @MarošBeťko: I don't really see what you mean with ‘the box is still there’ – which box? Could you post a small example of both problems, or a link to such a small example?
    – Bernard
    Nov 26, 2017 at 11:45
  • In screen of your example the box around the image is showing as well and I've figured out it was the /fbox command. Nov 26, 2017 at 12:04
  • Oh! yes, I used it to check the alignment w.r.t. the left margin, because I was not too sure where the image ended (it's an image picked on the web).
    – Bernard
    Nov 26, 2017 at 12:18
1

enter image description here

\documentclass{article}

\usepackage{graphicx}

\begin{document}


\begin{center}
\begin{minipage}[t]{2cm}
\vspace{-5pt}\includegraphics[width=\linewidth]{example-image}
\end{minipage}\hfill
\begin{minipage}[t]{\dimexpr\textwidth-2cm-10pt}
\def\s{Something Something Something Something Something Something Something Something }
\s\s\s. Red green blue. \s\s\s\
\end{minipage}
\end{center}
\begin{center}
\begin{minipage}[t]{2cm}
\vspace{-5pt}\includegraphics[width=\linewidth]{example-image}
\end{minipage}\hfill
\begin{minipage}[t]{\dimexpr\textwidth-2cm-10pt}
  \def\s{Something else Something else Something else Something else Something else Something else Something else Something else }
\s\s\s. Red green blue. \s\s\s\
\end{minipage}
\end{center}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .