Beamer 模板无法在 TexMaker 上运行

Beamer 模板无法在 TexMaker 上运行

我正在尝试在 overleaf 上编译一个大型 beamer 模板 (CCM beamer 模板 3)。但由于超时 (大量 tikz 图形),我被迫切换到其他东西,所以我正在尝试 TEXMaker。

我遇到的问题如下:我的文件夹中有 4 个 .sty 文件和一个 .tex 文件,当我在 overleaf 上编译 .tex 文件时,我得到了所需的输出(一个简单的空白框,上面写着“有人在这里吗?”)。但是,当在 TEXMaker 上运行具有完全相同目录组织的完全相同的文件时,编译不会输出任何 pdf,并且我遇到了一个新的错误。简而言之,它在 overleaf 上运行,但在 TEXMaker 上运行不起来。

是不是我必须进行某些特别配置才能使其在 TEXMaker 上运行?
我是不是搞砸了什么(我使用 latex 已经一个星期了,所以我完全是初学者)?

上面提到的新错误如下:

! 段落在 \setbeamertemplate 完成之前结束。

overleaf 和 TEXMaker 上都存在一个错误(我不知道如何解决它):

!} 太多了。

两个错误均位于:beamerinnerthemeccm3.sty;第 40 行

使用的版本: MiKTeX-pdfTeX 4.15 (MiKTeX 23.5) overleaf - Tex Live 2022

这是我的文件:

测试.tex:

\documentclass{beamer}


\usepackage[utf8]{inputenc}

