Just trying to debug some stuff, and I thought about 'expanding' a \lipsum[1-2] statement using \edef into a new command (that would contain the "raw" text); strangely I cannot get it to work; this example:
\documentclass{article}
\usepackage{lipsum}
\begin{document}
% \lipsum[1-2] % works fine
\edef\mycommand{\lipsum[1-2]}
\mycommand
\end{document}
... crashes with:
! Undefined control sequence.
\GenericError ...
#4 \errhelp \@err@ ...
l.9 \edef\mycommand{\lipsum
[1-2]}
How would I go about "unpacking" the 'contents' of the \lipsum command into a new command?
Thanks in advance for any answers,
Cheers!
\def\mycommand{\lipsum[1-2]}be enough? – Gonzalo Medina Aug 28 '11 at 21:38\lipsum[1-2]as an argument to another command; and that one apparently crashes at the bracket[; so I though, well, I'll just "extract the contents" into a new command without arguments, and then I'd use that..\defdoes indeed work, but seemingly it will not expand down to the actual words contained in the \lipsum - I'm suspecting that would be the way to go if I want to cheat that original problem. Thanks for the feedback @Gonzalo Medina - cheers! – sdaau Aug 28 '11 at 21:42{\lipsum[1-2]}. – Aug 29 '11 at 06:10\unpacklipsumis now in the packagelipsumby default -- just refer to the documentation. And the internal macros as mentioned below no longer exist. – user202729 Apr 02 '23 at 00:33