lipsum, blindtext and kantlipsum all seem to default to producing paragraphs, whereas I want them to generate individual sentences. From the documentation, it looks as if it should be possible to make the random option in blindtext produce individual sentences, but I can't get that to work:


I get

Package blindtext Warning: Option random not defined for english

Now, the documentation on random does say:

If the language does not support this option, the default text is used.

But it's a little surprising that it doesn't support English... am I doing something wrong?


You can use the following variant of lipsum.sty that will produce sentences instead of paragraphs; save the following file as sentlipsum.sty in your current working directory or in your local tree:

%% This is file `sentlipsum.sty',
%% A small variation of 'lipsum.sty' originally written by Patrick Happel
\ProvidesPackage{sentlipsum}[2012/12/16 v1.0 150 sentences of Lorem Ipsum dummy text]
%% \CharacterTable
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}



    \csname sentlipsum@\roman{sentlips@count}\endcsname\ %




\newcommand\sentlipsum@i{Lorem ipsum dolor sit amet, consectetuer
  adipiscing elit.}

\newcommand\sentlipsum@ii{Nam dui ligula, fringilla a, euismod sodales,
  sollicitudin vel, wisi.}

\newcommand\sentlipsum@iii{Nulla malesuada porttitor diam.}

\newcommand\sentlipsum@iv{Quisque ullamcorper placerat ipsum.}

\newcommand\sentlipsum@v{Fusce mauris et vestibulum luctus nibh at lectus.}

\newcommand\sentlipsum@vi{Ut lorem lorem, interdum
  eu, tincidunt sit amet, laoreet vitae, arcu.}

\newcommand\sentlipsum@vii{In hac habitasse platea

\newcommand\sentlipsum@viii{Pellentesque habitant morbi tristique senectus
  et netus et malesuada fames ac turpis egestas.}

\newcommand\sentlipsum@ix{Morbi luctus, wisi viverra faucibus pretium,
  nibh est placerat odio, nec commodo wisi enim eget quam.}

\newcommand\sentlipsum@x{Suspendisse vitae elit.}

\newcommand\sentlipsum@xi{Cum sociis natoque penatibus et
  magnis dis parturient montes, nascetur ridiculus mus.}

\newcommand\sentlipsum@xii{Fusce facilisis lacinia dui.}

\newcommand\sentlipsum@xiii{Nullam elementum, magna in cursus sodales, augue est scelerisque sapien, venenatis congue nulla arcu et pede.}

\newcommand\sentlipsum@xiv{Etiam ac leo a risus tristique nonummy.}

\newcommand\sentlipsum@xv{Praesent eros nulla, congue
  vitae, euismod ut, commodo a, wisi.}

\newcommand\sentlipsum@xvi{Nulla mattis luctus nulla.}

\newcommand\sentlipsum@xvii{Curabitur tellus magna, porttitor a, commodo
  a, commodo in, tortor.}

\newcommand\sentlipsum@xviii{Donec et nisl at wisi luctus bibendum.  Nam
  interdum tellus ac libero.}

\newcommand\sentlipsum@xix{Nulla non mauris vitae wisi posuere convallis.}

\newcommand\sentlipsum@xx{Nullam urna nulla, ullamcorper
  in, interdum sit amet, gravida ut, risus.}

\newcommand\sentlipsum@xxi{Etiam pede massa, dapibus vitae, rhoncus in,
  placerat posuere, odio.}

\newcommand\sentlipsum@xxii{Etiam suscipit aliquam arcu.}

\newcommand\sentlipsum@xxiii{Donec et nisl id sapien blandit mattis.}

\newcommand\sentlipsum@xxiv{Vestibulum pharetra nulla
  at lorem.}

\newcommand\sentlipsum@xxv{Vivamus eu tellus sed tellus consequat

\newcommand\sentlipsum@xxvi{Duis aliquet dui in est.}

\newcommand\sentlipsum@xxvii{Donec vel nibh ut felis consectetuer laoreet.}

\newcommand\sentlipsum@xxviii{Donec molestie, magna ut luctus ultrices,
  tellus arcu nonummy velit, sit amet pulvinar elit justo et mauris.}

\newcommand\sentlipsum@xxix{Cras dapibus, augue quis scelerisque
  ultricies, felis dolor placerat sem, id porta velit odio eu elit.}

\newcommand\sentlipsum@xxx{Sed mattis, erat sit amet gravida malesuada,
  elit augue egestas diam, tempus scelerisque nunc nisl vitae libero.}

\newcommand\sentlipsum@xxxi{Sed consequat tellus et tortor.}

\newcommand\sentlipsum@xxxii{Duis malesuada interdum

\newcommand\sentlipsum@xxxiii{Sed eleifend, eros sit amet faucibus
  elementum, urna sapien consectetuer mauris, quis egestas leo justo
  non risus.}

\newcommand\sentlipsum@xxxiv{Nullam eleifend justo in nisl.}

\newcommand\sentlipsum@xxxv{Class aptent taciti sociosqu ad litora
  torquent per conubia nostra, per inceptos hymenaeos.}

\newcommand\sentlipsum@xxxvi{Nulla malesuada risus ut urna.}

\newcommand\sentlipsum@xxxvii{Donec tempus neque vitae est.  Aenean egestas
  odio sed risus ullamcorper ullamcorper.}

\newcommand\sentlipsum@xxxviii{Fusce suscipit cursus sem.}

\newcommand\sentlipsum@xxxix{Praesent sed neque id pede mollis rutrum.}

\newcommand\sentlipsum@xl{Sed gravida lectus ut purus.}

\newcommand\lipsum@xli{Vivamus non justo in dui mattis posuere.}

\newcommand\lipsum@xlii{In suscipit mauris a
  dolor pellentesque consectetuer.}

\newcommand\lipsum@xliii{Maecenas accumsan dapibus sapien.}

\newcommand\lipsum@xliv{Phasellus fringilla, metus id feugiat
  consectetuer, lacus wisi ultrices tellus, quis lobortis nibh lorem
  quis tortor.}

\newcommand\lipsum@xlv{Cras egestas ipsum a nisl.}

\newcommand\lipsum@xlvi{Vivamus fringilla, enim et commodo
  malesuada, tortor metus elementum ligula, nec aliquet est sapien ut

\newcommand\lipsum@xlvii{Vivamus ante ante, mattis laoreet, posuere eget, congue vel, nunc.}

\newcommand\lipsum@xlviii{Quisque posuere metus viverra pede.}

\newcommand\lipsum@xlix{Vivamus augue purus, laoreet in, scelerisque vel,
  commodo id, wisi.}

\newcommand\lipsum@l{Quisque facilisis auctor sapien.}

\newcommand\lipsum@li{Aliquam volutpat auctor lorem et cras placerat est vitae lectus.}

\newcommand\lipsum@lii{Suspendisse porta fermentum mauris.}

\newcommand\lipsum@liii{Phasellus placerat vulputate quam.}

\newcommand\lipsum@liv{Maecenas ultrices mi
  sed diam.}

\newcommand\lipsum@lv{Nullam elit sapien, eleifend eu,
  commodo nec, semper sit amet, elit.}

\newcommand\lipsum@lvi{Morbi tincidunt posuere arcu.}

\newcommand\lipsum@lvii{Nunc interdum elementum urna.}

\newcommand\lipsum@lviii{Nulla sit amet nisl at
  sapien egestas pretium.}

\newcommand\lipsum@lix{Nunc tincidunt, risus quis bibendum
  facilisis, lorem purus rutrum neque, nec porta tortor urna quis

\newcommand\lipsum@lx{Vestibulum in leo eu erat tristique mattis.}

%% End of file `sentlipsum.sty'.

