Word clouds

A word cloud is like a picture made of words from a bunch of text. The more a word shows up, the bigger it appears in the cloud. It’s a fancy way to quickly see which words are most used in whatever you’re reading. People use word clouds to spice up presentations or to get a quick sense of the main themes in a text. Often, we play with colors, shapes, and sizes to make it look just right.

You can easily create one in LaTeX: use the wordcloud package and the command with the same name. Here, we do it with sans-serif text and rotated by 45 degrees, with selected words and weights:

\textsf{\wordcloud[scale=1,rotate=45,margin=0.5pt,usecolor]{(\textrm{\LaTeX},10);(graphics,6);
(fonts,7);(images,5);(tables,5);(bibliographies,2);(mathematics,3);(PDF,5);(headings,4);(paragraphs,3);
(diagrams,3);(commands,4);(packages,5);(classes,6);(hyphenation,2);(macros,6);(justification,2);
(footnotes,4);(cross-references,2);(spacing,3);(lines,4);(colors,5);(captions,5);(hyperlinks,3);
(chapters,5)}}

This gives us the following:

Simple word cloud

But let’s do this in real text. I chose the tutorial called “Formatting information” written by Peter Flynn with the file name “beginlatex.pdf”, converted it to text, and run the following command:

\wordcloudFile[usecolor]{beginlatex.txt}{80}

This generates a word cloud with 80 words:

Big word cloud

The full explanation is in LaTeX Cookbook, Chapter 7, Creating Beautiful Designs.