我想使用 minipages 将两个列表对齐。不幸的是,右侧 minipage 稍微向底部移动了一点。这是什么问题?
\documentclass[11pt,fleqn,a4paper,pdftex,twoside]{book}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{parcolumns}
\usepackage{listings}
\lstdefinestyle{customc}{
language=C,
tabsize=2,
breaklines=true,
captionpos=b,
frame=tlrb
}
\begin{document}
\noindent\begin{minipage}{.48\textwidth}
\begin{lstlisting}[style=customc, caption={Unoptimized if statement in GetFilteredNewHostCommand}]
if (tmp != NULL)
\end{lstlisting}
\end{minipage}\hfill
\begin{minipage}{.48\textwidth}
\begin{lstlisting}[style=customc, caption={Optimized if statement in GetFilteredNewHostCommand}]
if (unlikely(tmp != NULL))
\end{lstlisting}
\end{minipage}
\end{document}