小頁面調整

小頁面調整

我試圖將兩個不同尺寸的圖像並排放置,並將標題放在第一個圖像下方以填充空白。

迷你頁選項的每種組合tb都不會產生所需的輸出。

要求是:

  • 兩個圖像在頂部對齊。
  • 兩張圖片的標題都是唯一的,寫在第一張圖片的正下方。

在以下輸出中,影像未在頂部對齊。這是正確調整迷你頁的方法嗎?

這是一個 MWE :

\documentclass[11pt,a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage[top=2.5cm,bottom=2cm,left=2.6cm,right=2.6cm]{geometry}

\begin{document}
    \begin{figure}
        \centering
        \begin{minipage}[t]{0.5\linewidth}
            \centering
            \includegraphics[width=238px, height=274px]{example-image-a}
            \caption{Schémas dex expériences des aimants $A$ et $B$}
        \end{minipage}\qquad
        \begin{minipage}{0.4\linewidth}
            \centering
            \includegraphics[width=117px, height=383px]{example-image-b}
        \end{minipage}
    \end{figure}

\newpage

    \begin{figure}
        \centering
        \begin{minipage}[t]{0.5\linewidth}
            \centering
            \includegraphics[width=0.9\linewidth]{AimantAB1.png}
            \caption{Schémas dex expériences des aimants $A$ et $B$}
        \end{minipage}\qquad
        \begin{minipage}{0.4\linewidth}
            \centering
            \includegraphics[width=0.6\linewidth]{AimantAB2.png}
        \end{minipage}
    \end{figure}

\end{document}

具有相應的輸出:

範例影像輸出 實像輸出

答案1

我不確定我是否正確理解了你的問題......像這樣?

在此輸入影像描述

\documentclass[11pt,a4paper]{report}
\usepackage[export]{adjustbox} % it load graphicx too
                               % used to move images' baselines at their top
\usepackage[vmargin=2.5cm, hmargin=2.6cm]{geometry}

\begin{document}
    \begin{figure}
        \centering
        \begin{minipage}[t]{0.5\linewidth}
            \centering
            \includegraphics[width=238px, height=274px,valign=t]{example-image-a}
            \caption{Schémas dex expériences des aimants $A$ et $B$}
        \end{minipage}\hfil
        \begin{minipage}[t]{0.4\linewidth}
            \centering
            \includegraphics[width=117px, height=383px,valign=t]{example-image-b}
        \end{minipage}
    \end{figure}
\end{document}

答案2

請嘗試:

\documentclass[11pt,a4paper]{report}
\usepackage{graphicx}
\usepackage[top=2.5cm,bottom=2cm,left=2.6cm,right=2.6cm]{geometry}
\usepackage{adjustbox}

\begin{document}
    \begin{figure}
        \centering
\adjustbox{valign=t}{
        \begin{minipage}[t]{0.5\linewidth}
            \centering
            \includegraphics[width=238px, height=274px]{example-image-a}
            \caption{Schémas dex expériences des aimants $A$ et $B$}
        \end{minipage}}\qquad
\adjustbox{valign=t}{
        \begin{minipage}{0.4\linewidth}
            \centering
            \includegraphics[width=117px, height=383px]{example-image-b}
        \end{minipage}}
    \end{figure}

\end{document}

輸出:

在此輸入影像描述

相關內容