The difference is in the time at which the ‘right hand side’ is evaluated.
Thus \let\foo\bar
defines \foo
to have the value that \bar
had at the point of definition. On the other hand, \def\foo{\bar}
in effect defines \foo
to have the value that \bar
has at the point of use.
Consider:
\def\bar{hello}
\let\fooi\bar
\def\fooii{\bar}
\fooi +\fooii
\def\bar{goodbye}
\fooi +\fooii
This produces
hello+hello
hello+goodbye
This is a simple process.
However it's also a subtle one, so it might be worth highlighting a few key points:
When TeX encounters control sequences such as \fooi
, it evaluates them; if these are macros (that is, they have been defined by \def
, or \let
equal to something which was defined by \def
), then the result is that they will expand to other tokens, which TeX will then examine in turn, and so on, recursively, until what's left is either ‘primitive’ control sequences or letters (I'm simplifying a little bit).
\fooi
expands directly to the characters hello
(because \bar
initially did, and \fooi
was defined to have the same value).
\fooii
, in contrast, expands to \bar
, which is then immediately reexamined and reexpanded. In the first case, \bar
expands to hello
and in the second case to goodbye
. The definition of \fooii
hasn't changed, but \bar
has been redefined in between.
Getting a clear idea of the process of this recursive expansion is very helpful when learning how to develop and debug TeX macros.
\my@name
and \myname
are in different 'namespace' of TeX.
The catcode of @
are different in a .tex
file and a .cls
file. @
is a letter in a .cls
or .sty
file (catcode 11); but an 'other character' in a .tex
file (catcode 12). (see TeXbook, Ch 8)
Therefore, a user of your class file cannot use \my@name
directly in .tex
file, it is protected; but (s)he can use \myname
freely.
Macros with @
like \my@name
are used for internal macros. They slould not be accessed by normal users. While macros without @
like \myname
are used for interface macros, that should be used by normal users.
An example (it's silly, for demostration only):
% setname.sty
\providecommand\setname@name{}
\newcommand\setname[1]{%
\renewcommand\setname@name{#1}}
\newcommand\getnameinparens{%
(\setname@name)}
\endinput
Package users can use \setname
to set the name and \getnameinparens
to get the (name). However, they cannot access \setname@name
, unless \makeatletter
is used.
Best Answer
\vspace{\fill}
and\vfill
are not exactly equivalent. They are if they appear between paragraphs, but not if they appear in a paragraph.\vspace{\fill}
in a paragraph will add the filling vertical space below the line in which it eventually appears;\vfill
ends the paragraph at the spot and adds the filling vertical space.Indeed
\vfill
is a TeX primitive, while\vspace
is defined by LaTeX to have the described effect when found in a paragraph. In vertical mode,\vspace{<glue>}
is equivalent to the primitive\vskip<glue>
. See \vspace vs. \vskip for more information.There is no
\vfill*
, if you're asking about this. The difference between\vspace{<glue>}
and\vspace*{<glue>}
is that the latter is not discarded at page breaks. See Question about spacing \hspace and \vspace.