I have 2 different codes that I am displaying side by side, one is significantly larger than the other. I'd like to add spacing to the small code so that their background boxes match identically, i'd also like to know how to make it so that the small text is at the same height as the big text.
So what I have is:
\begin{minipage}{0.5\textwidth}
\begin{lstlisting}[style=c]
void example()
{
int i = 0;
i = 500;
}
\end{lstlisting}
\end{minipage}
\begin{minipage}{0.5\textwidth}
\begin{lstlisting}[style=c]
struct structure
{
unsigned int f1;
unsigned int f2;
unsigned int f3;
unsigned int f4;
unsigned int f5;
unsigned int f6;
unsigned int f7;
unsigned int f8;
unsigned int f9;
unsigned int f10;
unsigned int f11;
};
struct structure example =
{
.f1 = 0xe52db004,
.f2 = 0xe28db000,
.f3 = 0xe24dd00c,
.f4 = 0xe3a03000,
.f5 = 0xe50b3008,
.f6 = 0xe3a03f7d,
.f7 = 0xe50b3008,
.f8 = 0xe1a00000,
.f9 = 0xe28bd000,
.f10= 0xe49db004,
.f11= 0xe12fff1e,
};
\end{lstlisting}
\end{minipage}
Resulting in:
What I wish is for that left code to be displayed at the top, at the same height as the right code and then append black space until it matches the right code. Completely unrelated, if you want to criticize the color scheme I am using go ahead, I encourage you.



\lstinputlistingwith the appropriate options to color the background. – TH. Jun 29 '17 at 02:38