Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ pdfbuild/
*.lof
*.toc
*.zip
*.xdv
188 changes: 155 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,63 +1,185 @@
# A LaTeX Template for PhD/Master Thesis of the National University of Singapore (NUS)
# NUS MSc. PHM Capstone Report LaTeX Template

> Although I have already left NUS, I'm still actively maintaining this thesis template. As the formatting guidelines may change from time to time, I endeavor to adapt this template to the latest guidelines, which (unfortunately) can only be accessed by NUS students and staff. Therefore, if you find that this template deviates from the latest guidelines, please [create an issue](https://github.com/streamjoin/nusthesis/issues) by attaching the guidelines and I will take the time to address it. Thanks for your support along the way!
A comprehensive LaTeX template for the **Master of Science in Precision Health and Medicine (MSc. PHM)** capstone reports at the **National University of Singapore (NUS)**.

This set of latex code (mainly the [`nusthesis.cls`](nusthesis.cls)) composes a template of NUS thesis, which is compliant with the [university's requirement](https://www.dropbox.com/s/o6jtrk9y7cil70w/General-Guidelines-and-Instructions-on-Format-of-Research-Thesis-and-Electronic-Submission.pdf "General Guidelines and Instructions on Format of Research Thesis and Electronic Submission").
Using this template to organize your thesis content can save a lot of effort spent in formatting.
## ✨ Features

Apart from formatting, the example .tex files also include a lot of latex tricks extracted from my years' experience of using latex.
These tricks are mainly described and demonstrated in the `chapters/ch-Intro.tex` file.
- **Compliant formatting** with NUS thesis requirements
- **MSc. PHM specific modifications** including:
- Customized cover page for capstone reports
- Declaration of AI usage (required for modern academic integrity)
- Research attachment period specification
- Academic/Industrial report type selection
- **Professional styling** with proper typography and spacing
- **Comprehensive examples** including figures, tables, algorithms, and citations
- **Automated compilation** with build scripts
- **Cross-platform support** (Linux, macOS, Windows)

You may refer to [this](https://www.dropbox.com/s/rar6yxn9u6n19dp/ChickenR.pdf) to preview a sample thesis generated using this template. In addition, the template is also available on [Overleaf](https://www.overleaf.com/latex/templates/thesis-template-of-the-national-university-of-singapore-nus/gkvbbgybrjnw) (but it may not be timely synchronized with updates maintained in this repository).
## 🚀 Quick Start

## Compilation
1. **Clone this repository**
```bash
git clone https://github.com/arnold117/nus_phm_thesis.git
cd nus_phm_thesis
```

Run the `build.sh` script to compile in Linux, macOS or emulated Unix-like environment for Windows (e.g., [Cygwin](https://www.cygwin.com/) and [MinGW](http://www.mingw.org/ "Minimalist GNU for Windows")). ~~For compilation in the native Windows, run the `build.bat` script.~~ The produced .pdf file locates in the same folder.
2. **Edit the main content**
- Modify [`main.tex`](main.tex) with your thesis details
- Add your chapters in the [`chapters/`](chapters/) folder
- Place figures in [`pic/`](pic/) and experimental plots in [`exp/`](exp/)

You may customize the name of the output .pdf file by configuring `PDF_NAME` in the above scripts. Alternatively, you could specify the filename with the `--pdf-name` option (or `-o` for short). For example,
3. **Compile your thesis**
```bash
./build.sh
```

```sh
$ ./build.sh --pdf-name MyThesis
## 📁 Project Structure

```
├── main.tex # Main document entry point
├── nusthesis.cls # NUS thesis document class
├── _global_settings.tex # Global packages and configurations
├── references.bib # Bibliography database
├── build.sh # Compilation script
├── chapters/ # Individual chapter files
│ ├── abstract.tex
│ ├── acknowledgments.tex
│ ├── ch-intro.tex
│ ├── ch-review.tex
│ └── ...
├── pic/ # Figures and images
├── exp/ # Experimental plots and data
└── fairy-lite/ # LaTeX compilation utilities
```

This will produce `MyThesis.pdf` as output.
## 🔧 Compilation

ps: Since [Windows 10 already provides built-in Linux Bash Shell](https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/), the original crappy `build.bat` script has been deprecated. Nevertheless, you are still welcomed to provide a robust one via [pull request](https://github.com/streamjoin/nusthesis/pulls) if you believed that's really necessary.
### Automated Build (Recommended)

### Manual Compilation
```bash
# Default compilation
./build.sh

In case you prefer to compile the code manually, please run *exactly* the following commands at the project root (i.e., where the `main.tex` locates at the same directory level).
# Custom output filename
./build.sh --pdf-name "MyCapstoneReport"

```sh
$ pdflatex main.tex
$ biber main
$ pdflatex main.tex
$ pdflatex main.tex
# Clean build files
./build.sh --clean
```

Note that the parameter to `biber` is the filename *without extension*. Moreover, you must run the second `pdflatex` to generate bibliography and resolve citations, and the third `pdflatex` to generate the bibliography entry in the table of contents.
### Manual Compilation

### Dependencies
If you prefer manual control:

```bash
pdflatex main.tex
biber main
pdflatex main.tex
pdflatex main.tex
```

- LaTeX ([MiKTeX](https://miktex.org/) or [TeX Live](https://www.tug.org/texlive/))
- [biber](http://biblatex-biber.sourceforge.net/ "Biber: A BibTeX replacement for users of BibLaTeX")
**Note**: The bibliography compilation requires `biber` (not `bibtex`), and multiple LaTeX runs are necessary for proper cross-references and bibliography generation.

## Editing
## ✏️ Customization

Your edit should start with [`main.tex`](main.tex), which is also the compilation entry (as configured in [`build.sh`](build.sh)). Sources of individual chapters as well as abstract, acknowledgments, appendices, etc., are placed in the [`chapters`](chapters/) folder. Illustrative figures and analytical plotting should be stored in the [`pic`](pic/) and [`exp`](exp/) folders respectively.
### Essential Information

### Printing vs. Electronic
Edit the following in [`main.tex`](main.tex):

```latex
\title{Your Capstone Title}
\author{Your Name}
\nusid{A1234567X}
\supervisor{Your Supervisor Name \\ Department/Institution}
\startdate{Start Date}
\enddate{End Date}
\typeofReport{Academic} % or Industrial
\AIVersion{ChatGPT (OpenAI, GPT-4)} % Specify AI tools used
```

Uncomment the following line at the head of `main.tex` when you are producing the thesis for printing hard copies in a **double-sided** fashion.
### Print vs. Electronic Version

For **double-sided printing**, uncomment this line in [`main.tex`](main.tex):
```latex
\newcommand*{\DoubleSided}{}
```

And comment it out when you are producing the electronic thesis for the final submission.
For **electronic submission** (default), keep it commented out.

## 📖 Writing Guide

### Chapter Organization
- **Introduction**: [`chapters/ch-intro.tex`](chapters/ch-intro.tex) - Contains LaTeX tips and tricks
- **Literature Review**: [`chapters/ch-review.tex`](chapters/ch-review.tex)
- **Main Content**: Add your research chapters following the example structure
- **Conclusion**: [`chapters/ch-concl.tex`](chapters/ch-concl.tex)

### Figures and Tables
- Use `\SetPicSubDir{folder-name}` to organize figures by chapter
- Use `\Pic{extension}{filename}` for figures: `\includegraphics{\Pic{pdf}{my-figure}}`
- Use `\Exp{extension}{filename}` for experimental plots

### Citations and References
- Add references to [`references.bib`](references.bib)
- Use `\cite{key}` for citations and `\citet{key}` for author-year format
- Bibliography is automatically generated using IEEE style

## 🛠️ Dependencies

### Required Software
- **LaTeX Distribution**: [TeX Live](https://www.tug.org/texlive/) (recommended) or [MiKTeX](https://miktex.org/)
- **Bibliography Tool**: [biber](http://biblatex-biber.sourceforge.net/)
- **Build Environment**: Bash shell (built-in on Linux/macOS, WSL/Git Bash on Windows)

### LaTeX Packages
All required packages are automatically loaded. Key packages include:
- `biblatex` with IEEE style for references
- `algorithm2e` for pseudocode
- `hyperref` for cross-references and links
- `graphicx` for figures
- And many more (see [`_global_settings.tex`](_global_settings.tex))

## 🐳 Development Container (Optional)

For a consistent development environment:

```bash
# Using VS Code with Docker
code .
# Select "Reopen in Container" when prompted
```

The [`.devcontainer/`](.devcontainer/) setup provides a complete LaTeX environment with VS Code extensions.

## 📋 Examples Included

This template includes comprehensive examples:
- **Algorithm pseudocode** with proper formatting
- **Mathematical equations** and notation
- **Figure and table placement** with captions
- **Cross-referencing** system
- **Citation styles** for different source types
- **Appendices** structure

## 🤝 Contributing

Found an issue or have an improvement?
- [Create an issue](https://github.com/arnold117/nus_phm_thesis/issues)
- Submit a pull request
- [Contact the maintainer](mailto:yanuo.zhou@u.nus.edu)

## 📜 License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

### License Compatibility

This template is derived from the original [nusthesis template](https://github.com/streamjoin/nusthesis) by Qian Lin, which is also under MIT License. The MIT License ensures maximum compatibility and ease of use for academic and research purposes.

## 🙏 Acknowledgments

## Contact
Special thanks to [Qian Lin](https://github.com/streamjoin) for the original [nusthesis template](https://github.com/streamjoin/nusthesis). This template has been adapted and enhanced specifically for the MSc. PHM program requirements.

If you encounter any problem with this template, feel free to [contact me](http://linqian.me/) or [create an issue](https://github.com/streamjoin/nusthesis/issues) in this repository.
---

All the best for your graduation!
**Good luck with your capstone report! 🎓**
6 changes: 0 additions & 6 deletions _global_settings.tex
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
\ifdefined\DoubleSided
\documentclass[twoside,openright,a4paper]{nusthesis}
\else
\documentclass[a4paper]{nusthesis}
\fi

\dsp % pseudo double spacing

\usepackage[utf8]{inputenc}
Expand Down
4 changes: 2 additions & 2 deletions chapters/ap-publication.tex
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
\begin{refsection}
\nocite{%
\nocite{% This is a list of publications you published and want to include in your thesis
TR04:Arasu,
nsdi12:Zaharia,
tods92:Mohan,
Expand All @@ -16,7 +16,7 @@
\newrefcontext[sorting=none]
\printbibliography[
heading=bibintoc,
title={Publications during PhD Study},
title={Publications during Masters Study},
prenote=PubListPrenote,
postnote=PubListPostnote
]
Expand Down
Binary file added main.pdf
Binary file not shown.
41 changes: 28 additions & 13 deletions main.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,49 @@
%%% remove it for the final submission, i.e. electronic thesis
%\newcommand*{\DoubleSided}{}

\ifdefined\DoubleSided
\documentclass[twoside,openright,a4paper]{nusthesis}
\else
\documentclass[a4paper]{nusthesis}
\fi

\input{_global_settings.tex}

\begin{document}

% Cover Page
\title{We Are What We Eat: The Recipe of Success}

\author{CHICKEN Rice}
\nusid{A1234567B}
\prevdegrees{%
B.S., Culinary University}
\degree{Doctor of Philosophy}
\field{Cooking Science}
\degreeyear{2021}
\supervisor{Professor Hamburger STEAK}
\degree{MASTER OF SCIENCE}
\field{PRECISION HEALTH AND MEDICINE}

\degreeyear{2025}
\startdate{1 January 2025}
\enddate{1 October 2025}

\typeofReport{Academic} % Academic or Indusrial

% only involve the examiners in the final submission
\examiners{%
Associate Professor CHAR Kway Teow \\
Assistant Professor Yummy Bee Hoon CRAB \\
Professor BAK Kwa, Dessert University}
\supervisor{Professor Dr Hamburger STEAK \\
School of Beef and Cheese, University of Hamburger, Germany}

% % only involve the examiners in the final submission
% \examiners{%
% Associate Professor CHAR Kway Teow \\
% Assistant Professor Yummy Bee Hoon CRAB \\
% Professor BAK Kwa, Dessert University}
% Declaration page
\maketitle

\declaredate{1 March 2021}
\AIVersion{ChatGPT (OpenAI, GPT-4.5)}
\declaredate{1 October 2025}
\declaresign{\RootPicDir /signature.jpg} % remove this if you prefer to sign physically
\declarationpage

\begin{frontmatter}
\dedicate{To my delicious friends}
\dedicate{To my delicious friends} % optional
\input{chapters/acknowledgments.tex}
\tableofcontents
\input{chapters/abstract.tex}
Expand All @@ -44,7 +59,7 @@
\input{chapters/ch-concl.tex}

\bookmarksetup{startatroot}
\printbibliography[heading=bibintoc]
\printbibliography[title=Reference, heading=bibintoc]

\appendix
\input{chapters/ap-recipes.tex}
Expand Down
Loading