Views
5 months ago

sample

If used as explained

If used as explained above, the paragraphs generated by \lipsum will be separated by the macro \par, or, more precisely, every paragraph will be terminated by \par. Sometimes, this may cause some unintended effects. Therefore the package provides the option nopar that causes \lipsum to omit the terminating \par. For this purpose, the package should be included via \usepackage[nopar]{lipsum} \lipsum* \ChangeLipsumPar Furthermore, a starred version of \lipsum, \lipsum*, exists that, with respect to the terminating \par, does the opposite of \lipsum: If no option is provided, it omits the insertion of \par after each paragraph (and inserts \relax instead), if the option nopar is provided, it typesets the paragraphs separated by \par. Note that \lipsum* calls the macro \ChangeLipsumPar inside a group and subsequently calls the internal macro \@lipsum that generates the output. \ChangeLipsumPar alternates the internal macro \lips@par between \relax and \par. \lips@par is called at the end of each paragraph and therefore \ChangeLipsumPar provides a switch to alter the output of this package within a single document when it is required to avoid additional groups. Advanced macros \lipsumexp While I never expected this package, which was intended to provide some filling text while testing page layouts or similar things, to provide advanced macros, I am happy that lipsum is used so frequently. However, as you can imagine from the sparse updates of the package, I’m not spending a lot of time with TEX development any more, hence the following macros have not been testet exhaustively and are somewhat experimental. Thus, the code of these macros is documented (although sparsely, see below). It turned out that some people need access to the expanded content of the \lipsum macro, that is, the mere text. The easiest way for this would be simply to use one of the internal macros that store the text like \lipsum@i or similar. Anyway, egreg posted a solution on stackexchange.com 1 , the macro \unpacklipsum, that made (slightly altered) its way into the package now (in v1.3). The general idea is the following: First, a macro is called that stores the expanded content of the \lipsum command in a second macro. In contrast to the posting from egreg, the name of this second macro is fixed in lipsum, it is \lipsumexp. Therefore, everytime you need access to the expanded content 1 https://tex.stackexchange.com/questions/26806/expanding-edef-a-lipsum-command 2

\unpacklipsum \unpacklipsum* \UnpackLipsum \UnpackLipsum* of \lipsum, use \lipsumexp. To control the content of \lipsumexp, lipsum provides four macros which all take one optional argument. This argument provides the paragraphs which should be included in \lipsumexp and should have the same form as the optional argument of \lipsum. If the optional argument is omitted, the paragraphs provided by \setlipsumdefault are used. The macro \unpacklipsum stores the content of the paragraphs specified by its optional argument and stores them in the macro \lipsumexp. Depending on whether lipsum was loaded with or without the option nopar, the paragraphs are separated by either \par or \relax (as long as \lips@par was not changed). The starred version \unpacklipsum* is the corresponding counterpart, as \lipsum* is for \lipsum. While most users who need the expanded content of \lipsum want to get rid of the terminating \pars, there might be some situations where the separating \relax is annoying, too. The macro \UnpackLipsum terminates the paragraphs of Lorem ipsum by a space (independent from the package option nopar), hence the content of \lipsumexp consists only of characters. The fourth macro, \UnpackLipsum*, separates the paragraphs of Lorem ipsum by the (unexpanded) macro \lips@par. This allows controlling the content of the separating macro when \lipsumexp is expanded. However, note that redefining \lips@par changes the behaviour of all \lipsum macros in the remaining document, hence keep the redefinition local. Thanks All paragraphs are taken with permission from http://lipsum.com/. Thanks to James Wilson for his work. Furthermore, stackexchange.com user egreg has to be mentioned here for his/her improvements of lipsum on stackexchange which eventually made their way into version 1.3 of lipsum.sty. 3

Accessible Template Sampler