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".


  • 1
    \parindent=2em\relax Note that \quad is not a length, but a macro for skipping a length, so one cannot set \parindent to it. – Steven B. Segletes Mar 23 '15 at 16:48
  • \quad is a skip of 1em, so \setlength{\parindent}{1em} should do the trick. – Thruston Mar 23 '15 at 16:49

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

\usepackage{showframe}  %% just for demo

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.

  • 2
    \AtBeginDocument{\setlength{\parskip}{1em}} is better. Why? Well, exercise for you. – egreg Mar 23 '15 at 18:08
  • @egreg For me? :-) May be I am a lazy student who runs out of time quickly these days. :-) – user11232 Mar 24 '15 at 0:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.