\item 是“未定义的控制序列。”

\item 是“未定义的控制序列。”

我正在使用 LaTeX 编写海报beamerposter。这是一张两列海报。我遇到了以下问题:如果我itemize在某个部分中添加和,编译器会抱怨这itemundefined control sequence(但生成的 pdf 没问题)。代码如下:

\documentclass[]{beamer} 
\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage[orientation=portrait,size=a0,debug]{beamerposter} 
\usepackage{tabularx}
\usepackage{multicol}
\usepackage{lipsum}

\title[SHORT TITLE]
{MY COOL POSTER}
\author{First Last \inst{1}}
\institute{ 
  \inst{1} Super University, Italy 
}

\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{headline}{
  \leavevmode
  \vskip 5em
  \begin{center}
    \begin{tabular}[c]{ >{\centering}m{.2\linewidth}
        >{\centering}m{.5\linewidth} >{\centering}m{.2\linewidth}}
      \multicolumn{3}{c}{
      {\VeryHuge \inserttitle}
      } \\ [2em]
      \includegraphics[width=.5\linewidth]{logo}
   & \begin{minipage}[c]{1\linewidth}
     \begin{center}
       \LARGE{\insertauthor}\\[1ex]
       \large{\insertinstitute}\\[1ex]
     \end{center}
   \end{minipage}
   &  \includegraphics[width=.5\linewidth]{logo} \\
    \end{tabular}
  \end{center}
  \vskip 1em
  \begin{center}
    \rule{0.9\textwidth}{.4em}
  \end{center}
  \vskip 5em
}
\setbeamertemplate{footline}{
  \leavevmode
  \begin{center}
    \rule{0.9\textwidth}{.4em}
    \vskip 2em
    {\LARGE \insertshorttitle}
    \vskip 2em
  \end{center}
}

\renewcommand{\section}[1]{
\par\vskip\medskipamount%
%
\begin{center}
  {\textbf{\Large #1}}
\rule{\columnwidth}{.1em}
\end{center}
}

\begin{document}
\centering
\begin{minipage}[c]{0.92\linewidth}
  \begin{multicols}{2}[\setlength{\columnsep}{3.5em}]

    \section{Section 1}
    {\Large 
      \begin{itemize}
      \item First Item
      \item Second Item is considerably longer
      \item Third Item is normal
      \item Fourth Item is totally the longest one: it's even longer than what you think!
      \end{itemize}
    }
    \vskip 2em
    \columnbreak

    \section{Section 2}
    {\Large \lipsum[1]} \vskip 2em

    \end{multicols}
  \end{minipage}
\end{document}

以及编译器的输出:

ERROR: Undefined control sequence.

--- TeX said ---
\\itemize ...ix item}##1}}}}} \fi \beamer@cramped 
                                                  \raggedright \beamer@first...
l.69       \item
                 First Item
--- HELP ---
TeX encountered an unknown command name. You probably misspelled the
name. If this message occurs when a LaTeX command is being processed,
the command is probably in the wrong place---for example, the error
can be produced by an \item command that's not inside a list-making
environment. The error can also be caused by a missing \documentclass
command.

有什么建议吗?谢谢。

答案1

如果你想设置任何内容beamer,你需要把它放在里面frame

在此处输入图片描述

\documentclass{beamer}
\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage[orientation=portrait,size=a0]{beamerposter} 
\usepackage{tabularx}
\usepackage{multicol}
\usepackage{lipsum}

\title[SHORT TITLE]
{MY COOL POSTER}
\author{First Last \inst{1}}
\institute{ 
  \inst{1} Super University, Italy 
}

\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{headline}{
  \leavevmode
  \vskip 5em
  \begin{center}
    \begin{tabular}[c]{ >{\centering}m{.2\linewidth}
        >{\centering}m{.5\linewidth} >{\centering}m{.2\linewidth}}
      \multicolumn{3}{c}{
      {\VeryHuge \inserttitle}
      } \\ [2em]
      \includegraphics[width=.5\linewidth]{example-image}
   & \begin{minipage}[c]{1\linewidth}
     \begin{center}
       \LARGE{\insertauthor}\\[1ex]
       \large{\insertinstitute}\\[1ex]
     \end{center}
   \end{minipage}
   &  \includegraphics[width=.5\linewidth]{example-image} \\
    \end{tabular}
  \end{center}
  \vskip 1em
  \begin{center}
    \rule{0.9\textwidth}{.4em}
  \end{center}
  \vskip 5em
}
\setbeamertemplate{footline}{
  \leavevmode
  \begin{center}
    \rule{0.9\textwidth}{.4em}
    \vskip 2em
    {\LARGE \insertshorttitle}
    \vskip 2em
  \end{center}
}

\renewcommand{\section}[1]{
\par\vskip\medskipamount%
%
\begin{center}
  {\textbf{\Large #1}}
\rule{\columnwidth}{.1em}
\end{center}
}

\begin{document}

\begin{frame}
\centering
\begin{minipage}[c]{0.92\linewidth}
  \begin{multicols}{2}[\setlength{\columnsep}{3.5em}]

    \section{Section 1}
    {\Large 
      \begin{itemize}
      \item First Item
      \item Second Item is considerably longer
      \item Third Item is normal
      \item Fourth Item is totally the longest one: it's even longer than what you think!
      \end{itemize}
    }
    \vskip 2em
    \columnbreak

    \section{Section 2}
    {\Large \lipsum[1]} \vskip 2em

    \end{multicols}
  \end{minipage}

\end{frame}
\end{document}

相关内容