LaTeX Beamer 模板:为什么标题和副标题/作者信息不一致?

LaTeX Beamer 模板:为什么标题和副标题/作者信息不一致?

我对创建自己的 Beamer 模板还比较陌生,因此我的标题页看起来乱糟糟的,主要是因为副标题和标题没有左对齐,而它们应该是左对齐的。同样,我的行距也太近了,可能是因为我添加了标题页图片?

这是代码和我的结果(如附图所示)。

我知道这不是针对主题的完整 MWE,而是针对幻灯片/问题的完整 MWE。

有问题的标题页


\defbeamertemplate*{title page}{mytheme}{%
  % list trick from http://www.tex.ac.uk/cgi-bin/texfaq2html?label=chngmargonfly
  \begin{list}{}{
  \setlength{\listparindent}{\parindent}%
  \setlength{\itemindent}{\parindent}%
  \setlength{\parsep}{\parskip}%
  \setlength{\leftmargin}{0pt}%
  \setlength{\rightmargin}{0pt}}
  \item[]
  \vspace*{\stretch{2}}
  {\usebeamerfont*{title}\color{adefinedcolor}\inserttitle\par} % no idea why usebeamercolor{title} does not work here

    \end{list}



\begin{columns}[T]

                \begin{column}{.7\textwidth}
                  \begin{block}
                      
         {\usebeamerfont*{subtitle}\insertsubtitle\par}           
       \vspace{\stretch{2}}
       \setlength{\leftmargin}{50pt}%
    {\usebeamerfont{author}\insertauthor\par}
    {\usebeamerfont{institute}\insertinstitute\par}
    {\usebeamerfont{date}\insertdate\par}
\end{block}
                \end{column}
                            \begin{column}{.3\textwidth}
                     \begin{beamercolorbox}[sep=1pt,right]{mycolour}
        {\inserttitlegraphic}  
    \end{beamercolorbox}
                \end{column}
            \end{columns}
}
\documentclass[aspectratio=169,10pt]{beamer}

\setbeamertemplate{footline}{\hspace*{6mm}   \hfill \color{black!85}  \insertframenumber \hspace*{6mm}\vspace*{3pt}}




\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage[backend=biber,citestyle=authoryear,bibstyle=authoryear,natbib=true, url =false,isbn=false ]{biblatex}
\addbibresource{pap-edge.bib}

\setbeamertemplate{bibliography item}{}
\usepackage{xcolor}

\definecolor{orangeish}{RGB}{227,133,91}

\renewcommand*{\bibfont}{\scriptsize}



\usepackage{comment}


\usetheme{mytheme}
\title{My really long title that goes on and on and on for serveral lines because it is such a long title that cannot be shortened please don't ask why} 
\subtitle{very short subtitle}
\author{Author A, Author B, Long-named Autor C}
%\institute{Naah don't need}
\date{\today}


\titlegraphic{\includegraphics[width=.7\textwidth]{titleimage.png}}
\begin{document}

\newenvironment{nonumberframe}{%
    \setbeamertemplate{footline}{}
    \begin{frame}[c,noframenumbering] %Remove the noframenumbering option if you want the counter to be increased on a frame that is not numbered.
    }{%
    \end{frame}
    \setbeamertemplate{footline}{\hfill \color{black!85}\insertframenumber \hspace*{6mm}\vspace*{3pt}}
}



\begin{frame}
\maketitle
\end{frame}


\endocument

答案1

  • 列具有不同的边距。您可以使用与周围文本相同的边距,方法是使用onlytextwidth选项

  • 使用列表作为标题看起来非常复杂

  • \usebeamercolor{title}您可以使用\usebeamercolor[fg]{title}标题的前景色

  • 您不需要加载xcolor,或者graphicx,beamer 已经为您加载了


\documentclass[aspectratio=169,10pt]{beamer}

\setbeamertemplate{footline}{\hspace*{6mm}   \hfill \color{black!85}  \insertframenumber \hspace*{6mm}\vspace*{3pt}}




%\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage[backend=biber,citestyle=authoryear,bibstyle=authoryear,natbib=true, url =false,isbn=false ]{biblatex}
\addbibresource{pap-edge.bib}

\setbeamertemplate{bibliography item}{}
%\usepackage{xcolor}

\definecolor{orangeish}{RGB}{227,133,91}

\renewcommand*{\bibfont}{\scriptsize}



\usepackage{comment}
\makeatletter

\defbeamertemplate*{title page}{mytheme}{%
  \vspace*{\stretch{2}}
  {\usebeamerfont*{title}\usebeamercolor[fg]{title}\inserttitle\par} 


\begin{columns}[T,onlytextwidth]

                \begin{column}{.7\textwidth}
                  \begin{block}{}
                      
         {\usebeamerfont*{subtitle}\insertsubtitle\par}           
       \vspace{\stretch{2}}
       \setlength{\leftmargin}{50pt}%
    {\usebeamerfont{author}\insertauthor\par}
    {\usebeamerfont{institute}\insertinstitute\par}
    {\usebeamerfont{date}\insertdate\par}
\end{block}
                \end{column}
                            \begin{column}{.3\textwidth}
                     \begin{beamercolorbox}[sep=1pt,right]{mycolour}
        {\inserttitlegraphic}  
    \end{beamercolorbox}
                \end{column}
            \end{columns}
}

\makeatother

\title{My really long title that goes on and on and on for serveral lines because it is such a long title that cannot be shortened please don't ask why} 
\subtitle{very short subtitle}
\author{Author A, Author B, Long-named Autor C}
%\institute{Naah don't need}
\date{\today}


\titlegraphic{\includegraphics[width=.7\textwidth]{example-image-duck}}
\begin{document}

\newenvironment{nonumberframe}{%
    \setbeamertemplate{footline}{}
    \begin{frame}[c,noframenumbering] %Remove the noframenumbering option if you want the counter to be increased on a frame that is not numbered.
    }{%
    \end{frame}
    \setbeamertemplate{footline}{\hfill \color{black!85}\insertframenumber \hspace*{6mm}\vspace*{3pt}}
}



\begin{frame}
\maketitle
\end{frame}


\end{document}

在此处输入图片描述

相关内容