Skip to Main Content

Latex Workshop for RPGs

Introduce LaTex and Overleaf

Module 1 Demonstration Codes

\documentclass{article}
\usepackage[utf8]{inputenc}

\title{LaTex 2020 workshop making code}
\author{lbsamson.ust }
\date{November 2020}

\begin{document}

\maketitle
%hello world!
\section{Introduction}

{\Huge You} {\huge can} {\LARGE also}
{\Large manually} {\large alter} {\normalsize
the} {\small font} {\footnotesize size}

Welcome to our {\LaTeX} \textbf{session} \underline{which} is held by \textbf{\textit{Library}} \footnote{HKUST Library}! This workshop is part of the Researchers’ Series\footnote{The Researchers’ Series is the Library’s program for researchers.(https://library.hkust.edu.hk/services/research-support/researchers-series/)}.

\end{document}
 

\documentclass{article}
\usepackage[utf8]{inputenc}

\title{LaTex 2020 workshop making code}
\author{lbsamson.ust }
\date{November 2020}

\begin{document}

\maketitle
%hello world!

\section{Introduction}

{\Huge You} {\huge can} {\LARGE also}
{\Large manually} {\large alter} {\normalsize
the} {\small font} {\footnotesize size}

Welcome to our {\LaTeX} \textbf{session} \underline{which} is held by \textbf{\textit{Library}} \footnote{HKUST Library}! This workshop is part of the Researchers’ Series\footnote{The Researchers’ Series is the Library’s program for researchers.(https://library.hkust.edu.hk/services/research-support/researchers-series/)}.

\section{About Lists}

%Unordered LIst – bulleted list
\begin{itemize}
\item When you use
\underline{itemize},
\item a bulleted list is created.
\end{itemize}

%Ordered List – with number
\begin{enumerate}
\item When you use \underline{enumerate},
\item an ordered list is created.
\end{enumerate}

\end{document}
 

\documentclass{article}
\usepackage[utf8]{inputenc}

\title{LaTex 2020 workshop making code}
\author{lbsamson.ust }
\date{November 2020}

\begin{document}

\maketitle
%hello world!

\section{Introduction}

{\Huge You} {\huge can} {\LARGE also}
{\Large manually} {\large alter} {\normalsize
the} {\small font} {\footnotesize size}

Welcome to our {\LaTeX} \textbf{session} \underline{which} is held by \textbf{\textit{Library}} \footnote{HKUST Library}! This workshop is part of the Researchers’ Series\footnote{The Researchers’ Series is the Library’s program for researchers.(https://library.hkust.edu.hk/services/research-support/researchers-series/)}.
\newpage
\section{About Lists}

%Unordered LIst – bulleted list
\begin{itemize}
\item When you use
\underline{itemize},
\item a bulleted list is created.
\end{itemize}

%Ordered List – with number
\begin{enumerate}
\item When you use \underline{enumerate},
\item an ordered list is created.
\end{enumerate}
\newpage
\section{About Tables}

\begin{center} % Align the whole table in centre
\begin{tabular}{ c c c } % c: central alignment, r:right alignment, l: left alignment
cell1 & cell2 & cell3 \\ % &: to add separate column
cell4 & cell5 & cell6 \\
cell7 & cell8 & cell9
\end{tabular}
\end{center}

\begin{center}
\begin{tabular}{ |c|c|c| } % vertical separator line | is added
\hline % \hline to add horizontal separator line
cell1 & cell2 & cell3 \\
cell4 & cell5 & cell6 \\
cell7 & cell8 & cell9 \\
\hline
\end{tabular}
\end{center}

The table number of the below table is \ref{table:testing}. \\ % \ref cross referencing to call table number
\begin{table}[h!] % h! place the table here
\centering
\begin{tabular}{ |c|c|c| } % vertical line | is added
\hline % to add horizontal line
Col1 & Col2 & Col3 \\
\hline
cell1 & cell2 & cell3 \\
cell4 & cell5 & cell6 \\
cell7 & cell8 & cell9 \\
\hline
\end{tabular}
\caption{This is a table for testing} %Add caption of the table
\label{table:testing} %label the table
\end{table} \\
\paragraph{} The table number of the above table is \ref{table:testing} % \ref cross referencing to call table number 


\end{document}
 

\documentclass{article}
\usepackage[utf8]{inputenc}
% Add the following 2 commands in permeable
% \graphicspath{} locate where to obtain the image
\usepackage{graphicx}

\graphicspath{ {./images/} } 

\title{LaTex 2020 workshop making code}
\author{lbsamson.ust }
\date{November 2020}

\begin{document}

\maketitle
\newpage
\tableofcontents    %add “Table of contents”

\listoffigures    %add “List of figures”

\listoftables    %add “List of tables”

%hello world!
\newpage
\section{Introduction}

{\Huge You} {\huge can} {\LARGE also}
{\Large manually} {\large alter} {\normalsize
the} {\small font} {\footnotesize size}

Welcome to our {\LaTeX} \textbf{session} \underline{which} is held by \textbf{\textit{Library}} \footnote{HKUST Library}! This workshop is part of the Researchers’ Series\footnote{The Researchers’ Series is the Library’s program for researchers.(https://library.hkust.edu.hk/services/research-support/researchers-series/)}.
\newpage
\section{About Lists}

%Unordered LIst – bulleted list
\begin{itemize}
\item When you use
\underline{itemize},
\item a bulleted list is created.
\end{itemize}

%Ordered List – with number
\begin{enumerate}
\item When you use \underline{enumerate},
\item an ordered list is created.
\end{enumerate}
\newpage
\section{About Tables}

\begin{center} % Align the whole table in centre
\begin{tabular}{ c c c } % c: central alignment, r:right alignment, l: left alignment
cell1 & cell2 & cell3 \\ % &: to add separate column
cell4 & cell5 & cell6 \\
cell7 & cell8 & cell9
\end{tabular}
\end{center}

\begin{center}
\begin{tabular}{ |c|c|c| } % vertical separator line | is added
\hline % \hline to add horizontal separator line
cell1 & cell2 & cell3 \\
cell4 & cell5 & cell6 \\
cell7 & cell8 & cell9 \\
\hline
\end{tabular}
\end{center}

The table number of the below table is \ref{table:testing}. \\ % \ref cross referencing to call table number
\begin{table}[h!] % h! place the table here
\centering
\begin{tabular}{ |c|c|c| } % vertical line | is added
\hline % to add horizontal line
Col1 & Col2 & Col3 \\
\hline
cell1 & cell2 & cell3 \\
cell4 & cell5 & cell6 \\
cell7 & cell8 & cell9 \\
\hline
\end{tabular}
\caption{This is a table for testing} %Add caption of the table
\label{table:testing} %label the table
\end{table} \\
\paragraph{} The table number of the above table is \ref{table:testing} % \ref cross referencing to call table number 
\newpage
\section{About Image}
\includegraphics{dam}
\newpage

% [ ] indicate optional argument of a command
% [width=0.5\textwidth] resize a picture width 50% as the text width
The following photo shows you a beautiful dam. The
photo was created by American Public Power
Association.\\

\includegraphics[width=0.5\textwidth]{dam}\\


% angle=270 rotates the picture 270 degrees counter-clockwise.
\includegraphics[width=0.5\textwidth,
angle=270]{dam}

\newpage

\begin{figure}[h]
\centering
\includegraphics[width=0.5\textwidth]{dam}
% \caption{} add caption in the image, can be put above or below the image
\caption{a nice dam by American Public
Power Association}
% \label{fig:dam} number the image
\label{fig:dam}
\end{figure}
% \pageref{fig:dam} and \ref{fig:dam}
commands will generate the number
corresponding to the referenced image
In page \pageref{fig:dam}, you can find the
beautiful dam in figure \ref{fig:dam}.

\end{document}
 

© HKUST Library, The Hong Kong University of Science and Technology. All Rights Reserved.