I'm trying to put two pspictures beside each other. I also checked the same question and tried the answer about defining two columns, but it didn't work and LaTeX considered those as undefined environments. I suppose that was because the answer which suggested columns was provided for the beamer class. What should I do to have these two beside each other ?
\documentclass{book}
\usepackage{caption}
\usepackage{pstricks,pst-plot}
\usepackage{pst-bezier}
\usepackage{pst-math}
\begin{document}
\begin{columns}
\begin{column}{0.45\textwidth}
\psset{xunit=0.5cm,yunit=0.5cm}
\centering%
\begin{pspicture}(4,4)
\psaxes[labels=none]{->}(0,0)(4,4)[$x$,0][$y$,90]
\end{pspicture}
\captionof{figure}{simple}
\end{column}
\begin{column}{0.45\textwidth}
\begin{pspicture}(4,4)
\psaxes[labels=none]{->}(0,0)(4,4)[$x$,0][$y$,90]
\end{pspicture}
\captionof{figure}{compund}
\end{column}
\end{columns}
\end{document}
Best Answer
As mentioned in the comments, you could use two
minipage
s here. Note that each time you\end{minipage}
you should put a%
to avoid an extra piece of space being put in- this means that you can split the page in half exactly, and not have anyoverfull hboxes
. Try removing them to see the difference.It's probably worth noting that some folks might recommend putting this in a floating
figure
environment. If you do so, then you don't need to usecaptionof{figure}{simple}
and can simply usecaption{simple}
instead.