迷你页面与文本框的高度不一致

迷你页面与文本框的高度不一致

使用时minipage,第二列有一个文本框。当我fbox在第二列使用时,第一列的文本会向下移动,因此两侧的高度不相同。以下是代码;

\begin{minipage}[t]{0.5\textwidth}
\textbf{Items:}
\begin{itemize}
\item Item1
\item Item2
\item Item3
\item Item3
\end{itemize}
\textcolor{red}{\textbf{Def:}} Cumulative distribution function (cdf ): is the probability that the variable takes a value less than or equal to X.

    \textbf{Items:}
    \begin{itemize}
    \item Item1 
    \item Item1
    \item Item1
    \item Item1
    \end{itemize}
    \textcolor{red}{\textbf{Def:}}  TCumulative distribution function (cdf ): is the probability that the variable takes a value less than or equa l to X.
    \end{minipage}
    %second column
    \begin{minipage}[t]{0.5\textwidth}
    \fbox{%
      \parbox{\textwidth}{%
        \begin{center}
          Useful mnemonics:
          \begin{itemize}
          \item "OIL RIG -- \textbf{O}xidation \textbf{I}s \textbf{L}oss of electrons, \textbf{R}eduction \textbf{I}s \textbf{G}ain of electrons
          \item "OIL RIG -- \textbf{O}xidation \textbf{I}s \textbf{L}oss of electrons, \textbf{R}eduction \textbf{I}s \textbf{G}ain of electrons
          \item "OIL RIG -- \textbf{O}xidation \textbf{I}s \textbf{L}oss of electrons, \textbf{R}eduction \textbf{I}s \textbf{G}ain of electrons
          \item "OIL RIG -- \textbf{O}xidation \textbf{I}s \textbf{L}oss of electrons, \textbf{R}eduction \textbf{I}s \textbf{G}ain of electrons
          \item "OIL RIG -- \textbf{O}xidation \textbf{I}s \textbf{L}oss of electrons, \textbf{R}eduction \textbf{I}s \textbf{G}ain of electrons
          \item "OIL RIG -- \textbf{O}xidation \textbf{I}s \textbf{L}oss of electrons, \textbf{R}eduction \textbf{I}s \textbf{G}ain of electrons
          \end{itemize}
        \end{center}
      }%
    }

    \end{minipage}

这段代码的输出如下;
在此处输入图片描述

请告诉我如何排列它们,以便两列(或小页面)保持相同的高度。谢谢!

答案1

在此处输入图片描述

\begin{minipage}[T]{0.48\textwidth}
\textbf{Items:}
\begin{itemize}
\item Item1
\item Item2
\item Item3
\item Item3
\end{itemize}
\textcolor{red}{\textbf{Def:}} Cumulative distribution function (cdf ): is the probability that the variable takes a value less than or equal to X.

    \textbf{Items:}
    \begin{itemize}
    \item Item1 
    \item Item1
    \item Item1
    \item Item1
    \end{itemize}
    \textcolor{red}{\textbf{Def:}}  TCumulative distribution function (cdf ): is the probability that the variable takes a value less than or equa l to X.
    \end{minipage}
    %second column
    \begin{minipage}[T]{0.48\textwidth}
    \fbox{%
      \parbox{\textwidth}{%
        \centering
          Useful mnemonics:
          \begin{itemize}
          \item "OIL RIG -- \textbf{O}xidation \textbf{I}s \textbf{L}oss of electrons, \textbf{R}eduction \textbf{I}s \textbf{G}ain of electrons
          \item "OIL RIG -- \textbf{O}xidation \textbf{I}s \textbf{L}oss of electrons, \textbf{R}eduction \textbf{I}s \textbf{G}ain of electrons
          \item "OIL RIG -- \textbf{O}xidation \textbf{I}s \textbf{L}oss of electrons, \textbf{R}eduction \textbf{I}s \textbf{G}ain of electrons
          \item "OIL RIG -- \textbf{O}xidation \textbf{I}s \textbf{L}oss of electrons, \textbf{R}eduction \textbf{I}s \textbf{G}ain of electrons
          \item "OIL RIG -- \textbf{O}xidation \textbf{I}s \textbf{L}oss of electrons, \textbf{R}eduction \textbf{I}s \textbf{G}ain of electrons
          \item "OIL RIG -- \textbf{O}xidation \textbf{I}s \textbf{L}oss of electrons, \textbf{R}eduction \textbf{I}s \textbf{G}ain of electrons
          \end{itemize}
      }%
    }
    \end{minipage}

使用[T]对齐minipages 的选项,并且不要通过留下 来占用所有水平空间0.02\textwidth,例如\begin{minipage}[T]{0.48\textwidth}就可以了。

答案2

\parbox...这将使与两个环境对齐minipage,并使用 来修复坏框\noindent,消除 之间的空格minipage并减小 的宽度\parbox以便为 的线条和边距留出空间\fbox

\documentclass{article}
\usepackage{xcolor}
\begin{document}
\noindent
\begin{minipage}[t]{0.5\textwidth}
\textbf{Items:}
\begin{itemize}
  \item Item1
  \item Item2
  \item Item3
  \item Item3
\end{itemize}
\textcolor{red}{\textbf{Def:}} Cumulative distribution function (cdf ): is the probability that the variable takes a value less than or equal to X.

\textbf{Items:}
\begin{itemize}
  \item Item1
  \item Item1
  \item Item1
  \item Item1
\end{itemize}
\textcolor{red}{\textbf{Def:}}  TCumulative distribution function (cdf ): is the probability that the variable takes a value less than or equa l to X.
\end{minipage}%
\begin{minipage}[t]{0.5\textwidth}
\fbox{%
  \parbox[t]{.95\textwidth}{%
    \begin{center}
      Useful mnemonics:
      \begin{itemize}
        \item "OIL RIG -- \textbf{O}xidation \textbf{I}s \textbf{L}oss of electrons, \textbf{R}eduction \textbf{I}s \textbf{G}ain of electrons
        \item "OIL RIG -- \textbf{O}xidation \textbf{I}s \textbf{L}oss of electrons, \textbf{R}eduction \textbf{I}s \textbf{G}ain of electrons
        \item "OIL RIG -- \textbf{O}xidation \textbf{I}s \textbf{L}oss of electrons, \textbf{R}eduction \textbf{I}s \textbf{G}ain of electrons
        \item "OIL RIG -- \textbf{O}xidation \textbf{I}s \textbf{L}oss of electrons, \textbf{R}eduction \textbf{I}s \textbf{G}ain of electrons
        \item "OIL RIG -- \textbf{O}xidation \textbf{I}s \textbf{L}oss of electrons, \textbf{R}eduction \textbf{I}s \textbf{G}ain of electrons
        \item "OIL RIG -- \textbf{O}xidation \textbf{I}s \textbf{L}oss of electrons, \textbf{R}eduction \textbf{I}s \textbf{G}ain of electrons
      \end{itemize}
    \end{center}
  }%
}%
\end{minipage}
\end{document}

对齐且无坏盒

相关内容