[Tex/LaTex] Why duplicate symbol commands

symbols

I am wondering why so many duplicates of a symbol exist in latex. Let me provide some:
For prime I know two types: 1. $f'$ 2. $f^\prime$
in Wiki Prime Symbol it is explained why \prime is introduced:

"LaTeX provides an oversized prime symbol, \prime for use in subscripts [for example $f_\prime$]"

Yet I wonder why an oversized symbol? Or the backslash: 1. \backslash 2. \setminus what is the difference? For a long list of slashes in latex visit unicode slashes. I can't understand why so many duplicates and if I don't know the difference, maybe I use it in wrong place. BTW I don't mean the characters that have minor differences (like \nu and \upsilon which look nearly the same).

How can I make sure I am using the correct symbol despite the similar look?
What is the real difference between them?

Best Answer

For many symbols it’s just that the purpose is different. Consider the set minus: what you want there isn’t a backslash. You really want a “set minus” – which just happens to be displayed (sometimes) identically to a backslash. But it’s still fundamentally different.

Now, which of the two LaTeX codes is more readable:

\mathcal{F} \backslash \{ 0 \}
% or
\mathcal{F} \setminus \{ 0 \}

If the two are really identical (which I don’t believe since as Carsten points out there’s always the issue of spacing in math mode) one can simply be defined in terms of the other – e.g.:

\newcommand*\setminus{\backslash}

No harm in that. This still makes the usage more readable (see above) and the macro can be exchanged very quickly if you decide that the symbol should be displayed differently. For example, consider that the set minus is actually often written like a normal minus instead of like a backslash. If you have used the \backslash command, you now need to change all occurrences of that in your document.

If you have used a dedicated command then you only need to redefine that:

\newcommand*\setminus{\ensuremath{{}-{}}}

In practice, I redefine aliases for almost all macros that I use to fit my current use-case.

Related Question