Text Formattingreproduce large amounts of text

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
bobbylou
Posts: 18
Joined: Tue Apr 21, 2009 6:54 pm

reproduce large amounts of text

Post by bobbylou »

I am writing a document in which I want to print identical text a few times per page (separated by some space). Unless there is some other way, I was trying to define a new command consisting of the text and then calling the command a few times in the document. This seems to work fine if the command is just text; however, I want the command to include other commands, such as \begin{figure}...\end{figure}, etc. This doesn't seem to work. So for example:

Code: Select all

\newcommand{\cmd}{
\begin{figure}
...
\end{figure}
}

\begin{document}

\cmd \bigskip \cmd

\end{document}
gives an error. Any advice? Thanks.
Last edited by bobbylou on Wed May 25, 2011 7:03 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

torbjorn t.
Posts: 162
Joined: Wed Jun 17, 2009 10:18 pm

Re: reproduce large amounts of text

Post by torbjorn t. »

Your example (when a \documentclass statement is added) compiles fine here, so something else is wrong.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

Re: reproduce large amounts of text

Post by Stefan Kottwitz »

The figure environment is a floating environment. So it doesn't work in all places. Perhaps this may be the problem, if you use \cmd at an unsuitable place.

Stefan
LaTeX.org admin
Post Reply