2

I have this minimal example:

\documentclass[a4paper,12pt]{article}

\usepackage{graphicx}
\usepackage{xcolor}

\begin{document}

\noindent\fcolorbox{red}{green}{
\noindent\begin{minipage}[t]{10cm}
  left content
\end{minipage}
}
\noindent\fcolorbox{red}{green}{
\noindent\begin{minipage}[t]{5cm}
  \includegraphics[width=4cm]{logo.jpg}
  \newline
  right content
\end{minipage}
}

\end{document}

This renders to this:

enter image description here

As you can see, it does not matter, what property do I set to \begin{minipage}, the minipages are not rendered to the top.

I want both minipages to render to the top of the page. How can I do that?

2
  • Check out the answers the answer to this question tex.stackexchange.com/q/378548/231952
    – Ivan
    Mar 25, 2021 at 17:44
  • they are aligned on the baselines of the top row of each, the baseline of left content and teh baseline of the image. Mar 25, 2021 at 17:52

1 Answer 1

1

You can use the adjustbox interface:

enter image description here

\documentclass{article}

\usepackage[export]{adjustbox}
\usepackage{xcolor}

\begin{document}

\noindent\adjustbox{minipage=10cm,valign=t,cfbox=red,bgcolor=green}{%
  left content
}%
\adjustbox{minipage=5cm,valign=t,cfbox=red,bgcolor=green}{%
  \includegraphics[width=4cm]{example-image}
  \newline
  right content
}

\end{document}
2

You must log in to answer this question.

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