Re: Defining a new coverpage for article
- From: Vilar Camara Neto <neto@xxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 27 Jan 2006 15:50:25 -0200
cristiano.paris@xxxxxxxxx wrote:
All I get is a poor "! Undefined control sequence." error from LaTeX.
That's right. Where is \foo and \bar defined? (with either \newcommand{\foo}{...} or \def\foo{...})
The only definition I see in your code snippet is inside \coverpage, which means that \foo and \bar will be defined only after the first call of \coverpage. But even so, this leads to the problem I'll explain below.
(By the way, it's \newcommand{\commandname}{...}, not \newcommand\commandname{...}.)
I've tried to move the \let statements out of the "\newcommnad\coverpage" scope but then the error becomes:
! LaTeX Error: Missing \begin{document}.
Right. You say \global\let\foo\relax, which means "let \foo be globally a synonym for \relax". And \relax basically means "nothing". So, when you say
\foo{this is foo}it means (since \foo=\empty)
{this is foo}which is purely a normal text. Since it occurs before \begin{document}, it's illegal.
Can any of you guys provide a minimal example of a simple document class implementing such a feature?
In myarticle.cls:
\newcommand{\foo}[1]{\def\@foo{#1}}
\newcommand{\bar}[1]{\def\@bar{#1}}\newcommand{\coverpage}{%
\@foo\\
\@bar
}This way, your example.tex works as expected (if I correctly understood your problem).
-- Regards, Vilar Camara Neto .
- References:
- Defining a new coverpage for article
- From: cristiano . paris
- Defining a new coverpage for article
- Prev by Date: Defining a new coverpage for article
- Next by Date: Re: tabular in itemize - height justification problems
- Previous by thread: Defining a new coverpage for article
- Next by thread: Re: Defining a new coverpage for article
- Index(es):
Relevant Pages
|