[Tex/LaTex] \noindent for whole document without \parindent=0

indentationparagraphs

I'm writing a Cheatsheet with a lot of formulas and having paragraphs indent is just wasting space and doesn't look good at all, so I want to disable autoindentation. But sometimes I still want indentation in some cases (which aren't rare, but still rarer than I would type \noindent without any changes).

So far I've found this question, which in both answers says to use

\setlength{\parindent}{0pt}

But this prevents me from using \indent when I want it. So the actual questions would be. Is there a way for latex to default to \noindent and then use \indent when necessary?

Edit: I'd also like to add that I'm still very new to typesetting, so if what I'm asking for is bad practice, please let me know, and if possible, why.

Best Answer

The following code saves the original meaning of \indent and redefines it. Inside a group it sets \parindent to the original value and calls the saved \indent:

\let\SavedIndent\indent
\protected\def\indent{%
  \begingroup
    \parindent=\the\parindent
    \SavedIndent
  \endgroup
}
\setlength{\parindent}{0pt}

Thus, like the original \indent the redefined indent starts a new paragraph if it is called in vertical mode. But it will not set the space in horizontal mode like the original.