%\part{Theoretical Background}\label{sec:theory}
%\begingroup
%\renewcommand{\cleardoublepage}{}%only necessary if the openright option is used. Otherwise only acting on \clearpage is sufficient, but keeping \cleardoublepage does no harm.
%\renewcommand{\clearpage}{}
%\chapter{}\label{sec:}
%\endgroup
%
\chapter{Referencing Equations}\label{sec:referencing_equations}
%
You can use a subequations environment to label equations of e.g. an ``align'' environment as 1a, 1b, 1c etc. Each line can have a label, in case you want to refer to ``eq. (1a)''. To refer to ``eq. (1)'', the label needs to be placed after the start of subequations (before the align environment). For short text passages in between subequations, use \mbox{\textbackslash intertext}.
\begin{lstlisting}
Example usage of subequation referencing. Example code is also intended for the parent-equation referencing which is described next:
\begin{subequations}\label{eqs:hamiltonian_QP_EFG}
	\begin{align}
		&\HamOpQP = \frac{e\QMoment}{I(2I-1)} \frac{1}{4} \left[3\hat{I}_\AxisTypeface{z}^2 - I(I+1)\right] V_\AxisTypeface{zz}\label{eq:hamiltonian_qp}
		\intertext{with}
		&V_\AxisTypeface{zz} = \frac{eq}{2}\left[3\cos[2](\theta) - 1 + \etaQ \sin[2](\theta) \cos(2\phi)\right]\label{eq:efg_lab} \eqend{.}
	\end{align}
\end{subequations}
Refer to a subequation by \cref{eq:hamiltonian_qp}, or to a number of specific subequations by \cref{eq:hamiltonian_qp,eq:efg_lab} without a whitespace after the comma separator of the labels
\end{lstlisting}
Example usage of subequation referencing. Example code is also intended for the parent-equation referencing which is described next:
\begin{subequations}\label{eqs:hamiltonian_QP_EFG}
\begin{align}
	&\HamOpQP = \frac{e\QMoment}{I(2I-1)} \frac{1}{4} \left[3\hat{I}_\AxisTypeface{z}^2 - I(I+1)\right] V_\AxisTypeface{zz}\label{eq:hamiltonian_qp}
	\intertext{with}
	&V_\AxisTypeface{zz} = \frac{eq}{2}\left[3\cos[2](\theta) - 1 + \etaQ \sin[2](\theta) \cos(2\phi)\right]\label{eq:efg_lab} \eqend{.}
\end{align}
\end{subequations}
Refer to a subequation by \cref{eq:hamiltonian_qp}, or to a number of specific subequations by \cref{eq:hamiltonian_qp,eq:efg_lab} without a whitespace after the comma separator of the labels.\\\\
%
%
You can suppress a (sub)equation number with the \mbox{``\textbackslash nonumber''} tag, i.e.
\begin{lstlisting}
	Example usage:
	\begin{align}
		\overline{\expval{\hat{O}}} &= \overline{\bra{\psi}\hat{O}\ket{\psi}}\nonumber\\
		&=\sum_{\psi}p_\psi\sum_{m,n}{c_{\psi,m}}^*c_{\psi,n}\bra{\psi_{I,m}}\hat{O}\ket{\psi_{I,n}}\eqend{,}
	\end{align}
\end{lstlisting}
Example usage:
\begin{align}\label{eq:nonumber_example}
	\overline{\expval{\hat{O}}} &= \overline{\bra{\psi}\hat{O}\ket{\psi}}\nonumber\\
	&=\sum_{\psi}p_\psi\sum_{m,n}{c_{\psi,m}}^*c_{\psi,n}\bra{\psi_{I,m}}\hat{O}\ket{\psi_{I,n}}\eqend{,}
\end{align}
%
I also set up the cleveref package (cf \cref{sec:cleveref_advanced}) such that I can use a custom command to refer to such a set as \eqpl{eqs:hamiltonian_QP_EFG}, i.e. with a plural ``s'' in the reference type (``eqs'') even though there is only one label in the reference command. I recommend to label sets of equations differently, i.e. \mbox{\textbackslash label\{eqs:hamiltonian\_QP\_EFG\}} rather than \mbox{\textbackslash label\{eq:hamiltonian\_QP\_EFG\}} (note ``eqs:\dots'' vs ``eq:\dots''), such that it will be apparent to you from the autocomplete suggestions that there are subequations. You can of course also use this label in a standard reference command \mbox{\textbackslash cref\{eqs:hamiltonian\_QP\_EFG\}}: \cref{eqs:hamiltonian_QP_EFG}.
%
\section{Repeating an Equation while Referring to the Original}
%
If you want to refresh the reader's memory of an equation which appeared a while ago or only use the result of something which is derived in detail in the appendix, you should not use a formally new equation. I think it is better to signal in the equation number that the original equation appears in a different context, which can be done with the \mbox{\textbackslash tag} command:
\begin{lstlisting}
Example usage:
\begin{equation*}\label{dummytag}
	\correlationfunctiondef{} \eqend{.} \tag{\cref{eq:autocorrelation} (repeated)}
