6

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?

  • Redefine \lipsum by adding \color? – user156344 May 15 at 15:30
  • It's rather easy to patch the \lipsum command to do so. Which version are you using? (The package had a major update last year.) You can use \listfiles to find out. – Phelype Oleinik May 15 at 15:30
  • @PhelypeOleinik I included \listfiles in the beginning before \documentclass, but where would this output appear? I guess i have the newest version, i am using overleaf with this template: overleaf.com/latex/templates/… – Leon D May 15 at 15:40
  • @LeonD The output of \listfiles goes to the log file. You have to (if I'm not mistaken) click the “Logs” button, next to “compile” and then “View raw log”. But overleaf has TeXLive 2017 I think, which contains the older version of lipsum. – Phelype Oleinik May 15 at 15:44
6

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}
  • Works nice, thank you. Only sideeffect: \lipsum without the brackets gives me many paragraphs of dummy text, not only one, so i have to add [1] afterwards. – Leon D May 15 at 21:36
  • 1
    @LeonD It's not a side effect, but a feature of the package which exists even without this patch. If you don't say how many paragraphs you want the package defaults to 1-7, so \lipsum gives the same as \lipsum[1-7]. You can change that with \setlipsumdefault{1}, for example, to give only the first paragraph or \setlipsumdefault{1-3} to give the first three. – Phelype Oleinik May 15 at 21:40
  • Thanks for the really friendly and quick help! – Leon D May 15 at 21:56
  • 1
    @LeonD You're welcome :-) – Phelype Oleinik May 15 at 21:57
7

How about

\documentclass{article}
\usepackage{xcolor}
\usepackage{lipsum}
\SetLipsumParListSurrounders{\colorlet{oldcolor}{.}\color{gray}}{\color{oldcolor}}
\begin{document}
Hello

\lipsum[1-2]

Hello hello

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

enter image description here

EDIT: @egreg kindly pointed out a simpler solution:

\SetLipsumParListSurrounders{\begingroup\color{gray}}{\endgroup}

Apart from being simpler it also avoids overwriting oldcolor which some other macro might be using.

  • 2
    Nice, but Overleaf :/ – Phelype Oleinik May 15 at 15:48
  • 1
    @PhelypeOleinik Oh, I didn't pay attention on this. ;-) In a few years it will work with overleaf, too, I suppose. ;-) (IMHO this reiterates this concern if there is a problem, and if there is no problem there is no problem. ;-) – user121799 May 15 at 15:51
  • 1
    Wouldn't \SetLipsumParListSurrounders{\begingroup\color{gray}}{\endgroup} be simpler? – egreg May 15 at 16:06
  • @egreg Probably it would, mille grazie! – user121799 May 15 at 16:17

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.