Skip to Main Content
Banner Image

LaTeX in Engineering Sciences

The fundamental commands needed to start writing LaTeX documents in Overleaf

1. Document Structure Commands

  • \documentclass: Defines the overall layout of the document.

\documentclass{article} % Common classes: article, report, book, beamer

  • \begin{document} ... \end{document}: Encloses the content of the document.

\begin{document}

Your content goes here.

\end{document}

  • \title, \author, \date: Sets the title, author, and date of the document.

\title{My First LaTeX Document}

\author{John Doe}

\date{\today} % Automatically inserts the current date

  • \maketitle: Generates the title, author, and date section.

\maketitle

2. Sectioning Commands

  • \section, \subsection, \subsubsection: Creates sections and subsections to organize content.

\section{Introduction}

\subsection{Background}

\subsubsection{Details}

3. Text Formatting Commands

  • \textbf: Bold text.

\textbf{This is bold text}

  • \textit: Italicize text.

\textit{This is italic text}

  • \underline: Underline text.

\underline{This is underlined text}

4. Lists

  • \begin{itemize} ... \end{itemize}: Creates a bulleted list.

\begin{itemize}

  \item First item

  \item Second item

\end{itemize}

  • \begin{enumerate} ... \end{enumerate}: Creates a numbered list.

\begin{enumerate}

  \item First item

  \item Second item

\end{enumerate}

5. Mathematical Expressions

  • Inline Math: Use dollar signs ($...$) to include simple math within text.

E = mc^2

  • Displayed Equations: Use \[ ... \] for centered equations on a new line.

\[ E = mc^2 \]

  • Equation Environment: For numbered equations, use the equation environment.

\begin{equation}

E = mc^2

\end{equation}

6. Figures and Tables

  • Including Figures: Use the graphicx package to include images.

\usepackage{graphicx} % Add this in the preamble

\begin{figure}

  \centering

  \includegraphics[width=\textwidth]{image.png}

  \caption{Sample Figure}

  \label{fig:sample}

\end{figure}

  • Creating Tables: Use the tabular environment for tables.

\begin{table}

  \centering

  \begin{tabular}{|c|c|c|}

    \hline

    Header1 & Header2 & Header3 \\

    \hline

    Row1 & Row1 & Row1 \\

    \hline

    Row2 & Row2 & Row2 \\

    \hline

  \end{tabular}

  \caption{Sample Table}

  \label{tab:sample}

\end{table}

7. References and Citations

  • Labels and References: Use \label and \ref to create and refer to labels.

\section{Introduction} \label{sec:intro}

As seen in Section \ref{sec:intro}...

  • Bibliographies: Use thebibliography environment or BibTeX for managing references.

\begin{thebibliography}{9}

  \bibitem{latexcompanion}

  Michel Goossens, Frank Mittelbach, and Alexander Samarin.

  \textit{The \LaTeX\ Companion}.

  Addison-Wesley, Reading, Massachusetts, 1993.

\end{thebibliography}

8. Packages

  • Including Packages: Use \usepackage to add additional functionalities.

\usepackage{amsmath} % For advanced math features

\usepackage{hyperref} % For hyperlinks