![Beamer 模板华沙— LaTeX 错误:缺少 \begin{document}](https://linux22.com/image/438042/Beamer%20%E6%A8%A1%E6%9D%BF%E5%8D%8E%E6%B2%99%E2%80%94%20LaTeX%20%E9%94%99%E8%AF%AF%EF%BC%9A%E7%BC%BA%E5%B0%91%20%5Cbegin%7Bdocument%7D%20.png)
我在 lyx 中使用 warsaw 模板。但我收到有关 Missing 的错误\begin{document}
。这是此错误消息的描述
\setbeamertemplate{section page}[default][colsep=-4bp,rounded=true,shad...
。此外,在第一张幻灯片上出现了这两行代码
[colsep=-4bp,rounded=true,shadow=true
[colsep=-4bp,rounded=true,shadow=true
有谁能帮助我?我认为由于这个问题,我无法更改其纵横比。
这是 tex 代码;
\makeatletter
\def\input@path{{\string"E:/master/TTh/slides/\string"}}
\makeatother
\documentclass[10pt,english]{beamer}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{fontspec}
\setcounter{secnumdepth}{1}
\setcounter{tocdepth}{3}
\usepackage{latexsym}
\ifx\hypersetup\undefined
\AtBeginDocument{%
\hypersetup{unicode=true,
bookmarks=true,bookmarksnumbered=true,bookmarksopen=true,bookmarksopenlevel=4,
breaklinks=false,pdfborder={0 0 0},pdfborderstyle={},backref=section,colorlinks=false,pdftitle={title},
pdfauthor={name},
pdfsubject={title},
pdfkeywords={title}}
}
\else
\hypersetup{unicode=true,
bookmarks=true,bookmarksnumbered=true,bookmarksopen=true,bookmarksopenlevel=4,
breaklinks=false,pdfborder={0 0 0},pdfborderstyle={},backref=section,colorlinks=false,pdftitle={title},
pdfauthor={name},
pdfsubject={title},
pdfkeywords={title}}
\fi
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
% this default might be overridden by plain title style
\newcommand\makebeamertitle{\frame{\maketitle}}%
% (ERT) argument for the TOC
\AtBeginDocument{%
\let\origtableofcontents=\tableofcontents
\def\tableofcontents{\@ifnextchar[{\origtableofcontents}{\gobbletableofcontents}}
\def\gobbletableofcontents#1{\origtableofcontents}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
%\geometry{papersize={160mm,90mm}}
%\PassOptionsToPackage{landscape}{geometry}
\usetheme{Warsaw}
%\usetheme{Berlin}
\usepackage{beamerthemesplit} %%self for aspect ratio
\usepackage[orientation=landscape,size=custom,width=16,height=9,scale=0.5,debug]{beamerposter} %%%%self for aspect ratio
%\usepackage{pdflscape}
\usepackage{bookmark}
\hypersetup{bookmarksdepth=4,bookmarksnumbered=true,bookmarksopen=true}
\setcounter{tocdepth}{1}
% or ...
\setbeamercovered{transparent}
% or whatever (possibly just delete it)
%\usepackage{palatino}%
\usepackage[sc]{mathpazo}
\beamertemplatenavigationsymbolsempty
%Set Presentation mode and colors
%--------------------------------------------------------
\mode<presentation> {
\setbeamertemplate{background canvas}[vertical shading][bottom=white,top=white]
\usetheme{Warsaw}
\usefonttheme[onlysmall]{structurebold}
%
% default | professionalfonts | serif |
% structurebold | structureitalicserif |
% structuresmallcapsserif
}
\setbeamertemplate{navigation symbols}{}%remove navigation symbols
%Using packages
%--------------------------------------------------------
\usepackage{amsfonts}\usepackage{amsxtra}\usepackage{pgf}
%\usepackage{german} %%I changed it
\usepackage{graphicx}
\usepackage{float}
\usepackage{multirow}
\usepackage{units}
%\usepackage{multimedia}
\usepackage{color}
\usepackage{colortbl}
\usepackage{booktabs}
\usepackage{hyphenat}
\usepackage{movie15}
\graphicspath{{./picture/}}
\include{defs}
\usepackage{animate}
%Begin of the document
%--------------------------------------------------------
\setbeamertemplate{frametitle}[default][left] %%for setting frame titles to the left
%%to change font size
%\usepackage{scrextend}
%\changefontsizes{10pt}
\AtBeginDocument{
\def\labelitemi{\(\rhd\)}
}
\makeatother
\usepackage{polyglossia}
\setdefaultlanguage[variant=american]{english}
\begin{document}
\title[title]{title\\
}
\subtitle{\textcolor{green}{\small{}(Supervisors: }\linebreak{}
\textcolor{green}{\small{}\&}\linebreak{}
\textcolor{green}{\small{} Prof.)}\\
}
\author{name}
\institute{Department of Media\\
Uni\\
City, \\
}
\date{}
\makebeamertitle
\AtBeginSection[]{%
\frame<beamer>{
\frametitle{Outline}
\tableofcontents[currentsection,currentsubsection]
}
}
%\beamerdefaultoverlayspecification{<+->}
\section{Motivation}
\end{document}
答案1
我在使用 overleaf 时遇到了同样的错误。我通过在项目文件夹中添加一个名为“beamerinnerthemerounded.sty”的新文件来解决了这个问题,该文件包含以下代码:此链接。