LaTeX What is the difference between a macro with no arguments and a name?

  • Thread starter Thread starter Eclair_de_XII
  • Start date Start date
  • Tags Tags
    Difference
Click For Summary
The discussion centers on the distinction between a name and a macro in LaTeX, using the examples "\PFlink" as a name and "\linkToPF" as a macro. Both serve the same function of linking to Physics Forums, but the question arises about how to demonstrate their differences without referring to definitions. It highlights that a name is effectively a constant, while a macro can take arguments, though both yield the same output in this context. The conversation also touches on the redundancy of constants in symbolic logic, paralleling the LaTeX discussion. Understanding these distinctions is important for proper usage in LaTeX documents.
Eclair_de_XII
Messages
1,082
Reaction score
91
TL;DR
Quick question. Title gives the most straight-forward version of it.
This is some sample code that I drew up.

The name is "\PFlink"
The macro is "\linktoPF"

My question is this: Would you be able to tell which is the name and which is the macro without referring to their respective definitions in the pre-amble below?

[CODE highlight="5-6"]\documentclass{article}

\usepackage{hyperref}

\def\PFlink{\href{https://www.physicsforums.com/}{Welcome to Physics Forums!}}
\newcommand{\linkToPF}{\href{https://www.physicsforums.com/}{Welcome to Physics Forums!}}

\begin{document}

\paragraph{Names vs. Macros}
These are links to PhysicsForums.com. One of them is in the form of a name and the other in the form of a macro.
\begin{description}
\item[name] \PFlink
\item[macro] \linkToPF
\end{description}

\end{document}[/CODE]

Functionality-wise, they both seem to do exactly the same thing: link to this site. Are they different in any way, or no? If so, how would you show someone that they are different without telling the arbitrary novice to just look at the definitions of them in the pre-amble?
 
Physics news on Phys.org
The two are functionally equivalent.

This same phenomenon occurs in symbolic logic, where the objects one works with in a language are predicates (eg '='), functions (eg '+'), variables (eg '##x##') and constants (eg '1'), but the concept of constant is redundant because a constant is just a function with no arguments (a 0-ary function, or function with arity zero, in logic jargon). That is, it requires no inputs, and always gives the same output.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 8 ·
Replies
8
Views
12K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 11 ·
Replies
11
Views
6K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
2
Views
2K
  • · Replies 16 ·
Replies
16
Views
4K
Replies
1
Views
1K
  • · Replies 4 ·
Replies
4
Views
1K