異なるサイズの画像をフォーマットするにはどうすればよいですか?

異なるサイズの画像をフォーマットするにはどうすればよいですか?

授業のレポートを書いているのですが、複数の画像 (具体的には 4 つの画像) をうまくフォーマットする方法がわかりません。助けてもらえますか? これが私のコードです:

        \begin{figure}[H]
        \begin{minipage}[t]{0.5\textwidth}
        \includegraphics[width=\linewidth]{tables/B/5.png}
        \end{minipage}
        \hspace{\fill}
        \begin{minipage}[t]{0.5\textwidth}
        \includegraphics[width=\linewidth, height=\textwidth]{tables/B/6.png}
        \end{minipage}
        \vspace*{1cm}
        \begin{minipage}[t]{0.5\textwidth}
        \includegraphics[width=\linewidth]{tables/B/7.png}
        \end{minipage}
        \hspace{\fill}
        \begin{minipage}[t]{0.5\textwidth}
        \includegraphics[width=\linewidth, height=\textwidth{tables/B/8.png}
        \end{minipage}
        \end{figure}

しかし、次のような厄介なページが出力されます。

ここに画像の説明を入力してください

答え1

コメントで提案したように、表の写真を含めることはお勧めしません。環境で大きな表を作成するのはtabular少々面倒ですが、データファイルを表にまとめる場合は、pgfplotstable非常に役立つ可能性があります(PGFプロット)。

以下に、その使用例をいくつか示します。

\documentclass[border=5,export]{standalone}
\usepackage{pgfplotstable}
\usepackage{booktabs}
\begin{filecontents*}{data.dat}
   1.   0.                  0.
   2.   1.3862943611198906  0.34657359027997264
   3.   3.295836866004329   0.1831020481113516
   4.   5.545177444479562   0.057762265046662105
   5.   8.047189562170502   0.013411982603617503
   6.  10.75055681536833    0.0024885548183722988
   7.  13.621371043387192   0.0003860932835427209
   8.  16.635532333438686   0.000051573450934519735
   9.  19.775021196025975   6.054961908444168e-6
  10.  23.02585092994046    6.345307244802815e-7
\end{filecontents*}

\begin{document}
\begin{table}
  \pgfplotstabletypeset[
    columns/0/.style={
      column name=\(n\),
    },
    columns/1/.style={
      column name=\(x_{n}\),
      fixed, zerofill,
      precision=3,
    },
    columns/2/.style={
      column name=\(\Delta x_{n}\),
      sci, zerofill,
      precision=4,
    },
    every head row/.style={
      before row=\toprule,
      after row=\midrule,
    },
    every last row/.style={
      after row=\bottomrule,
    },
  ]{data.dat}
\end{table}
\end{document}

これにより、次のようになります。

PGFplotstableを使用する

それでも表を画像として含めたい場合は、この質問これはあなたのものと非常に似ています。あなたが使用しているのが のみgraphicxで、他のパッケージが他の環境を変更していないと仮定すると、これを修正する方法は次のとおりです。

\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}
  \begin{minipage}[t][][b]{0.5\textwidth}
    \includegraphics[width=\linewidth]{1.png}
  \end{minipage}
  \begin{minipage}[t][][b]{0.5\textwidth}
    \includegraphics[width=\linewidth]{2.png}
  \end{minipage}
  \begin{minipage}[t][][b]{0.5\textwidth}
    \includegraphics[width=\linewidth]{3.png}
  \end{minipage}
  \begin{minipage}[t][][b]{0.5\textwidth}
    \includegraphics[width=\linewidth]{4.png}
  \end{minipage}
\end{figure}
\end{document}

出力は次のようになります。

位置合わせを修正する

関連情報