Merge pull request #12 from FYS3150-G2-2023/11-set-up-structure-in-latex

Set up the basic structure of latex file
This commit is contained in:
Cory Balaton 2023-09-01 14:19:30 +02:00 committed by GitHub Enterprise
commit ab06e99c0d

View File

@ -82,66 +82,54 @@
\maketitle
\textit{List a link to your github repository here!}
\textit{https://github.uio.no/FYS3150-G2-2023/Project-1}
\section*{Problem 1}
\subsection*{Problem a}
Write a solution for problem 1a here.
\subsection*{Problem b}
Write a solution for problem 1b here.
% Do the double integral
\section*{Problem 2}
We write equations using the LaTeX \texttt{equation} (or \texttt{align}) environments. Here is an equation with numbering
\begin{equation}\label{eq:newton}
\vb{F} = \dv{\vb{p}}{t},
\end{equation}
and here is one without numbering:
\begin{equation*}
\oint_C \vb{F}\cdot \dd \vb{r} = 0.
\end{equation*}
Sometimes it is useful to refer back to a previous equation, like we're demonstrating here for equation \ref{eq:newton}.
We can include figures using the \texttt{figure} environment. Whenever we include a figure or table, we \textit{must} make sure to actually refer to it in the main text, e.g.\ something like this: ``In figure \ref{fig:rel_err} we show \ldots''.
\begin{figure}%[h!]
\centering %Centers the figure
\includegraphics[scale=0.55]{imgs/rel_err.pdf} %Imports the figure.
\caption{Write a descriptive caption here that explains the content of the figure. Note the font size for the axis labels and ticks --- the size should approximately match the document font size.}
\label{fig:rel_err}
\end{figure}
Also, note the LaTeX code we used to get correct quotation marks in the previous sentence. (Simply using the \texttt{"} key on your keyboard will give the wrong result.) Figures should preferably be vector graphics (e.g.\ a \texttt{.pdf} file) rather than raster graphics (e.g.\ a \texttt{.png} file).
% Write which .cpp/.hpp/.py (using a link?) files are relevant for this and show the plot generated.
By the way, don't worry too much about where LaTeX decides to place your figures and tables --- LaTeX knows more than we do about proper document layout. As long as you label all your figures and tables and refer to them in the text, it's all good. Of course, in some cases it can be worth trying to force a specific placement, to avoid the figure/table appearing many pages away from the main text discussing it, but this isn't something you should spend time on until the very end of the writing process.
\section*{Problem 3}
% Show how it's derived and where we found the derivation.
Next up is a table, created using the \texttt{table} and \texttt{tabular} environments. We refer to it by table \ref{tab:output_table}.
\begin{table}%[h!]
\centering
\caption{Write a descriptive caption here, explaining the content of your table.}
\begin{tabular}{c@{\hspace{1cm}} c}
\hline
Number of points & Output \\
\hline
10 & 0.3086\\
100 & 0.2550\\
\hline
\end{tabular}\label{tab:output_table}
\end{table}
\section*{Problem 4}
% Show that each iteration of the discretized version naturally creates a matrix equation.
\section*{Problem 5}
\subsection*{a)}
\subsection*{b)}
\section{Problem 6}
\subsection{a)}
% Use Gaussian elimination, and then use backwards substitution to solve the equation
\subsection*{b)}
% Figure it out
\section*{Problem 7}
% Link to relevant files on gh and possibly add some comments
\section*{Problem 8}
%link to relvant files and show plots
\section*{Problem 9}
% Show the algorithm, then calculate FLOPs, then link to relevant files
\section*{Problem 10}
% Time and show result, and link to relevant files
Finally, we can list algorithms by using the \texttt{algorithm} environment, as demonstrated here for algorithm \ref{algo:midpoint_rule}.
\begin{algorithm}[H]
\caption{Some algorithm}\label{algo:midpoint_rule}
\begin{algorithmic}
\State Some maths, e.g $f(x) = x^2$. \Comment{Here's a comment}
\For{$i = 0, 1, ..., n-1$}
\State Do something here
\EndFor
\While{Some condition}
\State Do something more here
\EndWhile
\State Maybe even some more math here, e.g $\int_0^1 f(x) \dd x$
\end{algorithmic}
\end{algorithm}
\end{document}