![环境与周围环境不一致](https://linux22.com/image/453942/%E7%8E%AF%E5%A2%83%E4%B8%8E%E5%91%A8%E5%9B%B4%E7%8E%AF%E5%A2%83%E4%B8%8D%E4%B8%80%E8%87%B4.png)
在以下示例中,alignment 参数均不起作用t
(b
请参见附图)。为什么以及如何使环境与周围环境保持一致。
代碼:
\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}