
при использовании 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
s и уменьшая ширину , \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}