I am defining a command that uses an subscript somewhere. I want the subscript to dissappear when I leave its corresponding command-input open, but then LaTeX will trow an error since no character was put in the subscript. Now I want to type a dummy character after the input to ensure that at least one character is printed at all times. However, I don't want this dummy character to show up. It just needs to be there to decieve LaTeX.
If I type \infty, I get an infinity symbol, if I print the character I am asking for, LaTeX prints a character that has no black.
In this code, the command \spacechar takes the role of the character I want
\newcommand{\tup}[3]{(-\; #1 -\! \underset{\! #2 \,\,\,}{)_{#3\spacechar}}}
instead of
\newcommand{\tup}[3]{(-\; #1 -\! \underset{\! #2 \,\,\,}{)_{#3}}}
which breaks when #3 is empty.
Some example of the code in action
\documentclass{article}
\usepackage{amsmath}
\usepackage{mathtools}
\newcommand{\tup}[3]{(-\; #1 -\! \underset{\! #2 \,\,\,}{)_{#3}}}
\begin{document}
\noindent $\tup{x_i}{i}{n}$\\
$(-\; x_i -\! \underset{\! \,\,\,}{)}$
\end{document}
Something like this is also useful in many other places where LaTeX, such as when LaTeX wants to remove whitespace at the beginning of a sentence.
This is a slightly related but unsatisfying answer. Whitespace as wide as a character It gives whitespace commands, which are not actual characters. They are whitespace, and whitespace can't decieve LaTeX.
This is also not what I'm looking for. Explicit space character? Instead of invisible characters it gives me visible whitespace.
In short, I want a character that prints absolutely nothing.





$a_{}$works just fine. – Steven B. Segletes Oct 18 '19 at 15:02a_{}ora_{b}will work. – Phelype Oleinik Oct 18 '19 at 15:03xparseand all of its goodies of parsing arguments, graping subscripts etc. – daleif Oct 18 '19 at 15:40#3is absent, it compiles, but moves#2relative to the closing paren. What is it you actually want when#3is missing? – Steven B. Segletes Oct 18 '19 at 15:45_{}is not an error? – David Carlisle Oct 18 '19 at 15:59