# Is there an equivalent of lipsum for shorter sections of text?

The sections of text generated by lipsum are generally several lines long. Is there a simple way to generate shorter segments of random (generic) text (other than typing it, of course)?

-
add comment

## 3 Answers

This is a home brewed macro called \loremlines. Call as \loremlines{number of lines}. Note differences in multi column texts.

% Split a box into two
\documentclass{article}
\usepackage{lipsum,multicol}
\begin{document}
\newbox\one
\newbox\two
\long\def\loremlines#1{%
\setbox\one=\vbox {%
Test.\footnote{a footnote}%
\lipsum\footnote{Another footnote.}%
}
\setbox\two=\vsplit\one to #1\baselineskip
\unvbox\two}
\begin{multicols}{2}
\small
\loremlines{16}
\end{multicols}
\begin{multicols}{2}
\small
\loremlines{16}
\end{multicols}
\loremlines{5}
\end{document}


The code works by placing the contents of a \lipsum command in a box and then splitting it, at n\baselineskip, where n is the number of lines.

-
add comment

The blindtext-package offers some optional settings:

\documentclass[english]{article}
\usepackage{babel}
\usepackage[pangram]{blindtext}
\begin{document}
\Blindtext[5][3]%5 paragraphs, each 3 pangrams
\end{document}


Remark: The pangram option was introduced this January 2012 with version 2.0. Maybe you need an update.

-
add comment

You could copy and paste paragraphs of the desired length from http://www.blindtextgenerator.com/. Obviously, this is no LaTeX or packaged version.

Btw, if you'd want to stick with lipsum, it seems to me that \lipsum[66] and \lipsum[75] are the shortest paragraphs, each generating almost exactly four lines with article standard settings.

Here's how I counted the lines:

\documentclass{article}

\usepackage{lipsum,lineno}

\makeatletter
\renewcommand{\lips@par}% patching lipsum's the end-of-paragraph command
{\par\section{~~\the\c@linenumber}%extra space for ToC
\resetlinenumber}
\makeatother

\begin{document}

\tableofcontents

\linenumbers\noindent
\lipsum[1-150]

\end{document}


And then I went through the ToC by hand, i.e. by eye. LuaTeX probably could've done it automatically.

-
... and has moreorless the same functionality as lipsum.org –  tohecz Mar 17 '12 at 20:58
@tohecz: Yes, but a cleaner interface :) –  doncherry Mar 17 '12 at 22:14
add comment