Quick Start

Once you have installed fduthesis locally or duplicated the Overleaf project, you are ready to set up your document.

A thesis is typically a large project. While you can write everything in a single file, we highly recommend setting up a modular directory structure from the start.

my-thesis/
├── main.tex           # The root document
├── refs.bib           # Your bibliography database
├── .latexmkrc         # Compilation configuration (optional)
├── chapters/          # Folder for individual chapters
│   ├── 01-intro.tex
│   └── 02-methods.tex
└── figures/           # Folder for images and charts
    └── fudan-logo.png

Minimal Chinese Template

Create a main.tex file and paste the following code. This example demonstrates a standard setup for a Chinese-language Doctoral thesis.

% !TeX program  = XeLaTeX
% !TeX encoding = UTF-8
\documentclass[type=doctor]{fduthesis}

% --------------------------------------------------------
% 1. Metadata Configuration
% --------------------------------------------------------
\fdusetup{
  info = {
    title = {基于 LaTeX3 的复旦大学\\学位论文模板设计}, % Use \\ for manual line breaks if needed
    title* = {Design of Fudan University Thesis Template\\Based on LaTeX3},
    author = {王二},
    author* = {Wang Er},
    supervisor = {张三\quad 教授},
    major = {物理学},
    department = {物理学系},
    student-id = {12300000000},
    keywords = {复旦大学, 学位论文, LaTeX模板, 排版},
    keywords* = {Fudan University, Thesis, LaTeX Template, Typesetting},
    clc = {O413.1} % Chinese Library Classification
  }
}

% Add bibliography file
\addbibresource{refs.bib}

\begin{document}

% --------------------------------------------------------
% 2. Front Matter (Abstracts, TOC)
% --------------------------------------------------------
\frontmatter
\tableofcontents

\begin{abstract}
  这是中文摘要。摘要应当简明扼要地概括论文的主要工作。
\end{abstract}

\begin{abstract*}
  This is the English abstract. It should accurately translate the Chinese abstract.
\end{abstract*}

% --------------------------------------------------------
% 3. Main Matter (Chapters)
% --------------------------------------------------------
\mainmatter

\chapter{引言}
你好,复旦!欢迎使用 \verb|fduthesis| 模板。

你可以直接在这里写作,或者使用 \verb|\include{chapters/01-intro}| 将章节分离到不同文件中。

% --------------------------------------------------------
% 4. Back Matter (Bibliography, Acknowledgements)
% --------------------------------------------------------
\backmatter
\printbibliography

\begin{acknowledgements}
  感谢复旦大学,感谢所有开源贡献者。
\end{acknowledgements}

\end{document}

Minimal English Template

If your thesis must be written entirely in English, change the document class to fduthesis-en. The English class adjusts the auto-generated covers, table of contents headers, and chapter styles to meet English typographic norms.

% !TeX program  = XeLaTeX
% !TeX encoding = UTF-8
\documentclass[type=doctor]{fduthesis-en}

\fdusetup{
  info = {
    title* = {Design of Fudan University Thesis Template Based on LaTeX3},
    author* = {Your Name},
    supervisor = {Prof. Someone},
    major = {Physics},
    department = {Department of Physics},
    student-id = {12300000000},
    keywords* = {Fudan University, Thesis, LaTeX Template, Typesetting},
    clc = {O413.1}
  }
}

\begin{document}

\frontmatter
\tableofcontents

% Note: In fduthesis-en, there is no abstract* environment.
\begin{abstract}
  This is the English abstract. Since the document is entirely in English, a Chinese abstract is typically not required unless specified by your department.
\end{abstract}

\mainmatter
\chapter{Introduction}
Hello, Fudan!

\backmatter
% \printbibliography

\end{document}

Compilation Workflow

LaTeX requires multiple compilation passes to resolve cross-references, generate the Table of Contents, and process the bibliography.

latexmk is an automated build tool that intelligently runs the necessary engines (XeLaTeX, Biber, MakeIndex) the exact number of times required to produce a final PDF.

Run this in your terminal:

latexmk -xelatex main.tex

Pro-Tip: Create a .latexmkrc file in your root directory to save typing:

$pdf_mode = 5; # 5 means use xelatex
$bibtex_use = 2; # run biber/bibtex automatically
$interaction = "nonstopmode";
With this file, you simply type latexmk in your terminal.

Method 2: Manual Compilation

If you prefer to compile manually, or if you are configuring a custom build script, you must run the tools in the following sequence:

# 1. First pass: generates auxiliary files (.aux, .bcf)
xelatex main.tex

# 2. Bibliography processing (assuming biblatex/biber backend)
biber main   

# 3. Second pass: includes bibliography and resolves most references
xelatex main.tex

# 4. Third pass: resolves any final pagination shifts (TOC alignment)
xelatex main.tex

IDE Integration

If you use VS Code with the LaTeX Workshop extension, the default latexmk recipe will compile fduthesis perfectly out of the box. Just hit Ctrl+Alt+V (or Cmd+Option+V on Mac) to view your PDF.