使用时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]
对齐minipage
s 的选项,并且不要通过留下 来占用所有水平空间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}