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?\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..\def
does 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!{\lipsum[1-2]}
.