\end{equation*}
Here is a reference to the appendix \cref{sec:appdx_relaxation-specdens-sto} and an equation that is repeated from there
\end{lstlisting}
Example usage:
\begin{equation*}\label{dummytag}
\correlationfunctiondef{} \eqend{.} \tag{\cref{eq:autocorrelation} (repeated)}
\end{equation*}
Here is a reference to an equation which is derived in the appendix: \cref{eqs:autocorrelation-specdens}.
%
\section{Equations with Cases}
%
\begin{lstlisting}
Example usage:
\begin{subequations}\label{eq:cases}\label{eqs:qcc_anisotropy}
	\begin{align}
		&\QCC \equiv \frac{eqe\QMoment}{h} \label{eq:qcc}
		\intertext{and}
		&\QCC \equiv \deltaQ \frac{4I(2I-1)}{3(2k-1)} \eqend{where }k=
		\begin{cases}
			1&\text{for $^2$H}\\%more general, m=1 for integer spin. Not sure about fully general validity though
			3/2&\text{for $^{17}$O}%more general, m=3/2 for half-integer spin. Not sure about fully general validity though
		\end{cases}\label{eq:anisotropy}\eqend{.}
	\end{align}
\end{subequations}
\end{lstlisting}
Example usage:
\begin{subequations}\label{eq:cases}\label{eqs:qcc_anisotropy}
	\begin{align}
		&\QCC \equiv \frac{eqe\QMoment}{h} \label{eq:qcc}
		\intertext{and}
		&\QCC \equiv \deltaQ \frac{4I(2I-1)}{3(2k-1)} \eqend{where }k=
		\begin{cases}
			1&\text{for $^2$H}\\%more general, m=1 for integer spin. Not sure about fully general validity though
			3/2&\text{for $^{17}$O}%more general, m=3/2 for half-integer spin. Not sure about fully general validity though
		\end{cases}\label{eq:anisotropy}\eqend{.}
	\end{align}
\end{subequations}
%
\section{Multiline Equation}
%
For long mathematical expressions you will need to have a linebreak somewhere. With the multiline environment, you can place the linebreak of an equation like \cref{eq:diff_two-step-decay} where it does not disrupt the mathematics too much, or maybe even helps compare expressions:
%
\begin{lstlisting}
	Example usage:
	\begin{multline}\label{eq:diff_two-step-decay}
		S(t_\mathrm{m}) = \left[ A_\mathrm{w} \exp(- \left(\gamma_\mathrm{^1H} G t_\mathrm{e}\right)^2 D_\mathrm{w} \left(\frac{2}{3}t_\mathrm{e} + t_\mathrm{m}\right)) +\right. \\%need to close/open \left\right pair on linebreak. use vphantom{highest expression} to match sizes
		\left. A_\mathrm{p} \exp(- \left(\gamma_\mathrm{^1H} G t_\mathrm{e}\right)^2 D_\mathrm{p} \left(\frac{2}{3}t_\mathrm{e} + t_\mathrm{m}\right)) \vphantom{\exp(\frac{2}{3})} \right]
		* \exp(-\left(\frac{2t_\mathrm{e} + t_\mathrm{m}}{\TOne}\right)^\beta) \eqend{.}
	\end{multline}
\end{lstlisting}
Example usage:
\begin{multline}\label{eq:diff_two-step-decay}
	S(t_\mathrm{m}) = \left[ A_\mathrm{w} \exp(- \left(\gamma_\mathrm{^1H} G t_\mathrm{e}\right)^2 D_\mathrm{w} \left(\frac{2}{3}t_\mathrm{e} + t_\mathrm{m}\right)) +\right. \\%need to close/open \left\right pair on linebreak. use vphantom{highest expression} to match sizes
	\left. A_\mathrm{p} \exp(- \left(\gamma_\mathrm{^1H} G t_\mathrm{e}\right)^2 D_\mathrm{p} \left(\frac{2}{3}t_\mathrm{e} + t_\mathrm{m}\right)) \vphantom{\exp(\frac{2}{3})} \right]
	* \exp(-\left(\frac{2t_\mathrm{e} + t_\mathrm{m}}{\TOne}\right)^\beta) \eqend{.}