\usepackage[T1]{fontenc}
\usepackage[heuristica,vvarbb,bigdelims]{newtxmath}
\renewcommand*\oldstylenums[1]{\textosf{#1}}
\usepackage[sfdefault,scaled=.85]{FiraSans}

\usetheme{ccm3}

\begin{document}


\section{ Hello?} 

\begin{frame}
    Is someone here?

\end{frame}


\end{document}

beamercolorthemeccm3.sty:

\mode<presentation>


\setbeamercolor*{title page header}{fg=mostazaccm}
\setbeamercolor*{author}{fg=white}
\setbeamercolor*{date}{fg=white}
\setbeamercolor*{institute}{fg=white}
\setbeamercolor*{sectiontitle}{fg=white}
\setbeamercolor*{frametitle}{fg=mostazaccm}
\setbeamercolor*{framesubtitle}{fg=amarilloccm}
\setbeamercolor*{section in head/foot}{fg=white}
\setbeamercolor*{author in head/foot}{fg=white}
\setbeamercolor*{date in head/foot}{fg=white}

\setbeamercolor*{item}{fg=azulccm}

\setbeamercolor{block title}{use=structure,fg=white,bg=gristexto}
\setbeamercolor{block body}{fg=black,bg=gristexto!35}

\mode<all>

beamerinnerthemeccm3.sty:

\mode<presentation>


\defbeamertemplate*{title page}{CCM3}[1][]
{
    \begin{textblock}{4}(7,1)
  \end{textblock}

    \vspace*{3.2cm}
  
  
    \begin{beamercolorbox}[center,wd=\paperwidth,sep=1pt]{title page header}
      \usebeamerfont{title}{\setstretch{1.1} \scalefont{1.5} \inserttitle}\par%
    \end{beamercolorbox}
    
    \vspace*{0.01cm}
    
    \begin{beamercolorbox}[center,wd=\paperwidth]{date}
    \usebeamerfont{date}\insertdate%
    \end{beamercolorbox}
  
  
  \vspace*{\fill}
   \vspace*{1cm}
  \begin{beamercolorbox}[center,wd=\the\paperwidth]{author}
    {\usebeamerfont{author} \insertauthor}%
  \end{beamercolorbox}
  
  \begin{beamercolorbox}[center,wd=\the\paperwidth]{institute}
    {\usebeamerfont{institute}\insertinstitute}
  \end{beamercolorbox}
}

\setbeamertemplate{title page
%A definir la apareciencia de listas y tabla de contenidos
\setbeamertemplate{items}[circle]
\setbeamercolor{section in toc}{fg=black}
\setbeamertemplate{section in toc}{{\Huge \color{mostazaccm} \oldstylenums{\inserttocsectionnumber}.}~\inserttocsection}
\setbeamercolor{subsection in toc}{fg=gray}
\setbeamertemplate{subsection in toc}{\hspace{1.45em}{\color{gray}\rule[0.3ex]{3pt}{3pt}}~\inserttocsubsection\par}

\mode<all>

beamerouterthemeccm3.sty

\mode<presentation>

\setbeamerfont{sectiontitle}{size=\huge, shape=\scshape}

\defbeamertemplate*{frametitle}{ccm3}[1][]
{
  \begin{beamercolorbox}[wd=\the\paperwidth,ht=1.9cm]{frametitle}
    \begin{tikzpicture}
    \useasboundingbox (0,0) rectangle(\the\paperwidth,1.4);
    
      \ifx\insertframesubtitle\@empty%
       {\node[anchor=west, mostazaccm , font=\huge] at (0.85,0.82){\textbf{\insertframetitle}};}
       \else%
       {\node[anchor=west, mostazaccm, font=\huge] at (0.85, 1.02){ \textbf{\insertframetitle}};%
       \node[anchor=west, mostazaccm , font=\large] at (0.85, 0.53){\insertframesubtitle};}%
       \fi
     \end{tikzpicture}
   \end{beamercolorbox}
   \vskip-0.5cm
}


\defbeamertemplate*{sidebar left}{sidebar theme}
{
\ifnum\thepage>2

\vspace*{\fill}
\hspace{-0.25\paperwidth}\colorbox{azulccm}{\makebox[1.5\paperwidth][c]{\scriptsize \textcolor{white}{\begin{tabular}{
  p{\dimexpr.5\paperwidth-2\tabcolsep-1.3333\arrayrulewidth}% column 1
  |p{\dimexpr.25\paperwidth-2\tabcolsep-1.3333\arrayrulewidth}% column 2
  |p{\dimexpr.25\paperwidth-2\tabcolsep-1.3333\arrayrulewidth}|% column 3
  }
     \insertauthor & \centering \insertsection  & \raggedleft \insertframenumber\,/\,\inserttotalframenumber
\end{tabular}}}}

\fi
}

\mode<all>

beamerthemeccm3.sty

\mode<presentation>

%Paquete requerido
\RequirePackage{tikz}
\RequirePackage{graphicx}
\RequirePackage{amssymb}
\RequirePackage{xcolor}
\RequirePackage{lastpage}
\RequirePackage{setspace}
\RequirePackage{scalefnt}

\RequirePackage[absolute, overlay]{textpos}
\definecolor{rojotexto}{HTML}{A21916}
\definecolor{gristexto}{HTML}{B2B2B2}
\definecolor{amarilloccm}{HTML}{FDC600}
\definecolor{mostazaccm}{HTML}{C99C00}
\definecolor{azulccm}{HTML}{003062}


\usecolortheme{CCM3}
\useinnertheme{CCM3}
\useoutertheme{CCM3}

\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{blocks}[rounded][shadow=true]

\mode<all>

答案1

您的内部主题中的行在\setbeamertemplate{title page不知何处结束。我猜应该像这样\setbeamertemplate{title page}[CCM3]

\documentclass{beamer}


\usepackage[utf8]{inputenc}

\usepackage[T1]{fontenc}
\usepackage[heuristica,vvarbb,bigdelims]{newtxmath}
\renewcommand*\oldstylenums[1]{\textosf{#1}}
\usepackage[sfdefault,scaled=.85]{FiraSans}

\mode<presentation>

%Paquete requerido
\RequirePackage{tikz}
\RequirePackage{graphicx}
\RequirePackage{amssymb}
\RequirePackage{xcolor}
\RequirePackage{lastpage}
\RequirePackage{setspace}
\RequirePackage{scalefnt}

\RequirePackage[absolute, overlay]{textpos}
\definecolor{rojotexto}{HTML}{A21916}
\definecolor{gristexto}{HTML}{B2B2B2}
\definecolor{amarilloccm}{HTML}{FDC600}
\definecolor{mostazaccm}{HTML}{C99C00}
\definecolor{azulccm}{HTML}{003062}


\mode<presentation>


\setbeamercolor*{title page header}{fg=mostazaccm}
\setbeamercolor*{author}{fg=white}
\setbeamercolor*{date}{fg=white}
\setbeamercolor*{institute}{fg=white}
\setbeamercolor*{sectiontitle}{fg=white}
\setbeamercolor*{frametitle}{fg=mostazaccm}
\setbeamercolor*{framesubtitle}{fg=amarilloccm}
\setbeamercolor*{section in head/foot}{fg=white}
\setbeamercolor*{author in head/foot}{fg=white}
\setbeamercolor*{date in head/foot}{fg=white}

\setbeamercolor*{item}{fg=azulccm}

\setbeamercolor{block title}{use=structure,fg=white,bg=gristexto}
\setbeamercolor{block body}{fg=black,bg=gristexto!35}

\mode<all>



\mode<presentation>


\defbeamertemplate*{title page}{CCM3}[1][]
{
    \begin{textblock}{4}(7,1)
  \end{textblock}

    \vspace*{3.2cm}
  
  
    \begin{beamercolorbox}[center,wd=\paperwidth,sep=1pt]{title page header}
      \usebeamerfont{title}{\setstretch{1.1} \scalefont{1.5} \inserttitle}\par%
    \end{beamercolorbox}
    
    \vspace*{0.01cm}
    
    \begin{beamercolorbox}[center,wd=\paperwidth]{date}
    \usebeamerfont{date}\insertdate%
    \end{beamercolorbox}
  
  
  \vspace*{\fill}
   \vspace*{1cm}
  \begin{beamercolorbox}[center,wd=\the\paperwidth]{author}
    {\usebeamerfont{author} \insertauthor}%
  \end{beamercolorbox}
  
  \begin{beamercolorbox}[center,wd=\the\paperwidth]{institute}
    {\usebeamerfont{institute}\insertinstitute}
  \end{beamercolorbox}
}

\setbeamertemplate{title page}[CCM3]
%A definir la apareciencia de listas y tabla de contenidos
\setbeamertemplate{items}[circle]
\setbeamercolor{section in toc}{fg=black}
\setbeamertemplate{section in toc}{{\Huge \color{mostazaccm} \oldstylenums{\inserttocsectionnumber}.}~\inserttocsection}
\setbeamercolor{subsection in toc}{fg=gray}
\setbeamertemplate{subsection in toc}{\hspace{1.45em}{\color{gray}\rule[0.3ex]{3pt}{3pt}}~\inserttocsubsection\par}

\mode<all>



\mode<presentation>

\setbeamerfont{sectiontitle}{size=\huge, shape=\scshape}

\defbeamertemplate*{frametitle}{ccm3}[1][]
{
  \begin{beamercolorbox}[wd=\the\paperwidth,ht=1.9cm]{frametitle}
    \begin{tikzpicture}
    \useasboundingbox (0,0) rectangle(\the\paperwidth,1.4);
    
      \ifx\insertframesubtitle\@empty%
       {\node[anchor=west, mostazaccm , font=\huge] at (0.85,0.82){\textbf{\insertframetitle}};}
       \else%
       {\node[anchor=west, mostazaccm, font=\huge] at (0.85, 1.02){ \textbf{\insertframetitle}};%
       \node[anchor=west, mostazaccm , font=\large] at (0.85, 0.53){\insertframesubtitle};}%
       \fi
     \end{tikzpicture}
   \end{beamercolorbox}
   \vskip-0.5cm
}


\defbeamertemplate*{sidebar left}{sidebar theme}
{
\ifnum\thepage>2

\vspace*{\fill}
\hspace{-0.25\paperwidth}\colorbox{azulccm}{\makebox[1.5\paperwidth][c]{\scriptsize \textcolor{white}{\begin{tabular}{
  p{\dimexpr.5\paperwidth-2\tabcolsep-1.3333\arrayrulewidth}% column 1
  |p{\dimexpr.25\paperwidth-2\tabcolsep-1.3333\arrayrulewidth}% column 2
  |p{\dimexpr.25\paperwidth-2\tabcolsep-1.3333\arrayrulewidth}|% column 3
  }
     \insertauthor & \centering \insertsection  & \raggedleft \insertframenumber\,/\,\inserttotalframenumber
\end{tabular}}}}

\fi
}

\mode<all>


\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{blocks}[rounded][shadow=true]

\mode<all>


\begin{document}


\section{ Hello?} 

\begin{frame}
    Is someone here?

\end{frame}


\end{document}

在此处输入图片描述

(我给图像添加了灰色背景,否则白色字体将不可见)

相关内容