I want to generate a document with graph at left and tikz code at the right. I try to use two minipage but it seems it always layout it as up and down. The minipage is 0.45\textwidth, why latex still can not put it side by side?
The example code as below:
\documentclass[12pt]{article}
\usepackage[margin=0.5in]{geometry}
\usepackage{listings}
\usepackage{color}
\usepackage{tikz}
\usepackage{adjustbox}
\lstset{
backgroundcolor=\color{white},
breaklines=true,
language=TeX,
frame=single}
\begin{document}
\begin{minipage}{0.45\textwidth}
\begin{adjustbox}{max width=0.45\textwidth}
\begin{tikzpicture}
\draw (0,0) circle (5cm);
\end{tikzpicture}
\end{adjustbox}
\end{minipage}
\begin{minipage}{0.45\textwidth}
\begin{lstlisting}
\begin{tikzpicture}
\draw (0,0) circle (5cm);
\end{tikzpicture}
\end{lstlisting}
\end{minipage}
\end{document}
Current output by pdflatex as bleow:


\hfillbetween them, for example. – Sigur Dec 30 '14 at 22:58