% This is a LaTeX template for homework solving, intended to be:
% 1. Easy to use;
% 2. Elegant;
% 3. Self-explanatory.
% It was written by Lucas R. Ximenes (Jimeens)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass{solutionclass} % I wrote the design using a4paper, 11pt, twoside, but feel free to change in solutionclass.cls file (line 4)
\pagestyle{plain}
\begin{document}
\pretitle
{A soft template} % ⟸ Write your main Title here
{for homework solutions} % ⟸ Write your subtitle here
{L. R. Ximenes} % ⟸ Write your name here
% Change your homework number here
\def\homeworkNumber{\#}
\makeatletter
\startcontents[sections]
\phantomsection
\chapter{Understanding the template}
\makeatother
In this first part, I will dedicate myself to explaining how to use all the commands in this template. To start off, the entire \verb|solutionclass| was initially based on the \verb|book| class in order to increase the compatibility of some commands, such as the inclusion of the \verb|\chapter{}|.
\divider
For the document cover, the commands \verb|\author{}|, \verb|\title{}|, etc. are not needed so the command \verb|\pretitle{#1}{#2}{#3}| was created to include the title, subtitle and author's name respectively. In this command, the year has also been entered, but it is done automatically with the command \verb|\theyear|, so you don't have to worry about it.
\divider
The \verb|\divider| command creates a dashed line that can be used to visually separate specific content.
\divider
The \verb|\section{}| command has a proprietary style that automatically generates a hexagonal background on the left side of the section title. Note that the section number is removed in the class configuration to maintain a cleaner appearance in the mini-summary. Speaking of the mini-summary, it has a fixed size so that the content recommended to be inside it is approximately 12 items. This means that the font size will decrease as more sections are added.
\divider
This template was initially develop to make solutions of exercises, therefore the first paragraph was thought to write the exercise enunciate, in this way, I didn't modify the text formatting in this part. However, I decided do develop a personalized environment to write the respective solution of the exercise. These environment has two forms: an unbreakable and a breakable form. In the first Section, I will write an example for the unbreakable form, and in the second Section an example for the breakable form.
\section{Unbreakable Form}\label{ex 1}
\lipsum[1]
\begin{solution}[This is a unbreakable example]
\lipsum[1] %\therefs\cite{wald1984GeneralRelativity}
\end{solution}
\section{Breakable Form}\label{ex 2}
\lipsum[1]
\begin{solution}[This is a breakable example]
\lipsum[1-13]
\end{solution}
\section{Using the references}
To use references, we have two methods for citing a book, article, etc. The first method is written as \verb|\therefs\cite{#key}| where \verb|#key| represents the citation key of the bibliographic reference. For example, \verb|\therefs\cite{WaldGR}| produces:
\therefs\cite{WaldGR,Choquet-BruhatGR}
This method is recommended for use when the citation is not a direct one, i.e., when the paragraph or text is based on the reference, but not directly using it. The second method is recommended to use when the citation are directly used to write the text or explain some argument. This method is really simple, you just need to use \verb|\textcite{#key}|, for example:
"The book written by \textcite{WaldGR} and the books written by \textcite{Choquet-BruhatGR, Choquet-BruhatGR2} are the best books to study General Relativity"
\section{Equations style}
In general, the \verb|\begin{equation}| environments are simple, just the label color changes. An example to show:
\begin{equation}\label{eq: 1}
\mathcal{R}^{\alpha\beta} - \dfrac{1}{2}g^{\alpha\beta}\mathcal{R} =
8\pi GT^{\alpha\beta}
\end{equation}
In addition, the environment \verb|\begin{align}| or \verb|\begin{align*}| has vertical lines at each line break and to do this, there is a specific way:
\begin{align}
\dfrac{1}{\sqrt{-g}}\partial_{\uprho}(\sqrt{-g}) & \eq -\dfrac{1}{2(-g)}\partial_{\uprho}(g) \label{eq: 2} \\
& \eq \dfrac{1}{2g}\dfrac{\delta(g)}{\delta(g_{\upmu\upnu})}\partial_{\uprho}(g_{\upmu\upnu}) \nonumber \\
& \eq \dfrac{1}{2g}gg^{\upmu\upnu}\partial_{\uprho}(g_{\upmu\upnu}) \nonumber \\
& \eq \dfrac{1}{2}g^{\upmu\upnu}\partial_{\uprho}(g_{\upmu\upnu}) = \Gamma^{\alpha}_{\uprho\alpha}\ \label{eq:3}
\end{align}
Note that for line breaks, I use the command \verb|\\| and after that, to align, \verb|&| along with a custom command \verb|\eq|. Also, if you don't want to align a specific single line, use the command \verb|\noeq| instead of \verb|\eq| to make the line continue to the next equation, see the following example usingo \verb|\begin{align*}|:
\begin{align*}
\Gamma^{\uprho}_{\upmu\upnu} & \eq \dfrac{1}{2}g^{\uprho\sigma}\left(
\partial_{\upmu}g_{\sigma\upnu} +
\partial_{\upnu}g_{\sigma\upmu} -
\partial_{\sigma}g_{\upmu\upnu}
\right) \\
& \eq \dfrac{1}{2}(\eta^{\uprho\sigma} + h^{\uprho\sigma})[
\partial_{\upmu}(\eta_{\sigma\upnu} + h_{\sigma\upnu}) + \\
& \noeq + \partial_{\upnu}(\eta_{\sigma\upmu} + h_{\sigma\upmu}) -
\partial_{\sigma}(\eta_{\upmu\upnu} + h_{\upmu\upnu}) ] \\
& \eq \dfrac{1}{2}(\eta^{\uprho\sigma} + h^{\uprho\sigma})\left(
\partial_{\upmu}h_{\sigma\upnu} +
\partial_{\upnu}h_{\sigma\upmu} -
\partial_{\sigma}h_{\upmu\upnu}
\right) \\
& \eq \dfrac{1}{2}\eta^{\uprho\sigma} \left(
\partial_{\upmu}h_{\sigma\upnu} +
\partial_{\upnu}h_{\sigma\upmu} -
\partial_{\sigma}h_{\upmu\upnu}
\right) + \mathcal{O}(h)
\end{align*}
\section{Additional Boxes}
I created a new environment which make a adaptable size box around the equation. To use this, you just need to write \verb|\begin{answer}| to start the environment. Use this like the equation environment. Below I show an example.
\begin{answer} \label{eq: 4}
\mathcal{R}^{\alpha\beta} - \dfrac{1}{2}g^{\alpha\beta}\mathcal{R} =
8\pi GT^{\alpha\beta}
\end{answer}
\section{Final instructions}
To change the homework number, in line 13 of the \verb|main.tex|, the definition \verb|\homeworkNumber{\#}| is responsible for change the number, therefore, just put the number you want instead \verb|\#|.
\divider
If you want to change the colors of the template, open the \verb|solutionclass.cls| file, find the \Acomment{Color settings} (line 127), and follow the guide written there.
\divider
If you like to create \verb|\newcommand| in your \verb|.tex| files, I suggest you to write them in the last lines of the file \verb|solutionclass.cls| (line 512), to ensure that all packages are read. In addition, to add new packages in \verb|solutionclass.cls| you want to write \verb|\RequirePackage[]{}| instead \verb|\usepackage[]{}|.
\divider
To finish, I'll comment on some extra commands that I implemented in the template to make things a little prettier.
\begin{itemize}
\item Vectors \verb|\vec{}| are always written using \textbf{bold} notation. The reason for this is that when the math gets more complicated, the notation with the arrow ends up making things more "messy", so to speak;
\item A unitary matrix is represented by the command \verb|\boldone| and looks like that: $\boldone$;
\item To comment some part of the text, I created the command \verb|\Acomment{}| to write the text \Acomment{Like that}.
\end{itemize}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Add these commands below if it's not a problem for you
\thispagestyle{fancyplain}
\fancyhead{}
\renewcommand{\headrulewidth}{0pt}
\rfoot{Template by L. R. Ximenes (Jimeens)}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}