1

I am writing a report for class and I cannot figure out how to format multiple images (specifically 4 images) in a nicer way. Can I get some help? Here is my code:

        \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}

But this outputs the following nasty page:

enter image description here

Scott
  • 11
  • 1

1 Answers1

2

As I suggested in my comment, I wouldn't recommend include pictures of tables. I understand that creating large tables with the tabular environment can be somewhat tedious, but if you are tabulating data files, there is pgfplotstable that can be immensely helpful (it is distributed with PGFplots).

Here's a small example of how it can be used:

\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}

which produces:

using PGFplotstable

If you still wish to include the tables as pictures, then I found this question which is very similar to yours. Assuming that you are only using graphicx and other packages aren't modifying the other environments, then here is how you can fix it:

\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}

with the output being:

fixing the alignment

JP-Ellis
  • 8,929
  • 2
  • 33
  • 49