\chapter*{Instructions for Ph.D. Thesis Preparation Using \LaTeX\ Template}
\thispagestyle{plainroman} % Roman numeral page style for front matter

This document provides guidelines to help Ph.D. scholars use the Karunya Institute of Technology and Sciences \LaTeX\ template for thesis preparation. Follow these steps carefully to maintain formatting consistency and produce a thesis that is both professionally formatted and academically sound.

\section*{1. Setting Up \LaTeX\ (Online and Offline)}

\subsection*{Option A: Online}
% Overleaf requires no installation. Perfect if you don't want setup headaches.
Use \href{https://www.overleaf.com/}{\textbf{Overleaf}} - a free, browser-based \LaTeX\ editor that lets you work from any device. All you need is a browser and internet access.

\subsection*{Option B: Offline}
% This option is for local installs – useful if internet is unreliable.
\textbf{Step 1: Install a \LaTeX\ Distribution}

Manual installation steps are available at:
\href{https://www.latex-project.org/get/}{\textbf{The \LaTeX\ Project}}

Alternatively, based on your OS:
\begin{itemize}
	\item \textbf{Windows:} Install \textbf{MiKTeX} from \href{https://miktex.org}{https://miktex.org} (a safe bet for Windows users).
	\item \textbf{Linux/Mac:} Install \textbf{TeX Live} via your package manager or from \href{https://tug.org/texlive}{https://tug.org/texlive}
\end{itemize}

\textbf{Step 2: Install a \LaTeX\ Editor}
% Editors make your life easier. Choose based on preference. Choose your weapon:
\begin{itemize}
	\item \href{https://www.texstudio.org/}{\textbf{TeXstudio}} - Recommended. Clean interface.
	\item \href{https://www.xm1math.net/texmaker/}{\textbf{TeXmaker}} - Lightweight and functional.
	\item \href{https://code.visualstudio.com/}{\textbf{VS Code} + \href{https://github.com/James-Yu/LaTeX-Workshop/wiki}{\textbf{LaTeX Workshop}}} - For those already living in VS Code.
\end{itemize}

Ensure that the \texttt{biber} backend is installed, as it manages the bibliography compilation.

\textbf{Compilation Sequence (When in Doubt, Compile Again):}
\begin{verbatim}
	pdflatex -> biber -> pdflatex -> pdflatex
\end{verbatim}
% Rule of thumb: compile until the errors stop.

\section*{2. Folder Structure}

\texttt{main.tex} is the primary compilation file. The folders look like this:

\begin{itemize}
	\item \texttt{main.tex} -- The main file to compile
	\item \texttt{karunya-thesis.cls} -- The formatting logic is defined in this file. Scholars are advised not to modify the class file unless specifically instructed.
	\item \texttt{TeX\_files/} -- Chapters and components
	\begin{itemize}
		\item \texttt{Front\_Matter/} -- title page, abstract, etc.
		\item \texttt{Chapter\_01/}, \texttt{Chapter\_02/} -- your content goes here
		\item \texttt{Back\_Matter/} -- appendix, references, publications, CV
	\end{itemize}
\end{itemize}

\section*{3. Compiling the Document (The Right Way)}

To ensure proper bibliography generation:

\begin{enumerate}
	\item \texttt{pdflatex main}
	\item \texttt{biber main}
	\item \texttt{pdflatex main} \textbf{two additional times} to ensure all references are updated.
\end{enumerate}

\section*{4. Reference Style (Mandatory)}

As per University guidelines, the prescribed reference style for all Ph.D. theses at Karunya Institute of Technology and Sciences is:

\begin{itemize}
	\item \texttt{apa} -- American Psychological Association (APA) Style
\end{itemize}

The template is pre-configured accordingly in \texttt{main.tex}:

\begin{verbatim}
	\newcommand{\referencestyle}{apa}
\end{verbatim}

\textbf{Important:} 
Do not modify or change the reference style command. All Ph.D. scholars, irrespective of division or discipline, must follow APA style unless otherwise specifically instructed by the University.

\section*{5. Citing References}

Add BibTeX entries to \texttt{references.bib}.
\begin{itemize}
	\item Use \texttt{\textbackslash textcite\{key\}} when author name appears in the sentence.
	\item Use \texttt{\textbackslash parencite\{key\}} for citations in parentheses.
\end{itemize}

Generate your bibliography using \texttt{\textbackslash printbibliography} (already in the template).

% --------------------------------------------------
% SECTION 6: Chapters
% --------------------------------------------------
\section*{6. Adding Chapters}

Each chapter lives in its own file. Add them in \texttt{main.tex} like:
\begin{verbatim}
	\include{./TeX_files/Chapter_03/chapter03}
\end{verbatim}

\section*{7. Figures and Tables}

\noindent\textbf{Folder Tip:} Place figures for each chapter in its own folder (e.g., \texttt{Chapter\_01/}) to maintain proper organization and avoid file misplacement.

\noindent\textbf{Formats:} Use high-quality \texttt{.pdf}, \texttt{.png}, or \texttt{.eps} formats (minimum 300~dpi resolution recommended for raster images).

\noindent\textbf{Font Consistency:} All text within figures (axis labels, legends, annotations, and embedded text) must be in \textbf{Times New Roman}, consistent with the thesis body font. Ensure fonts are properly embedded in exported PDF figures.

\noindent\textbf{Captions:} Provide a concise caption for the List of Figures entry and a descriptive caption below the figure explaining the content clearly.


% Sample code for captioning
\begin{verbatim}
	\caption[Short for LoF]{Longer caption goes here.}
\end{verbatim}

\vspace{2mm}
\noindent\textbf{Figure Template:}
% Example figure
\begin{verbatim}
	\begin{figure}[H]
		\centering
		\includegraphics[width=0.8\textwidth]{image.pdf}
		\caption[Short Caption]{Long Caption.}
		\label{fig:sample}
	\end{figure}
\end{verbatim}

\clearpage
%\vspace{2mm}
\noindent\textbf{Table Template:}
% Example table
\begin{verbatim}
	\begin{table}[H]
		\centering
		\begin{tabular}{|c|c|c|}
			\hline A & B & C \\ \hline
			1 & 2 & 3 \\ \hline
		\end{tabular}
		\caption{This table has all the numbers you need.}
		\label{tab:sample}
	\end{table}
\end{verbatim}

\vspace{2mm}
% Referencing
\noindent To reference a figure or table in your text, use the label you assigned:
\begin{itemize}
	\item For figures: \verb|Figure~\ref{fig:sample}| will render as ``Figure 1.1''
	\item For tables: \verb|Table~\ref{tab:sample}| will render as ``Table 1.1''
\end{itemize}

\noindent Let \LaTeX{} handle the numbering for you. Never hardcode figure or table numbers.

\vspace{2mm}

\noindent\textbf{Important:}
Do \textbf{NOT} insert equations or tables as image files -- always use proper \LaTeX\ environments such as \texttt{equation}, \texttt{align}, \texttt{tabular}, or \texttt{longtable}.
Name your image files meaningfully (e.g., \texttt{fig\_ch1\_methodology.pdf}, \texttt{fig\_ch3\_output.png}) and store them chapter-wise for your own sanity during revisions.

\section*{8. Equations}

Equations are numbered like 2.3 (Chapter 2, Equation 3). 

Example:
\begin{verbatim}
	\begin{equation}
		E = mc^2
		\label{eq:einstein}
	\end{equation}
\end{verbatim}

Reference it using \texttt{\textbackslash ref\{eq:einstein\}}.

\section*{9. Smart Referencing with \texttt{autoref}}

\LaTeX\ automatically handles numbering for figures, tables, equations, sections, etc. While the classic \texttt{\textbackslash ref\{\}} command works fine, you can improve clarity by using \texttt{\textbackslash autoref\{\}} provided by the \texttt{hyperref} package.

The \texttt{autoref} command automatically includes the type (Figure, Table, Equation, Section, etc.) before the number, and formats it consistently.

\textbf{Examples:}
\begin{itemize}
	\item \texttt{\textbackslash autoref\{fig:sample\}} $\rightarrow$ Figure 1.1
	\item \texttt{\textbackslash autoref\{tab:results\}} $\rightarrow$ Table 2.3
	\item \texttt{\textbackslash autoref\{eq:nonlinear\}} $\rightarrow$ Equation 3.5
	\item \texttt{\textbackslash autoref\{sec:literature\}} $\rightarrow$ Section 1.2
\end{itemize}

There's no need to manually write ``Figure~\textbackslash ref\{\}'' anymore. Just use \texttt{\textbackslash autoref\{\}} and let \LaTeX\ take care of the formatting.

\textbf{Note:} \texttt{autoref} works out of the box with this template because the \texttt{hyperref} package is already included.

\section*{10. Back Matter}

Located in \texttt{TeX\_files/Back\_Matter/}. Already included in \texttt{main.tex}.

Use appropriate headings:
\begin{verbatim}
	\chapter{Appendix A: Supporting Derivations}
	\chapter{List of Publications}
	\chapter{Curriculum Vitae}
\end{verbatim}

\clearpage

\section*{11. Formatting Reminders}

\begin{itemize}
	\item 1.5 line spacing is built-in
	\item Times New Roman is enforced
	\item Use \texttt{\textbackslash MakeUppercase\{\}} for all-caps
	\item Add unnumbered sections to ToC manually:
	\begin{verbatim}
		\addcontentsline{toc}{chapter}{Acknowledgement}
	\end{verbatim}
\end{itemize}

\section*{12. Need Help?}

Seek guidance from your supervisor, \href{https://www.google.com/}{Google} it, post on \href{https://tex.stackexchange.com}{TeX StackExchange}, or just ask \href{https://chatgpt.com/}{ChatGPT}.