1
\documentclass{article}
\usepackage{amsmath,amssymb,graphicx}
\usepackage[a4paper,margin=.8cm]{geometry}

\begin{document}
\title{Plotting Graphs of Functions}
\author{}
\date{\today}
\maketitle

\begin{minipage}{0.45\textwidth}\centering
\(y=x+2\)
\par\bigskip\includegraphics[width=0.9\textwidth]{55}
\end{minipage}
\begin{minipage}{0.45\textwidth}\centering
\(y=x+1\)
\par\bigskip\includegraphics[width=0.9\textwidth]{55}
\end{minipage}\bigskip\bigskip\par
\begin{minipage}{0.45\textwidth}\centering
\(y=x-2\)
\par\bigskip\includegraphics[width=0.9\textwidth]{55}
\end{minipage}
\begin{minipage}{0.45\textwidth}\centering
\(y=2x-2\)
\par\bigskip\includegraphics[width=0.9\textwidth]{55}
\end{minipage}\bigskip\bigskip\par

\clearpage
\begin{minipage}{0.45\textwidth}\centering
\(y=2x+1\)
\par\bigskip\includegraphics[width=0.9\textwidth]{55}
\end{minipage}
\begin{minipage}{0.45\textwidth}\centering
\(y=2x\)
\par\bigskip\includegraphics[width=0.9\textwidth]{55}
\end{minipage}\bigskip\bigskip\par
\begin{minipage}{0.45\textwidth}\centering
\(y=3x-3\)
\par\bigskip\includegraphics[width=0.9\textwidth]{55}
\end{minipage}
\begin{minipage}{0.45\textwidth}\centering
\(y=3x+2\)
\par\bigskip\includegraphics[width=0.9\textwidth]{55}
\end{minipage}\bigskip\bigskip\par
\begin{minipage}{0.45\textwidth}\centering
\(y=-x+2\)
\par\bigskip\includegraphics[width=0.9\textwidth]{55}
\end{minipage}
\begin{minipage}{0.45\textwidth}\centering
\(y=-x-3\)
\par\bigskip\includegraphics[width=0.9\textwidth]{55}
\end{minipage}
\end{document}

first second

The above is my working example. I like the result, but disklike the code.

As you see, I manually aligned vertical spaces(\par\bigskip) and horizontal things(minipage). And after every two cells(a cell is an equation and grid image), I should add \par.

So if I add more equations like \(y=2x+3\) between cells, I have no choice but to rearrange the whole code. Is there any way to improve my code? I already read insert images into a tabular environment. But, I have a text and an image, not an image.

1 Answer 1

1

You may use the tabular environment. It should work even if you add more equations between cells.

\documentclass{article}
\usepackage{array}
\usepackage{amsmath,amssymb}
\usepackage[demo]{graphicx}
\usepackage[a4paper,margin=.8cm]{geometry}

\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}p{#1}}

\begin{document}
\title{Plotting Graphs of Functions}
\author{}
\date{\today}
\maketitle

{\setlength{\tabcolsep}{6pt}%
\renewcommand{\arraystretch}{2}%
\begin{tabular}{@{}*{2}{C{0.45\textwidth}}@{}}
    \(y=x+2\) & \(y=x+1\) \\
    \includegraphics[width=0.9\linewidth]{55} & \includegraphics[width=0.9\linewidth]{55}\\
    \(y=x-2\) & \(y=2x-2\)\\
    \includegraphics[width=0.9\linewidth]{55} & \includegraphics[width=0.9\linewidth]{55}\\
\end{tabular}%
\clearpage
\begin{tabular}{@{}*{2}{C{0.45\textwidth}}@{}}
    \(y=2x+1\) & \(y=2x\) \\
    \includegraphics[width=0.9\linewidth]{55} & \includegraphics[width=0.9\linewidth]{55}\\
    \(y=3x-3\) & \(y=3x+2\)\\
    \includegraphics[width=0.9\linewidth]{55} & \includegraphics[width=0.9\linewidth]{55}\\
    \(y=-x+2\) & \(y=-x-3\)\\
    \includegraphics[width=0.9\linewidth]{55} & \includegraphics[width=0.9\linewidth]{55}\\
\end{tabular}%
}
\end{document}

1st page:

enter image description here

2nd page:

enter image description here

You must log in to answer this question.

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