Many questions use lorem ipsum filler text from package lipsum. I am testing a regex script on text files nested within different folders. For this and to improve LaTeX understanding better I would like to output lipsum text into a plain text file.
A manual way is to run a LaTeX engine (say pdflatex), open the pdf and copy and paste into a plain text document. The \usepackage[T1]{fontenc} line have added to aid copying, but am unsure if this makes a difference to the lorem ipsum text.
Here are two ideas, but I do not know if these are feasible methods nor how to implement them if they are.
- Use pdflatex (or other command) flags.
- Use TeX command line tools to identify the file location within the lipsum package where the lorem ipsum text is located.
From these the lorum ipsum text could be obtained and redirected to a text file.
The functionality to vary the amount of lorum ipsum text may also be helpful, for example if output to three files they could each have a different amount of filler text. This would rule out 2. above.
The accepted answer here Is it possible to generate a set amount of words using lipsum? says “the output of \lipsum is protected, so the only way get the text is to copy it from a previous PDF”. An explanation of this is also welcome.
Best Answer
You can use
\unpacklipsum
:The generated file will be