diff --git a/.gitignore b/.gitignore index 13ccb3b..5073c4f 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ pdfbuild/ *.lof *.toc *.zip +*.xdv diff --git a/README.md b/README.md index cb7a68d..231970b 100644 --- a/README.md +++ b/README.md @@ -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! 🎓** \ No newline at end of file diff --git a/_global_settings.tex b/_global_settings.tex index 2aaef14..9e7cd54 100644 --- a/_global_settings.tex +++ b/_global_settings.tex @@ -1,9 +1,3 @@ -\ifdefined\DoubleSided - \documentclass[twoside,openright,a4paper]{nusthesis} -\else - \documentclass[a4paper]{nusthesis} -\fi - \dsp % pseudo double spacing \usepackage[utf8]{inputenc} diff --git a/chapters/ap-publication.tex b/chapters/ap-publication.tex index 727862c..1fd67f7 100644 --- a/chapters/ap-publication.tex +++ b/chapters/ap-publication.tex @@ -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, @@ -16,7 +16,7 @@ \newrefcontext[sorting=none] \printbibliography[ heading=bibintoc, - title={Publications during PhD Study}, + title={Publications during Masters Study}, prenote=PubListPrenote, postnote=PubListPostnote ] diff --git a/main.pdf b/main.pdf new file mode 100644 index 0000000..a15ce84 Binary files /dev/null and b/main.pdf differ diff --git a/main.tex b/main.tex index debb5f3..b3cdf95 100644 --- a/main.tex +++ b/main.tex @@ -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} @@ -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} diff --git a/nusthesis.cls b/nusthesis.cls index 2cfa9e5..266062e 100644 --- a/nusthesis.cls +++ b/nusthesis.cls @@ -178,6 +178,9 @@ % These macros are used to declare arguments needed for the % construction of the front matter. +% NUSID of the author +\def\nusid#1{\gdef\@nusid{#1}} + % The year the degree will be officially conferred \def\degreeyear#1{\gdef\@degreeyear{#1}} @@ -195,6 +198,13 @@ % The names of your thesis examiners, one per line \def\examiners#1{\gdef\@examiners{#1}} +% Start Date and End Date of the research attachment +\def\startdate#1{\gdef\@startdate{#1}} +\def\enddate#1{\gdef\@enddate{#1}} + +% Capstone Type +\def\typeofReport#1{\gdef\@typeofReport{#1}} + % The name of your degree's field (e.g. Psychology, Computer Science) \def\field#1{\gdef\@field{#1}} @@ -204,6 +214,9 @@ % The declaration signature \def\declaresign#1{\gdef\@declaresign{#1}} +% The AI used in the report +\def\AIVersion#1{\gdef\@AIVersion{#1}} + % The alwayssingle environment ensures that front matter is always % single column even in a double-column document. @@ -246,20 +259,18 @@ \vspace{14pt minus 4pt} by \par \blocklt{\@author} + \ifdefined \@nusid + \par\vspace{-10pt}NUS ID: \@nusid + \fi\par \ifdefined \@prevdegrees \par\vspace{-10pt}\textit{(\@prevdegrees)} \fi\par - \vspace{28pt minus 8pt} - \blocklt{A thesis submitted for the degree of} \par - \blocklt{\@degree}\par - in \par - \blocklt{\@field}\par - in the \par - \blocklt{Graduate Division} \par - of the \par - \blocklt{National University of Singapore} \par - \vspace{28pt minus 8pt} - \blocklt{\@degreeyear} \par + + \vspace{14pt minus 4pt} + Research Attachment Period:\par + \blocklt{\@startdate} to \blocklt{\@enddate}\par + + \vspace{14pt minus 4pt} \ifdefined \@cosupervisor Supervisors: \par\vspace{-10pt} @@ -272,11 +283,26 @@ Supervisor: \par\vspace{-10pt} {\@supervisor} \fi\par - \ifdefined \@examiners - \vspace{5pt} - Examiners: \par\vspace{-10pt} - {\@examiners}\par - \fi + % \ifdefined \@examiners + % \vspace{5pt} + % Examiners: \par\vspace{-10pt} + % {\@examiners}\par + % \fi + + \vspace{28pt minus 8pt} + \blocklt{\@typeofReport\ Capstone Report submitted to the} \par + \blocklt{Department of Biochemistry} \par + of the \par + \blocklt{National University of Singapore} \par + + \vspace{28pt minus 8pt} + \blocklt{In Partial Fulfillment for the Degree of the} \par + \blocklt{\@degree}\par + in \par + \blocklt{\@field}\par + + \vspace{28pt minus 8pt} + \blocklt{\@degreeyear} \par \end{center} \vfill \hrule height 0pt @@ -298,12 +324,18 @@ {\Large \bfseries \declearname}\par \vspace{1in} {\large - I hereby declare that this thesis is my original work and it has\par + I hereby declare that this report is my original work and it has\par been written by me in its entirety. I have duly\par acknowledged all the sources of information which have\par - been used in the thesis.\par + been used in this report.\par + \vspace{1.5em} + I also acknowledge the use of \@AIVersion\par + {\color{red} for initial idea generation, language refinement, and\par + summarization.} All content has been critically reviewed\par + and supplemented with my own analysis to ensure\par + accuracy and originality.\par \vspace{1.5em} - This thesis has also not been submitted for any\par + This report has also not been submitted for any\par degree in any university previously.\par \ifdefined \@declaresign \vspace{1.2in}