LaTeX (pronounced “LAH-tek” or “LAY-tek”) is a document preparation system that produces professional-quality documents. Unlike word processors where you see the final result as you type, LaTeX uses plain text files with markup commands that get compiled into beautiful documents.
Think of LaTeX like HTML for documents. You write structured text, and LaTeX handles all the formatting consistently and professionally. It’s especially powerful for:
Let’s make our document more professional by adding metadata:
Copy
\documentclass{article}\title{My First LaTeX Document}\author{Your Name}\date{\today}\begin{document}\maketitleWelcome to my first LaTeX document! This is an exciting journey into professional document preparation.\end{document}
The \maketitle command creates a nicely formatted title block using the information you provided in the preamble.
LaTeX provides simple commands for text formatting:
Copy
\documentclass{article}\begin{document}\textbf{Bold text} is important.\textit{Italic text} adds emphasis.\underline{Underlined text} stands out.\texttt{Monospace text} for code.You can also \textbf{\textit{combine}} formats!\end{document}
This is where LaTeX truly shines! You can add math inline with $...$ or as display equations with \[...\]:
Copy
\documentclass{article}\begin{document}Einstein's famous equation is $E = mc^2$.The quadratic formula is:\[x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}\]Here's a more complex example:\[\int_{0}^{\infty} e^{-x^2} dx = \frac{\sqrt{\pi}}{2}\]\end{document}
LaTeX has hundreds of mathematical symbols and operators. Check our math reference guide for a complete list.
To add images to your document, you’ll need the graphicx package:
Copy
\documentclass{article}\usepackage{graphicx}\begin{document}\begin{figure}[h] \centering \includegraphics[width=0.5\textwidth]{example-image} \caption{A sample image in LaTeX} \label{fig:sample}\end{figure}As we can see in Figure \ref{fig:sample}, images are easy to add!\end{document}
For longer documents, use sections to organize your content:
Copy
\documentclass{article}\begin{document}\tableofcontents\newpage\section{Introduction}This is the introduction to my document.\subsection{Background}Some background information here.\subsection{Objectives}What we aim to achieve.\section{Methods}How we'll do it.\section{Conclusion}What we learned.\end{document}
The \tableofcontents command automatically generates a table of contents based on your sections!
Use % to add comments that won’t appear in the output:
Copy
\documentclass{article}\begin{document}This text will appear. % This comment won't% You can also have full-line comments% They're great for:% - TODO notes% - Temporarily disabling content% - Explaining complex code\end{document}
Let’s put it all together! Here’s a complete document showcasing everything you’ve learned:
Copy
\documentclass{article}\usepackage{graphicx}\usepackage{amsmath}\usepackage{hyperref}\title{My LaTeX Journey}\author{Your Name}\date{\today}\begin{document}\maketitle\tableofcontents\newpage\section{Introduction}Welcome to my first complete LaTeX document! I've learned how to create professional documents with ease.\section{What I've Learned}\subsection{Text Formatting}I can make text \textbf{bold}, \textit{italic}, and \underline{underlined}. I can even \textbf{\textit{combine}} them!\subsection{Mathematics}LaTeX makes math beautiful. Here's the quadratic formula:\[x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}\]\subsection{Lists and Tables}\begin{itemize} \item Create bullet points \item Make numbered lists \item Build professional tables\end{itemize}\begin{table}[h]\centering\begin{tabular}{|l|c|}\hline\textbf{Feature} & \textbf{Learned} \\\hlineBasic formatting & ✓ \\Mathematics & ✓ \\Images & ✓ \\Tables & ✓ \\\hline\end{tabular}\caption{My LaTeX progress}\end{table}\section{Conclusion}In just 30 minutes, I've gone from zero to creating professional documents with LaTeX. The journey continues!\end{document}