列的 minipage 有 itemize 問題

列的 minipage 有 itemize 問題

我嘗試在beamer演示文稿中製作兩欄,但顯然itemize.由於某種我不明白的原因,列的起始高度不同。

這是代碼:

\documentclass[%
  hyperref={colorlinks=true,urlcolor=blue},%
  t,%
  aspectratio=169%
]{beamer}
\begin{document}
\begin{frame}
\frametitle{Introduction}
 \fbox{\begin{minipage}[t]{.5\textwidth}
  \begin{itemize}
   \item hallo  
  \end{itemize}
 \end{minipage}}%
 \fbox{\begin{minipage}[t]{.5\textwidth}
  hallo
 \end{minipage}}
\end{frame}
\end{document}

和結果

在此輸入影像描述

那麼問題是我要如何迫使他們在同一高度開始呢?

答案1

快速修復;使用T選項代替minipage

\documentclass[%
  hyperref={colorlinks=true,urlcolor=blue},%
  t,%
  aspectratio=169%
]{beamer}
\begin{document}
\begin{frame}
\frametitle{Introduction}
 \fbox{\begin{minipage}[T]{.5\textwidth}
  \begin{itemize}
   \item hallo  
  \end{itemize}
 \end{minipage}}%
 \fbox{\begin{minipage}[T]{.5\textwidth}
  hallo
 \end{minipage}}
\end{frame}
\end{document}

在此輸入影像描述

編輯:

投影機解決方案正在使用中columns

\documentclass[%
  hyperref={colorlinks=true,urlcolor=blue},%
  t,%
  aspectratio=169%
]{beamer}
\begin{document}

\begin{frame}{Introduction}

\begin{columns}
\begin{column}[T]{0.5\textwidth}
\fbox{\begin{minipage}{\textwidth}%
  \begin{itemize}
   \item hallo
   \item hallo  
  \end{itemize}
\end{minipage}}%
\end{column}
\begin{column}[T]{0.5\textwidth}
\fbox{\begin{minipage}{\textwidth}
  hallo
\end{minipage}}
\end{column}
\end{columns}

\end{frame}

\end{document}

在此輸入影像描述

答案2

tabularx小的手動調整?

\documentclass[ hyperref={colorlinks=true,urlcolor=blue},%
                t,%
                aspectratio=169%
]{beamer}
\usepackage{tabularx}
\makeatletter
\newcommand*{\compress}{\@minipagetrue}
\makeatother
\newcolumntype{I}{ >{\compress\itemize}X<{\enditemize}}

\begin{document}
\begin{frame}
\frametitle{Introduction}
 \begin{tabularx}{\linewidth}{|I|X|}
 \hline
   \item hallo
   \item hallo
 &  \vspace*{-2pt}
  hallo    \\
  \hline
 \end{tabularx}
\end{frame}
\end{document}

在此輸入影像描述

相關內容