\end{multline}
%
I suppose using multiline for this is cleaner than suppressing the equation number as in \cref{eq:nonumber_example}.
%
\chapter{Figures}
%
\section{Placement}
%
Have a simple figure, \cref{fig:energylevelszeeman-qp1}.\\
\begin{figure}
	\centering
	\includegraphics[width=\defaultfigurewidth]{Figures/EnergyLevels_Zeeman-QP1}
	\caption{Sketch of the shift in terms of angular frequency of initially degenerate energy levels of a spin $I=1$ nucleus due to Zeeman and quadrupolar interaction (first order, not to scale).}%vaguely based on \autocite[586]{Webb2006}
	\label{fig:energylevelszeeman-qp1}
\end{figure}%
%
To avoid wasting (horizontal) space with small figures, you can find two small figures and place them side by side. Alignment is easier if you surround the figures with a minipage, cf \cref{fig:binodal-spinodal-phase-diagram}.
%https://tex.stackexchange.com/questions/37581/latex-figures-side-by-side
\begin{lstlisting}
Example usage: \cref{fig:binodal-spinodal-phase-diagram}
\begin{figure}
	\centering
	\begin{minipage}[t]{0.4\textwidth}
		\centering
		\includegraphics[width=\linewidth]{Figures/FloryHugginsLattice_GeddeEtAl_Springer2019}
		\captionof{figure}{Distribution of a polymer and a low molecular mass solvent on a (2-dimensional) lattice as per the Flory-Huggins theory. Figure reproduced from \autocite{Gedde2019}.}
		\label{fig:floryhugginslattice}
	\end{minipage}\hfill%
	\begin{minipage}[t]{0.55\textwidth}
		\centering
		\includegraphics[width=\linewidth]{Figures/PhaseDiagram_LCST_Rubinstein_OxfordUnivPress2004}
		\captionof{figure}{Top: (Scaled) change in free energy due to mixing for a symmetric mixture. The minima are marked as $\phi^\prime$ and $\phi^{\prime\prime}$ and the inflection points as $\phi_\mathrm{sp1}$ and $\phi_\mathrm{sp2}$. Bottom: Phase diagram of the mixture. The thick dashed and solid lines represent the spinodal and binodal, respectively. From the top panel, values of the binodal (minima) and spinodal (inflection points) at a given value of $N\chi$ can be derived. Figure reproduced from \autocite{Rubinstein2004}.}
		\label{fig:binodal-spinodal-phase-diagram}
	\end{minipage}
\end{figure}
\end{lstlisting}
Example usage: \cref{fig:binodal-spinodal-phase-diagram}.\\
\begin{figure}
	\centering
	\begin{minipage}[t]{0.4\textwidth}
		\centering
		\includegraphics[width=\linewidth]{Figures/FloryHugginsLattice_GeddeEtAl_Springer2019}
		\captionof{figure}{Distribution of a polymer and a low molecular mass solvent on a (2-dimensional) lattice as per the Flory-Huggins theory. Figure reproduced from \autocite{Gedde2019}.}
		\label{fig:floryhugginslattice}
	\end{minipage}\hfill%
	\begin{minipage}[t]{0.55\textwidth}
		\centering
		\includegraphics[width=\linewidth]{Figures/PhaseDiagram_LCST_Rubinstein_OxfordUnivPress2004}
		\captionof{figure}{Top: (Scaled) change in free energy due to mixing for a symmetric mixture. The minima are marked as $\phi^\prime$ and $\phi^{\prime\prime}$ and the inflection points as $\phi_\mathrm{sp1}$ and $\phi_\mathrm{sp2}$. Bottom: Phase diagram of the mixture. The thick dashed and solid lines represent the spinodal and binodal, respectively. From the top panel, values of the binodal (minima) and spinodal (inflection points) at a given value of $N\chi$ can be derived. Figure reproduced from \autocite{Rubinstein2004}.}
		\label{fig:binodal-spinodal-phase-diagram}
	\end{minipage}
