环境与周围环境不一致

环境与周围环境不一致

在以下示例中,alignment 参数均不起作用tb请参见附图)。为什么以及如何使环境与周围环境保持一致。

代碼:

\documentclass{article}
\usepackage{listings}
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newbox\mybox
\savebox\mybox{\parbox{3in}{%
  \begin{itemize}
  \item 1\item 2\item 3\item 4\item 5
  \end{itemize} 
}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Exp 1. Aligned by t:\par
\begin{minipage}[t]{2in}
  \begin{lstlisting}[]
      ab
      cd
      ef
  \end{lstlisting}
\end{minipage}
\vrule\ 
\parbox[t]{3in}{\usebox\mybox}
\par\bigskip
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Exp 2. Aligned by b:\par
\begin{minipage}[b]{2in}
    \begin{lstlisting}[]
      ab
      cd
      ef
  \end{lstlisting}
  \end{minipage}
\vrule\ 
\parbox[b]{3in}{\usebox\mybox}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\end{document}

在此处输入图片描述

相关内容