LaTeX blindtext Package: Generate Dummy Text (“Blind” Text)

May. 22, 2024

Introduction

Few days ago, I learned about LaTeX lipsum package1, which is to generate Lorem Ipsum to test document layout. Those kinds of texts, like Lorem Ipsum with no any actual meanings, are also called dummy text, or “blind” text. In the process, I found another package blindtext2; it is also used to test document style, but compared with lipsum its generated contents cover more elements, including text, section and subsection style at each level, and lists created by different commands. It is more like to generate a template. In this post, I would record some basic usages of blindtext package.


Fundamental control commands of blindtext package

blindtext package provides two fundamental commands, \blinddocument and \Blinddocument. Both them are for creating random document2; the former is to create document, and the latter is to create a bigger one. Take testing IEEEtran template3 (to produce officially-correct output for the Institute of Electrical and Electronics Engineers (IEEE) transactions, journals and conferences):

\blinddocument command

1
2
3
4
5
6
\documentclass[lettersize,journal]{IEEEtran}
\usepackage{blindtext}

\begin{document}
	\blinddocument
\end{document}

png-1

\Blinddocument command

1
2
3
4
5
6
\documentclass[lettersize,journal]{IEEEtran}
\usepackage{blindtext}

\begin{document}
	\Blinddocument
\end{document}

At this time, 9 pages will be generated:

png-1

png-2

png-3

png-4

png-5

png-6

png-7

png-8

png-9


Display Table of Contents (TOC)

By default, \blinddocument and \Blinddocument won’t generate Table of Contents (TOC). We can use toc option to generate it:

1
2
3
4
5
6
\documentclass[lettersize,journal]{IEEEtran}
\usepackage[toc]{blindtext}

\begin{document}
	\blinddocument
\end{document}

png-1

png-2


Different language versions

At the default case, the generated text is a short-version Latin Lorem Ipsum1, repeating the following paragraph time and time again:


Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam lobortis facilisis sem. Nullam nec mi et neque pharetra sollicitudin. Praesent imperdiet mi nec ante. Donec ullamcorper, felis non sodales commodo, lectus velit ultrices augue, a dignissim nibh lectus placerat pede. Vivamus nunc nunc, molestie ut, ultricies vel, semper in, velit. Ut porttitor. Praesent in sapien. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Duis fringilla tristique neque. Sed interdum libero ut metus. Pellentesque placerat. Nam rutrum augue a leo. Morbi sed elit sit amet ante lobortis sollicitudin. Praesent blandit blandit mauris. Praesent lectus tellus, aliquet aliquam, luctus a, egestas a, turpis. Mauris lacinia lorem sit amet ipsum. Nunc quis urna dictum turpis accumsan semper.


Actually, in addition to Latin, blindtext also supports generating text in other languages, such as English, German, French, and Greek, which is realized by combining babel package45 and corresponding options.

English

1
2
3
4
5
6
7
\documentclass[lettersize,journal]{IEEEtran}
\usepackage[english]{babel}
\usepackage{blindtext}

\begin{document}
	\blinddocument
\end{document}

png-1

German

1
2
3
4
5
6
7
\documentclass[lettersize,journal]{IEEEtran}
\usepackage[german]{babel}
\usepackage{blindtext}

\begin{document}
	\blinddocument
\end{document}

png-1

French

1
2
3
4
5
6
7
\documentclass[lettersize,journal]{IEEEtran}
\usepackage[french]{babel}
\usepackage{blindtext}

\begin{document}
	\blinddocument
\end{document}

png-1

Greek

1
2
3
4
5
6
7
\documentclass[lettersize,journal]{IEEEtran}
\usepackage[greek]{babel}
\usepackage{blindtext}

\begin{document}
	\blinddocument
\end{document}

png-1


Other control commands in blindtext package

On another hand, blindtext package also provides some other commands to generate certain element individually, such as \blindtext (and \Blindtext), \blinditemize, \blindenumerate, \blinddescription, \blindlist, and \blindlistlist.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
\documentclass[lettersize,journal]{IEEEtran}
\usepackage{blindtext}

\begin{document}
	\verb*|\blindtext|
	\blindtext
	
	\verb*|\blinditemize|
	\blinditemize
	
	\verb*|\blindenumerate|
	\blindenumerate
	
	\verb*|\blinddescription|
	\blinddescription
	
	\verb*|\blindlist{itemize}[3]|
	\blindlist{itemize}[3]

	\verb*|\blindlist{enumerate}[3]|
	\blindlist{enumerate}[3]
	
	\verb*|\blindlistlist{itemize}[3]|
	\blindlistlist{itemize}[3]
	
	\verb*|\blindlistlist{enumerate}[3]|
	\blindlistlist{enumerate}[3]
\end{document}

png-1

It’s very convenient to use them to test text or list environment locally, for example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
\documentclass[lettersize,journal]{IEEEtran}
\usepackage{blindtext}
% For changing font typefaces, Refer to: https://www.overleaf.com/learn/latex/Font_typefaces
\usepackage[T1]{fontenc}
\usepackage{tgbonum}

\begin{document}
	\blindtext
	
	\textbf{\blindtext}
	
	{\Large \blindtext}
	
	{\fontfamily{cmr}\selectfont\blindtext} % Computer Modern Roman
	
	{\fontfamily{lmdh}\selectfont\blindtext} % Latin Modern Dunhill
	
	{\fontfamily{cmss}\selectfont\blindtext} % Computer Modern Sans Serif
	
	{\fontfamily{lmdh}\selectfont\blindlistlist{enumerate}[3]} % Latin Modern Dunhill
\end{document}

png-1


Test math environment

Besides, blindtext package also provides the \blindmathpaper control command to test math environment style:

1
2
3
4
5
6
7
\documentclass[lettersize,journal]{IEEEtran}
\usepackage{babel}
\usepackage{blindtext}

\begin{document}
	\blindmathpaper
\end{document}

png-1

However, as can be seen, \blindmathpaper can only generate some display equations created by identifiers $$ $$ or \[ \]; other formula environments are not included.


References