0

What I am trying to do

I'm trying to typeset the following using LaTeX. The image shown below was created using Inkscape.

Some important details:

  • Paragraphs, which are shown on the right side, are vertically aligned.
  • Images, which are shown on the left side, are vertically aligned. The alignment is only noticeable when the height of the paragraphs exceed the height of the image. See the third and fourth scenario below.
  • When the height of the paragraphs exceed the height of the image, blank space should be shown above and below the image.
  • Images occupy 0.2 of the page, while paragraphs occupy 0.8 of the page.
  • The padding for the paragraphs can be easily modified.

enter image description here

What I have tried

I was able to get a similar result using the minipage environment. See three examples below.

1 paragraph.

\documentclass{article}

\usepackage[showframe]{geometry}
\usepackage{graphicx}
\usepackage{lipsum}

\setlength{\fboxsep}{0pt}
\setlength{\fboxrule}{1pt}

\newlength{\actualwidth}
\setlength{\actualwidth}{\dimexpr\textwidth-2\fboxrule}

\begin{document}
\noindent
\fbox{%
\begin{minipage}{0.2\actualwidth}
\includegraphics[width=\linewidth]{example-image}
\end{minipage}%
\begin{minipage}{0.8\actualwidth}
\centering
\parbox{0.98\linewidth}{\lipsum[1][1-2]}
\end{minipage}%
}
\end{document}

enter image description here

3 paragraphs

\documentclass{article}

\usepackage[showframe]{geometry}
\usepackage{graphicx}
\usepackage{lipsum}

\setlength{\fboxsep}{0pt}
\setlength{\fboxrule}{1pt}

\newlength{\actualwidth}
\setlength{\actualwidth}{\dimexpr\textwidth-2\fboxrule}

\begin{document}
\noindent
\fbox{%
\begin{minipage}{0.2\actualwidth}
\includegraphics[width=\linewidth]{example-image}
\end{minipage}%
\begin{minipage}{0.8\actualwidth}
\centering
\parbox{0.98\linewidth}{\lipsum[1][1-2]}
\noindent \rule{\linewidth}{1pt}
\parbox{0.98\linewidth}{\lipsum[1][1-2]}
\noindent \rule{\linewidth}{1pt}
\parbox{0.98\linewidth}{\lipsum[1][1-2]}
\end{minipage}%
}
\end{document}

enter image description here

5 paragraphs

\documentclass{article}

\usepackage[showframe]{geometry}
\usepackage{graphicx}
\usepackage{lipsum}

\setlength{\fboxsep}{0pt}
\setlength{\fboxrule}{1pt}

\newlength{\actualwidth}
\setlength{\actualwidth}{\dimexpr\textwidth-2\fboxrule}

\begin{document}
\noindent
\fbox{%
\begin{minipage}{0.2\actualwidth}
\includegraphics[width=\linewidth]{example-image}
\end{minipage}%
\begin{minipage}{0.8\actualwidth}
\centering
\parbox{0.98\linewidth}{\lipsum[1][1-2]}
\noindent \rule{\linewidth}{1pt}
\parbox{0.98\linewidth}{\lipsum[1][1-2]}
\noindent \rule{\linewidth}{1pt}
\parbox{0.98\linewidth}{\lipsum[1][1-2]}
\noindent \rule{\linewidth}{1pt}
\parbox{0.98\linewidth}{\lipsum[1][1-2]}
\noindent \rule{\linewidth}{1pt}
\parbox{0.98\linewidth}{\lipsum[1][1-2]}
\end{minipage}%
}
\end{document}

enter image description here

In the code shown above, there are still a few things that I haven't been able to implement:

  • Add a vertical line between the image and the paragraphs and without exceeding the page limits.
  • Control the spacing between the paragraphs and the bottom border and the top border. Note that I can conveniently control the spacing between the paragraphs and the left border and the right border by using \parbox{...} and \centering.

The answer needn't use the code that I posted above. A simpler way to accomplish the aforementioned result is more than welcome. I feel that this can be also accomplished by using tables with multirow cells, but I have not tried it yet.

2
  • Have you considered using a tabular? Commented May 6 at 14:36
  • @samcarter_is_at_topanswers.xyz Thanks for the suggestion. I haven't tried using tabular yet. Some days ago, due to my lack of knowledge when using tables, I found some issues when trying to make images inside tables occupy the full width of the cell they appear in. See tex.stackexchange.com/questions/717233 I didn't find that issue when using minipage, so this time I decided to use minipage. I will consider your suggestion and I will consider the solutions provided in the other question I posted. Commented May 6 at 14:43

1 Answer 1

1

The tabularray package is convenient for this use case.

enter image description here

\documentclass{article}

\usepackage[a4paper, showframe]{geometry}
\usepackage{tabularray}
\usepackage{graphicx}
\usepackage{lipsum}
\usepackage[export]{adjustbox}

\begin{document}

This is a paragraph.

\noindent
\begin{tblr}{
  colspec = {X[c,0.3\textwidth]X[l]},
  column{1} = {leftsep=0pt, rightsep=0pt},
  rowsep = 0pt,
  rowspec = {Q[m]Q[m]Q[m]},
  hlines = 0.25pt,
  vlines = 0.25pt,
  vspan = even
}
  \SetCell[r=3]{c} \includegraphics[width=\linewidth, valign=c]{example-image} & Paragraph no. 1 \\
  & Paragraph no. 2 \\
  & Paragraph no. 3 \\
\end{tblr}

This is a paragraph.

\noindent
\begin{tblr}{
  colspec = {X[c,0.3\textwidth]X[l]},
  column{1} = {leftsep=0pt, rightsep=0pt},
  rowsep = 0pt,
  rowspec = {Q[m]Q[m]Q[m]},
  hlines = 0.25pt,
  vlines = 0.25pt,
  vspan = even
}
  \SetCell[r=3]{c} \includegraphics[width=\linewidth, valign=c]{example-image}
  & Paragraph no. 1 \lipsum[1][1-5] \\
  & Paragraph no. 2 \lipsum[1][1-5] \\
  & Paragraph no. 3 \lipsum[1][1-5] \\
\end{tblr}

\end{document}

You must log in to answer this question.

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