[Tex/LaTex] How to make dumthe text (like \lipsum) grey

colorlipsumoverleaf

I would like to make my dummy text more distinguishable from the normal text, so I can better determine the progress by making it for example grey?

Can I adjust the \lipsum command, so it applies this behavior every time I use the command?

Best Answer

In newer versions of lipsum, \SetLipsumParListSurrounders is being deprecated, so you can use \setlipsum instead:

\documentclass{article}
\usepackage{xcolor}
\usepackage{lipsum}
\setlipsum{%
  par-before = \begingroup\color{gray},
  par-after = \endgroup
}
% or:
% \setlipsum{%
%   par-before = \colorlet{oldcolor}{.}\color{gray},
%   par-after = \color{oldcolor}
% }
\begin{document}

Hello

\lipsum[1-2]

Hello hello

\textcolor{red}{Hello again \lipsum[3] and again}

\end{document}

One of the versions above uses \begingroup\color{gray}...\endgroup, which may cause issues with wrapfig. The other version uses two \color commands, which may overflow the colour stack if used too often.

And for older versions of lipsum, which don't have \SetLipsumParListSurrounders

\documentclass{article}
\usepackage{lipsum}
\usepackage{xcolor}

\makeatletter
\renewcommand\lips@dolipsum{%
  \ifnum\value{lips@count}<\lips@max\relax
    \addtocounter{lips@count}{1}%
    \begingroup
      \color{gray}% <--- Change color here
      \csname lipsum@\romannumeral\c@lips@count\endcsname
    \endgroup
    \expandafter\lips@dolipsum
  \fi
}
\makeatother

\begin{document}

Hello

\lipsum[1-2]

Hello hello

\textcolor{red}{Hello again \lipsum[3] and again}

\end{document}