I'm trying to write my own document class for a report, i.e. to modify little bit LaTeX existing document class report.cls.
So.. I was just wondering, what does \relax command do? For example, I'm rewriting \maketitle command, and there is a bunch of \let\thanks\relax, \let\maketitle\relax etc. Why?
And what does \null\vfil do?
Thanks!!
LaTeX forum ⇒ General ⇒ What does \relax do? Topic is solved
What does \relax do?
Hi,
The example
In some circumstances
Regards
\relax
effectively does nothing.The example
\let\thanks\relax
in a way undefines \thanks
. Now \newcommand*\thanks{<whatever>}
wouldn't raise any errors.In some circumstances
\relax
can also be used to stop some scanning process like in \ifx\mynum=1\relax
(the 1 could just as well be the beginning of a larger number but \relax
stops the \ifx
from looking).\null
inserts an empty box (it is defined to \hbox{}
). \vfil
is a vertical space that can have an arbitrary length (it fills the available vertical space, like \vspace{\fil}
).Regards
site moderator & package author
- Stefan Kottwitz
- Site Admin
- Posts: 10211
- Joined: Mon Mar 10, 2008 9:44 pm
What does \relax do? Topic is solved
\relax
does nothing. However, it is unexpandable. In some situations TeX expands commands until it reaches an unexpandable command, that's why \relax
can be used to stop expansion or to indicate the end of a command.Here,
\let\thanks\relax
causes that a possibly previously defined \thanks
command now does nothing.\null
is just an empty (horizontal) box. For example, since some commands have no effect at the beginning of a page, you could insert such an empty box just to have something before such a command, like \vfil
or \vfill
. Instead of this, you could simply use \vspace*{\fil}
or \vspace*{\fill}
.Stefan
LaTeX.org admin
Re: What does \relax do?
Thanks! This was very helpful!!!
Who is online
Users browsing this forum: No registered users and 8 guests