如何使用 overleaf 将此标题页置于水平中心?

如何使用 overleaf 将此标题页置于水平中心?
\begin{titlepage}
\begin{center}
   \vspace*{1cm}

   \textbf{Thesis Title}

   \vspace{0.5cm}
    Thesis Subtitle
        
   \vspace{1.5cm}

   \textbf{Author Name}

   \vfill
        
   A thesis presented for the degree of\\
   Doctor of Philosophy
        
   \vspace{0.8cm}
 
   \includegraphics[width=0.4\textwidth]{university}
        
   Department Name\\
   University Name\\
   Country\\
   Date
        
   \end{center}
\end{titlepage}

答案1

一种方法是重新定义\maketitle命令,如以下代码所示:

\documentclass{book}

\usepackage{graphicx}

\renewcommand{\maketitle}{
\begin{titlepage}
\begin{center}
   \vspace*{1cm}

   \textbf{Thesis Title}

   \vspace{0.5cm}
    Thesis Subtitle
        
   \vspace{1.5cm}

   \textbf{Author Name}

   \vfill
        
   A thesis presented for the degree of\\
   Doctor of Philosophy
        
   \vspace{0.8cm}
 
   \includegraphics[width=0.4\textwidth]{example-image}
        
   Department Name\\
   University Name\\
   Country\\
   Date
\end{center}
\end{titlepage}
}

\begin{document}
\maketitle

\end{document}

相关内容