% Hey There! This is a template for an engineering/math homework assignment.
% I created it because not many templates in the Overleaf library are structured this way.
% Feel free to use it or edit it as you see fit.
% Document Type:
\documentclass[12pt]{article}
% Packages Used (add more if needed):
\usepackage[utf8]{inputenc}
\usepackage{geometry}
\geometry{a4paper, margin=1in}
\usepackage{setspace}
\setstretch{1.5}
\usepackage{hyperref}
\hypersetup{
colorlinks=true,
linkcolor=blue,
filecolor=blue,
urlcolor=blue,
citecolor=blue,
pdfborder={0 0 0}
}
\usepackage{xcolor}
\usepackage{tcolorbox}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{graphicx} % For including graphics
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyfoot[C]{\thepage}
% Define Homework Number and Title (we will use them later).
\newcommand{\hwNumber}{\#[Number]}
\newcommand{\hwTitle}{[Homework Title]}
% Document Content:
\begin{document}
%% Cover Page (replace everything in [] with your details):
\begin{center}
\vspace*{2cm}
\textbf{[Insert University Name] \\}
\textbf{[Insert Faculty/School Name] \\}
\textbf{[Insert Department Name] \\}
\vfill
\textbf{[Course Code]: [Course Name] \\}
\textbf{Dr. [Professor's Name] \\}
\textbf{[Semester [20YY][YY]] - Section [Section Number] \\}
% Example for Semester [20YY][YY]: Spring 2023-24
\textbf{[Date] \\}
\textbf{\hwTitle \space \hwNumber\\}
% Example: Homework 1
\vfill
\textbf{[Your Name] \\}
(Student ID: [Your ID]) \\
\vfill
\textit{This document was created using \LaTeX\ on Overleaf \href{[Insert Source Code URL]}{\underline{\textcolor{blue}{(source code)}}}}.
% One thing I like to do is to export my source code by pressing on the menu in the top left corner, then pressing 'Source' to download the source code. After that, I upload it to a drive like OneDrive or Dropbox and create a sharable link, which I insert above.
% This method is important because:
% 1) It ensures academic integrity by allowing the professor to see the code you used to generate the document, confirming that the content is your own creation and not copied by someone else. This process helps maintain trust and credibility in your academic submissions.
% 2) By keeping the source code along with the PDF file, you ensure that you can still make changes to the document in the future if needed.
\end{center}
%% Numbering Starting Page 2
\thispagestyle{empty}
\newpage
\pagenumbering{arabic}
% Set Up Header
\fancyhead[L]{\textbf{[University Name]}} %University Name Should be Abbreviated.
\fancyhead[C]{\textbf{\hwTitle\ \hwNumber}}
\fancyhead[R]{\textbf{[Course Code]}}
%% Start Writing Your Homework.
\section*{Problem 1}
\begin{tcolorbox}[colback=gray!10, colframe=black, title=Given]
% Insert the concise given of your problem here
\end{tcolorbox}
\begin{tcolorbox}[colback=yellow!20, colframe=black, title=Solution]
% Insert the solution of your problem here
\end{tcolorbox}
\section*{Problem 2}
\begin{tcolorbox}[colback=gray!10, colframe=black, title=Given]
% Insert the concise given of your problem here
\end{tcolorbox}
\begin{tcolorbox}[colback=yellow!20, colframe=black, title=Solution]
% Insert the solution of your problem here
\end{tcolorbox}
% Add more problems if needed
% In the Given box, write the problem's given (in a concise manner).
% In the Solution box, write the problem's solution.
% Sample Problem and Solution (remove if not needed)
\section*{Problem n}
\begin{tcolorbox}[colback=gray!10, colframe=black, title=Given]
%%% Sample given of a problem:
%%% The sample problem is: Calculate the current flowing through a 10 ohms resistor when a voltage of 5 volts is applied to it.
\begin{itemize}
\item \( R = 10 \, \Omega \)
\item \( V = 5 \, \text{V} \)
\end{itemize}
\end{tcolorbox}
\begin{tcolorbox}[colback=yellow!20, colframe=black, title=Solution]
According to Ohm's Law: \( V = I \times R \), :
\[ \Rightarrow I = \frac{V}{R} \]
Plugging in the given values:
\[ I = \frac{5 \text{ V}}{10 \, \Omega} = 0.5 \text{ A} \]
Therefore, the current flowing through the resistor is 0.5 A.
\end{tcolorbox}
% Indicate that your document has ended.
\vfill
\begin{center}
\rule{0.5\linewidth}{0.5pt}\\
\textit{End of \textbf{\hwTitle \space \hwNumber}}
\end{center}
\end{document}
% Hope this template was helpful!
% Good luck :)