비머에 두 개의 기둥 생성

비머에 두 개의 기둥 생성

이 문제를 해결하기 위해 stackexchange를 검색했지만 다음 내용을 입력하면 여전히 오류 메시지가 나타납니다(지금은 documentclass, start{document} 등과 같은 내 문서의 다른 항목을 무시하고 있습니다).

\begin{frame}
\frametitle{explanation}
\begin{columns}
\begin{column}{width=0.5\textwidth}
   some text here
\end{column}
\begin{column}
    \begin{center}
     \includegraphics[width=0.5\textwidth]{image1.jpg}      
     \end{center}
\end{column}
\end{columns}
\end{frame}

컴파일할 때 오류가 발생합니다: Missing number, treated as zero. 도움을 주시면 감사하겠습니다.

답변1

두 번째 열에 필수 너비를 지정하는 것을 잊었고 width=첫 번째 열의 너비에 불필요한 너비를 포함했습니다.

\documentclass[demo]{beamer}
\begin{document}
  \begin{frame}
\frametitle{explanation}
\begin{columns}
\begin{column}{0.5\textwidth}
   some text here some text here some text here some text here some text here
\end{column}
\begin{column}{0.5\textwidth}  %%<--- here
    \begin{center}
     \includegraphics[width=0.5\textwidth]{image1.jpg}
     \end{center}
\end{column}
\end{columns}
\end{frame}
\end{document}

여기에 이미지 설명을 입력하세요

답변2

또한 두 번째 열에서는 그래픽을 축소할 필요가 없습니다. 열은 가 되므로 minipage이미 \textwidth너비가 조정되어 있습니다.

\documentclass[demo]{beamer}
\begin{document}
  \begin{frame}
\frametitle{explanation}
\begin{columns}
\begin{column}{0.5\textwidth}
   some text here some text here some text here some text here some text here
\end{column}
\begin{column}{0.5\textwidth}  
    \begin{center}
     %%%%% this is a minipage, so \textwidth is already adjusted to the size of the column
     \includegraphics[width=\textwidth]{image1.jpg}
     \end{center}
\end{column}
\end{columns}
\end{frame}
\end{document}

답변3

Beamer의 "열" 기능(위의 다른 답변)을 사용하면 레이아웃과 중단점을 사용자 정의할 수 있습니다.

그러나 텍스트 흐름을 원하거나 정확한 레이아웃에 관심이 없다면 오래된 multicol패키지가 소음을 줄이면서 작업을 잘 수행하는 경우가 많습니다. 단락을 구분하고 \columnbreak2열의 경우 왼쪽과 오른쪽 또는 오른쪽에 무엇이 있는지 결정하는 데 도움이 될 수 있습니다.

\usepackage{multicol}
...
\begin{frame}{Frame Title}
    \begin{multicols}{2} % two columns
        Left Hand side text

        \includegraphics[width=4cm]{RHS_image}
    \end{multicols}
\end{frame}

관련 정보