The main command is \sentlipsum and it behaves in a fashion similar to \lipsum (from the lipsum package): \sentlipsum produces seven sentences; \sentlipsum[<number>], where <number> is an integer between 1 and 60 produces the sentence whose number corresponds to <number>, and \sentlipsum[<number1>-<number2>] produces <number2>-<number1>+1 sentences, starting from the one associated to <number1> and ending with the one associated to <number2> (again, both numbers must be integers between 1 and 60).







enter image description here

I only used scratcl and the parfill=full* option to quickly get a visual separation between paragraphs for the example.

  • 1
    It looks like you put in a lot of work to get that working... I feel rather bad about saying that the main point was to be able to use an ipsum variant in a compact MWE. – Mohan Dec 17 '12 at 4:02
  • @Mohan in fact, I will be using this new variant a lot since I often need sentences instead of whole paragraphs for some of my answers and test codes, so the time used (it was not much, by the way) was well spent ;-) – Gonzalo Medina Dec 17 '12 at 14:05

Here's a sentence generator based on kantlipsum:

\NewDocumentCommand{\kantsentences}{ O{1} m }
  \kgl_sentences:nn { #1 } { #2 }

\cs_new_protected:Npn \kgl_sentences:nn #1 #2
   \cs_set_eq:NN \kgl_number:n \use_none:n
   \cs_set_eq:NN \kgl_par: \prg_do_nothing:
   \tl_gclear:N \g_tmpa_tl
   \prg_replicate:nn { #2/5 + 1 }
     \tl_set:Nx \l_tmpa_tl { \seq_item:Nn \g_kgl_pars_seq {#1} }
     \tl_gput_right:Nx \g_tmpa_tl { \tl_use:N \l_tmpa_tl }
     \tl_gput_right:Nn \g_tmpa_tl { ~ }
  \seq_set_split:NnV \l_tmpa_seq {.} \g_tmpa_tl
  \int_step_inline:nnnn { 1 } { 1 } { #2 }
    \seq_item:Nn \l_tmpa_seq { ##1 } .\par


\section{Four sentences}


\section{Nine sentences}



I use the fact that generally the Kantian paragraphs consist of seven sentences. So I divide the requested number by five and add one, then I gather this number of Kantian paragraphs in a unique token list, from which I extract the requested number of sentences.

The optional argument to \kantsentences is the initial Kantian paragraph (default 1).

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.