LaTeX Tutorial (2)
Tex Source
This is the Tex Source for my beamer presentation
\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{tikz}
\usepackage{xcolor}
\definecolor{logoBlue}{RGB}{41, 128, 185}
\definecolor{logoText}{RGB}{44, 62, 80}
\usetikzlibrary{calc}
\usepackage{parskip}
\usepackage{amssymb}
\usepackage{hyperref}
\usepackage{float}
\hypersetup{
colorlinks=true,
linkcolor=blue,
filecolor=magenta,
urlcolor=cyan,
pdftitle={Overleaf Example},
pdfpagemode=FullScreen,
}
\usetheme{Madrid}
\usecolortheme{default}
\usepackage{xspace}
%------------------------------------------------------------
%This block of code defines the information to appear in the
%Title page
\title[Introduction to \LaTeX] %optional
{Introduction to \LaTeX}
\subtitle{A very short briefing}
\author[Henry, Yip] % (optional, for multiple authors)
{Henry~Yip}
\institute[University of Edinburgh ] % (optional)
{Year 3 Mathematical Physics, University of Edinburgh\\
\href{henry-yip.com}{Informal Website} \\
\href{henry-yip.github.io}{Academic Website}
}
\date[Jan 2024]
\begin{document}
\frame{\titlepage}
\begin{frame}
\frametitle{Table of Contents}
\tableofcontents
\end{frame}
%---------------------------------------------------------
\section{Introduction}
\begin{frame}
\frametitle{Sample frame title}
I am \textbf{NOT} a \LaTeX \xspace expert. These are some of my (potentially poor) ways to create a \LaTeX \xspace document. There are much better ways but if you are a student wanting to create a \LaTeX document fast (to submit your hand-in) this is a very good introduction.
\end{frame}
\begin{frame}
\frametitle{Structure of Presentation}
\begin{itemize}
\item <1->Introduction
\item <2->Preample
\item <3->Math Symbols
\item <4-> Inserting Images
\item <5->Hyperlinks
\item <6->Footnote
\item <7->Bonus Session for Texmaker Users
\end{itemize}
\end{frame}
\begin{frame}{Preample}
\begin{itemize}
\item <1-> Below is an example of a \textbf{Preample}\\
\includegraphics[scale=0.4]{Preample.png}
\end{itemize}
\begin{alertblock}{Components}
\begin{itemize}
\item <1-> \textbackslash documentclass\{\}
\item <2->\textbackslash usepackage\{\}
\item <3->Title, Author, Date...
\item <4->\textbackslash begin\{document\}
\end{itemize}
\end{alertblock}
\end{frame}
\begin{frame}{Documentclass?}
\begin{itemize}
\item <1-> On the first line you can see \textbf{\textbackslash documentclass\{\}}. As we are writing articles, we always put \textbf{\textbackslash documentclass\{articles\}} in the brackets.
\item <2-> If you want to include a report later on (designed for longer writing), you should put \textbf{\textbackslash documentclass\{report\}}
\item You can make slides using \LaTeX. In this case we use \textbf{\textbackslash documentclass\{beamer\}}.
\textbf{This document is created using Beamer!}
\end{itemize}
\pause
\begin{alertblock}{More Features}
\begin{itemize}
\item <4->You can include some global changes, including double columns, font sizes, etc. by inserting a square bracket in the middle.
\item <5-> Example: \textbackslash documentclass{[}\textbf{12pt, letterpaper}{]}\{article\}
\item <6-> For documents intended for two-sided printing, you can use the twoside option.
\item <7-> \textbackslash documentclass{[}\textbf{twoside}{]}\{article\}
\end{itemize}
\end{alertblock}
\end{frame}
\begin{frame}{Packages}
\begin{itemize}
\item <1-> Packages are extensions of \LaTeX \xspace that allows you to to include all sorts of things, like graphs, hyperlinks, math symbols and so on
\item <2-> \textbf{\textbackslash usepackage\{amsmath\}} and \textbf{\textbackslash usepackage\{amssymb\}} are almost always required in Mathematical Writing.
\item <3-> \textbf{\textbackslash usepackage\{geometry\}} is usually used to set margins. For example: \textbf{\textbackslash usepackage{[}margin=0.8in{]}\ {geometry\}}}
\item <3->\textbf{Tikz} is preferred if you want to include graphs
\item <3->Below is a beautiful example! \textbf{(Created using Chatgpt)}
\end{itemize}
\end{frame}
\begin{frame}
\begin{center}
\begin{tikzpicture}
% Outer circle
\draw[thick, logoBlue, fill=logoBlue!20] (0,0) circle (1.8);
% Inner circle
\fill[white] (0,0) circle (1.6);
% Text
\node[align=center, text=logoText, font=\sffamily\bfseries\Huge] at (0,0) {Henry};
\end{tikzpicture}
\end{center}
\end{frame}
\begin{frame}{More on Packages}
\begin{itemize}
\item <1-> You can include references using the package \textbf{hyperref}
\item <2-> At the end of the paper put:
\item <3->
\textbackslash bibliographystyle\{plain\}
\textbackslash bibliography\{References\}
\item <4-> Then create a document named \textbf{Refereces.bib}. Put the details of the papers in. For example: \\
@article\{benisek2015vibrational, \\
title=\{The vibrational and configurational entropy of disordering in Cu3Au\}, \\
author=\{Benisek, Artur and Dachs, Edgar\}, \\
journal=\{Journal of alloys and compounds\}, \\
pages=\{585--590\}, \\
publisher=\{Elsevier\} \\
\}
\item <6-> These are directly provided in \textbf{Google Scholar}!
\end{itemize}
\end{frame}
\begin{frame}
\begin{itemize}
\item <1->There are pretty much all sorts of packages anywhere. For example, the \href{https://ctan.math.illinois.edu/macros/latex/contrib/parskip/parskip.pdf}\textbf{\textbackslash usepackage\{parskip\}}
\item <2-> You can \textbf{always} find your answer in \href{https://stackexchange.com/}{Stackexchange}
\end{itemize}
\end{frame}
\begin{frame}
\begin{block}{Preample}
\frametitle{Sidenote: Wait what is a beamer?!}
\begin{itemize}
\item <1->\textbackslash documentclass\{beamer\}
\item <2->\textbackslash usetheme\{Madrid\}
\item <3->\textbackslash usecolortheme\{default\}
\end{itemize}
\end{block}
\pause
\begin{alertblock}{Important Notice}
Try not to use powerpoint slides for your Math-related presentations
\end{alertblock}
\end{frame}
\begin{frame}{Title, Date, Author, Etc.}
\begin{itemize}
\item <1-> The Sample document has \textbf{Sample} as the default title, feel free to change to anything you want
\item <2-> You can include several authors if you use the and function.
\item <3->\textbackslash\textbackslash \xspace allows you to skip lines
\item <4->For the date, set as today
\begin{itemize}
\item <4-> \textbackslash date\{today\}
\end{itemize}
\item <5->After all these, start the document by \textbf{\textbackslash begin\{document\}}. Remember to \textbf{\textbackslash end\{document\}} when you finish
\item <6->Always include \textbf{\textbackslash maketitle} after \textbf{\textbackslash begin\{document\}}
\end{itemize}
\end{frame}
\begin{frame}{Abstract?}
\begin{itemize}
\item <1->You can include an Abstract by \textbf{\textbackslash begin\{abstract\}}
\item <2->This can only be added after \textbf{\textbackslash begin\{document\}}
\item <3->Always remember to \textbf{\textbackslash end\{abstract\}}
\end{itemize}
\end{frame}
\begin{frame}{Math Symbols}
\begin{itemize}
\item<1-> One should search online for the math symbols supported by \LaTeX. \href{https://oeis.org/wiki/List_of_LaTeX_mathematical_symbols}{Here} is a good guide
\item <2->More symbols can be downloaded through extra packages. For example, $\hbar$, $\measuredangle$
\item <3-> a \$ sign is \textbf{required} to show that you are entering math mode. For example:
\$\textbackslash measuredangle\$ will show as $\measuredangle$
\item <4-> You can make your equations aligned also:
$$
\begin{aligned}
p&=mv\\
E&=\frac{1}{2}mv^2
\end{aligned}
$$
\end{itemize}
\end{frame}
\begin{frame}{More on Math Symbols}
\begin{itemize}
\item <1-> You can use the \textbackslash begin\{aligned\} and \textbackslash end\{aligned\} to achieve this. Remember to include a \& before every = sign so equations can be actually aligned. And add \$\$ in front and after begin\{aligned\} and end\{aligned\} respectively.
\item <3-> You can find more in Overleaf's website
\end{itemize}
\end{frame}
\begin{frame}{Inserting pics}
\begin{itemize}
\item <1-> First, upload your images to \textbf{Overleaf}
\item <2-> Second, include this line:
\begin{itemize}
\item \textbackslash includegraphics{[}scale$=1${]}\{Preample.png\}
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}{Hyperlink}
\begin{itemize}
\item <1-> First include the following packages in the \textbf{Preamble}
\includegraphics[scale=0.5]{Href.png}
\begin{itemize}
\item <1-> There are many ways to change all sorts of settings. You should refer to the Overleaf page for reference
\end{itemize}
\item <2->Obviously, change the colours as you like
\item <3-> Whenever you use hyperlink, type:
\textbackslash href\{Your URL\}\{\textbf{the text}\}
\item <4-> Below is an example: \\
\includegraphics[width=11cm]{HrefExample.png}
\end{itemize}
\end{frame}
\begin{frame}{Footnotes}
\begin{itemize}
\item <1-> Just type down \textbackslash footnote \{\}
\item <2-> The formatting is automatic
\end{itemize}
\pause
\includegraphics[scale=0.5]{HrefExample.png}
\end{frame}
\begin{frame}{Table}
\begin{itemize}
\item You can make very nice tables with \LaTeX
\begin{table}[H]
\begin{center}
\begin{tabular}{c|c|c}
\textbf{Time} & \textbf{Activity}&\textbf{Remarks}\\
\hline\hline
7:00 & Train in \textbf{Glascow}/Paris& \\
\hline
12:00 & Arriving in \textbf{King's Cross Station}&\\
\hline
12:30 & Check in & \\
\hline
13:00-14:00 & Lunch \\
\hline
15:00-18:45 & Hong Kong Disneyland & Walk Around\\
\hline
19:15-20:45 & Dinner &\\
\hline
\end{tabular}
\end{center}
\end{table}
\end{itemize}
\end{frame}
\begin{frame}{More on Tables}
\includegraphics[scale=0.4]{Table.png}
\begin{itemize}
\item <1-> Above is how you should type \\
\item <2->To adjust position please download \textbackslash usepackage\{float\}
\end{itemize}
\end{frame}
\begin{frame}{Bonus Session}
\begin{itemize}
\item <1->I understand that most of you are Overleaf users, but this section is for TexMaker users
\item <2-> Save your document as nameofyourdocument.tex. Download MikTeX (The Source Code is available in GitHub), go to comamnd prompt and cd to the place you stored your tex file
\item <3->Then type \textbf{pdflatex nameofyourdocument.tex}
\item <4-> You can also click "View" in TexMaker, then "print" and then "Microsoft Print to Pdf". However, at least for me, the hyperlinks may be lost.
\end{itemize}
\end{frame}
\begin{frame}{Approaching The End!}
\begin{alertblock}{Questions}
If you have any Questions feel free to ask me now!
\end{alertblock}
\end{frame}
\begin{frame}{}
\centering \Large
{Thank You!}
\end{frame}
\end{document}