\end{figure}%
%
To give you another idea: mosaic plots offer some more advanced placement options for, e.g. a large panel on the left and two smaller panels on the right with the (combined) same height. I, however, ended up creating such a plot with python and -- as far as \LaTeX\space is concerned -- include it as a single image.\\
%
Alternatively, wrapping text around a figure could be desired. If so, see commented lines in the source code.\\
%wrapfig replaced by minipage with both (separate) figures of this section side by side
%\begin{wrapfigure}{O}{0.3\textwidth}%capitalized position O (outside edge of a twopage document) will allow some floating of the wrapfigure. Other Options are r, l, i or the capitalized versions thereof.
%	\captionsetup{style=wrapfigcapstyle, width=\wrapfigscaling}
%	\centering
%	\includegraphics[width=\wrapfigscaling]{Figures/FloryHugginsLattice_GeddeEtAl_Springer2019}%
%	\caption{Distribution of a polymer and a low molecular mass solvent on a (2-dimensional) lattice as per the Flory-Huggins theory. Figure reproduced from \autocite{Gedde2019}.}
%	\label{fig:floryhugginslattice}
%\end{wrapfigure}
%
\section{Subplot Labelling}
%
Here is a figure \cref{fig:pNIPAM-CN0E_MonoExp_Proof} with a faked second subfigure (width=0, \textbackslash phantomcaption, \textbackslash label) in order to simulate the desired subplot labelling. This is useful if the image you want to show already contains the labels in the panels and you don't want a caption to repeat it and/or use up space.\\
%
\begin{figure}
	\begin{subfigure}{\defaultfigurewidth}
		\centering
		\includegraphics[width=\linewidth]{Figures/pNIPAM-CN0E_MonoExp_Proof.png}
		\phantomcaption
		\label{fig:pNIPAM-CN0E_MonoExp_Proof_buildUp}
	\end{subfigure}%\hfil
	\begin{subfigure}{0\linewidth}
		\phantomcaption
		\label{fig:pNIPAM-CN0E_MonoExp_Proof_beta}
	\end{subfigure}
	\caption{Normalized build-up of $^2$H magnetization from inversion-recovery experiments at $\wL/(2\pi) \approx \SI{46}{\mega\hertz}$ for various temperatures, together with fits with a stretched exponential function \subref{fig:pNIPAM-CN0E_MonoExp_Proof_buildUp}. Resulting stretching parameters $\beta$ are shown in a narrow range in \subref{fig:pNIPAM-CN0E_MonoExp_Proof_beta}, the vertical line in \subref{fig:pNIPAM-CN0E_MonoExp_Proof_beta} at \SI{305}{\kelvin} marks the \Tdem for \pNIPAM in water \autocite{Costa2002, Bischofberger2014}.}
	\label{fig:pNIPAM-CN0E_MonoExp_Proof}
\end{figure}%
%
\begin{lstlisting}
\begin{figure}
	\begin{subfigure}{\defaultfigurewidth}
		\centering
		\includegraphics[width=\linewidth]{Figures/Complete_Figure.png}
		\phantomcaption
		\label{fig:label_for_first_subfigure}
	\end{subfigure}%\hfil
	\begin{subfigure}{0\linewidth}
		\phantomcaption
		\label{fig:label_for_second_subfigure}
	\end{subfigure}
	\caption{Caption for complete figure.}
	\label{fig:label_for_complete_figure}
