Following Is there a wider equal sign? and "For loop" in newcommand, I have come up with the naive command:
\newcount\tmp
\newcommand{\eqlong}[1][2]{% need this to prevent extra vertical space
=
\tmp=0
\loop
% increment dummy counter
\advance\tmp by 1
\joinrel=
% repeat the loop provided the counter is within specified bound
\ifnum\tmp<#1
\repeat
}
Supposedly, \eqlong3 for instance should produce =\joinrel=\joinrel=, i.e. an equal sign about 3 times as long as a normal equal sign. The command as I've written doesn't work, but I'm wondering if someone could fix it.
I know a post I linked above (and also Extendible equals sign) mention the extarrows package, but here I just want a symbol whose length I can control with a parameter I pass.




\eqlong[3](or\eqlongwith no argument). See this tutorial on the LaTeX syntax of\newcommand. – mbert Oct 31 '22 at 06:42\eqlong[3]actually defines a symbol that is four times as long as=(think about where in the code the loop checks whether or not to terminate). – mbert Oct 31 '22 at 06:48% need this to prevent extra vertical spacecan not be right. It does save one token of memory (as would%after the two=) – David Carlisle Oct 31 '22 at 10:28