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?

Werner
  • 603,163
peterh
  • 331
  • Check out the answers the answer to this question https://tex.stackexchange.com/q/378548/231952 – Ivan Mar 25 '21 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. – David Carlisle Mar 25 '21 at 17:52

1 Answers1

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}

Werner
  • 603,163