\end{figure}
\end{lstlisting}
%
\section{Cropping}
%
Here are two multi-subfigure figures with special layout \cref{fig:pnipam-cn3e_uncertainties,fig:pnipam5a_oven40c}. Subfigure vertical alignment for different aspect ratios is cumbersome. You can either write many lines of code, or you can obtain the image heights the figure requests by looking at the log file of an initial compile run, where no fixed heights are set, and then manually set the heights of the subfigures (in combination with the keepaspectratio option) to an appropriate value (cf \url{https://tex.stackexchange.com/questions/389797/fill-textwidth-with-equal-height-subfigures-of-different-aspect-ratios}). You will need to have a look in the log file for this, but opening the log with a text editor of your choice and a simple keyword search for the filename will point you to the right place.
\begin{figure}
	\begin{subfigure}[t]{\defaulttwosubfigwidth}
		\centering
		\includegraphics[height=118.28448pt, keepaspectratio]{Figures/Uncertainties-CN3E_Abs_2H_FullX}
		\phantomcaption
		\label{sfig:pnipam-cn3e_uncertainties-2h_absfullx}
	\end{subfigure}\hfil
	\begin{subfigure}[t]{\defaulttwosubfigwidth}
		\centering
		\includegraphics[height=118.28448pt, keepaspectratio]{Figures/Uncertainties-CN3E_Abs_2H_ZoomX}
		\phantomcaption
		\label{sfig:pnipam-cn3e_uncertainties-2h_abszoomx}
	\end{subfigure}\\
	\begin{subfigure}[t]{\defaulttwosubfigwidth}
		\centering
		\includegraphics[height=118.28448pt, keepaspectratio]{Figures/Uncertainties-CN3E_Abs_17O_FullX}
		\phantomcaption
		\label{sfig:pnipam-cn3e_uncertainties-17o_absfullx}
	\end{subfigure}\hfil
	\begin{subfigure}[t]{\defaulttwosubfigwidth}
		\centering
		\includegraphics[height=118.28448pt, keepaspectratio]{Figures/Uncertainties-CN3E_Abs_17O_ZoomX}
		\phantomcaption
		\label{sfig:pnipam-cn3e_uncertainties-17o_abszoomx}
	\end{subfigure}
	\caption{$^2$H \subref{sfig:pnipam-cn3e_uncertainties-2h_absfullx}, \subref{sfig:pnipam-cn3e_uncertainties-2h_abszoomx} and $^{17}$O \subref{sfig:pnipam-cn3e_uncertainties-17o_absfullx}, \subref{sfig:pnipam-cn3e_uncertainties-17o_abszoomx} relaxation times of \pLinSample{30} from the original (Run 1) and a repeat (Run 2) series of measurements to test reproducibility. The scales on the ordinates of \subref{sfig:pnipam-cn3e_uncertainties-2h_absfullx} and \subref{sfig:pnipam-cn3e_uncertainties-17o_absfullx} capture the variation of the relaxation times across all of the investigated temperatures, while \subref{sfig:pnipam-cn3e_uncertainties-2h_abszoomx} and \subref{sfig:pnipam-cn3e_uncertainties-17o_abszoomx} provide magnified views on the region up to the \Tdem. Relaxation times of \BulkSample{30} are shown for reference. The vertical line marks the \Tdem. The data in this figure has been published in the supplementary information to \autocite{Saeckel2025}.}
	\label{fig:pnipam-cn3e_uncertainties}
\end{figure}
%
%subfigure vertical alignment for different aspect ratios is cumbersome. either many lines of code, or: https://tex.stackexchange.com/questions/389797/fill-textwidth-with-equal-height-subfigures-of-different-aspect-ratios
%can obtain requested image heights from log file of an initial compile where no fixed heights are set, then manually set height to an appropriate value
\begin{figure}
	\centering
	\subfloat[\SI{0}{\hour}]{\includegraphics[%width=0.14\linewidth, 
		height=64pt, keepaspectratio]{Figures/pNIPAM-5A_ImOfen40C_Cropped-1_000h}}\hfill
	\subfloat[\SI{16}{\hour}]{\includegraphics[%width=0.14\linewidth, 
		height=64pt, keepaspectratio]{Figures/pNIPAM-5A_ImOfen40C_Cropped-2_016h}}\hfill
	\subfloat[\SI{23}{\hour}]{\includegraphics[%width=0.14\linewidth, 
		height=64pt, keepaspectratio]{Figures/pNIPAM-5A_ImOfen40C_Cropped-3_023h}}\hfill
	\subfloat[\SI{46}{\hour}]{\includegraphics[%width=0.14\linewidth, 
		height=64pt, keepaspectratio]{Figures/pNIPAM-5A_ImOfen40C_Cropped-4_046h}}\hfill
	\subfloat[\SI{95}{\hour}]{\includegraphics[%width=0.14\linewidth, 
		height=64pt, keepaspectratio]{Figures/pNIPAM-5A_ImOfen40C_Cropped-5_095h}}\hfill
	\subfloat[\SI{136}{\hour}]{\includegraphics[%width=0.14\linewidth,
		height=64pt, keepaspectratio]{Figures/pNIPAM-5A_ImOfen40C_Cropped-6_136h}}\hfill
	\subfloat[\SI{161}{\hour}]{\includegraphics[height=64pt, keepaspectratio]{Figures/pNIPAM-5A_ImOfen40C_Cropped-7_161h}}\hfill
	\caption{Photographs of a solution of linear \pNIPAM (\SI{10}{\wtpercent}) in \DTwoO taken at the indicated times through the glass pane of an oven maintaining a temperature of $\sim\SI{40}{\degreeCelsius}$ for several days.}
	\label{fig:pnipam5a_oven40c}
\end{figure}