[Tex/LaTex] Setting \parindent to 2em or \quad

indentationparagraphsspacing

I would like to set \parindent to 2em (or \quad which is the same if I know correctly). How can I do it?

\setlength{\parindent}{...} only accepts values with length units, for example, 15pt, 1cm, etc. It doesn't accept \quad; it gives the error "Illegal unit of measure".

Example:

\documentclass{article}
\setlength{\parindent}{\quad}
\begin{document}
A
\end{document}

Best Answer

\quad means \hskip 1em\relax. You have to give a length directly as the argument to \parindent. So use \setlength{\parindent}{2em}.

\documentclass{article}
\usepackage{showframe}  %% just for demo
\setlength{\parindent}{2em}
\begin{document}
A\\
\hspace*{2em}A
\end{document}

enter image description here

You can find the meaning of \quad by texdef \quad in terminal. And to find the value of \parindent, put \showthe\parindent in your file and the value will be show in the log.