2

I want to use minipage to reach this result: picture 2

But my code:

\begin{minipage}[t]{0.5\textwidth}
Solve the problem (\ref{pdeb09_002}) for the function
$$
\varphi(x)=x^2 \text { on }[-\pi, \pi]
$$
that is extended $2 \pi$-periodically to $\mathbb{R}$.\\

Here is the graph of this function:
\end{minipage}
\begin{minipage}{0.38\textwidth}
\includegraphics[width=\textwidth]{Figures/001_b9.pdf}
\end{minipage}

gives this result: pic 3

3
  • you should show your code but probably \begin{minipage}[t]{...} May 25, 2023 at 19:36
  • @DavidCarlisle Now it is aligned but the image of the graph is not aligned and a little bit shifted above.... May 25, 2023 at 19:59
  • @calculatormathematical: Add \usepackage[export]{adjustbox} to your preamble and then use \includegraphics[...,valign=t]{<image>}.
    – Werner
    May 25, 2023 at 20:17

1 Answer 1

2

You need the alignment points (or anchors) of the two constructions to be at the same (top) position. So, the generic setup you can use is this one:

...
\usepackage[export]{adjustbox}
...
\begin{minipage}[t]{<width>}
  %<stuff>
\end{minipage}\hfill
\includegraphics[width=<width>,valign=t]{<image>}
...

The above code sets the anchor points for both the minipage and image to the top.

You must log in to answer this question.

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