Therefore, document processors, such as LaTeX, provide simple source code to indent text. However, many new users don’t know how to add indentations. In this tutorial, we will briefly explain ways to indent in LaTeX.
How To Indent in LaTeX
First, let’s start with the simple source code that includes indentfirst \usepackage and \indent code to indent text:
\usepackage{indentfirst}
\begin{document}
Linux OS names: \\
\indent Ubuntu \\
\indent Fedora \\
\indent CentOS \\
\indent Kali Linux \\
There are some lightweight Linux operating systems such as Linux Mint, Arch Linux, Rocky Linux, etc.
\end{document}
Output
Similarly, if you want to change the indents, as per your requirements, then please use the \setlength\parindent code:
\begin{document}
\setlength\parindent{24pt}
Linux OS names: \\
Ubuntu \\
Fedora \\
CentOS \\
Kali Linux \\
There are some lightweight Linux operating systems such as Linux Mint, Arch Linux, Rocky Linux, etc.
\end{document}
Output
In case you want to indent from a specific line, please use the following source code:
\begin{document}
\setlength\parindent{24pt}
Linux OS names: \\
Ubuntu \\
Fedora \\
\-\hspace{5cm} CentOS \\
Kali Linux \\
There are some lightweight Linux operating systems such as Linux Mint, Arch Linux, Rocky Linux, etc.
\end{document}
Output
Conclusion
This article provided brief information on the simple methods to indent in LaTeX. Indentation or indent decreases or increases the distance or space between a paragraph’s left and right margin. It is essential to use the sources correctly, or else you may get an error. Hence, we recommend checking the code before compiling it in LaTeX.