Home » LaTeX2 June 2015

LaTeX: Generate dummy text (lorem ipsum) in your document

If we want dummy text in our document then we generally search for lorem ipsum text generators and copy-paste those texts/paragraphs in our document.

In LaTeX, we don’t need to do such copy and paste thing. LaTeX has different packages which automatically generates dummy text in our document. You can generate them with just a few lines of code.

1) USING LIPSUM PACKAGE

One of such package is the lipsum package.

Lipsum package has access to 150 paragraphs of “Lorem ipsum” dummy text.
lipsum[2-4] will print lorem ipsum paragraph 2 to 4.
lipsum[1-1] will only print lorem ipsum paragraph 1.

In the example below, lipsum package is used to print dummy text below chapter title. lipsum[2-4] prints lorem ipsum text from paragraph 2 to paragraph 4.

Below is the output pdf generated from the above LaTeX code:

2) USING BLINDTEXT PACKAGE

There is another package named blindtext which can generate a single paragraph of dummy lorem ipsum text to even an entire document with the dummy text.

\blindtext = This macro will generate a paragraph of dummy text
\BlindText = This macro will generate multiple paragraphs (one page long) of dummy text
\Blinddocument = This macro will generate an entire document of dummy text. If you specify documentclass as report then \Blinddocument will generate the document with multiple chapters, sections, subsections, paragraphs, and itemized lists.

The below example contains LaTeX code that uses blindtext package to create an entire document with the dummy text.

Below is the output pdf generated from the above LaTeX code:

Hope this helps.
Thanks.

LaTeX

Get New Post by Email

Find me on

FacebookTwitterGoogle+LinkedInRSS Feed