I have a considerable amount of TeX documents that will be displayed on a website. The problem is, for this specific set of users, trigonometric functions such as \tan{x} are spelled differently - tg x in that case.
So, I approached this issue knowing the following LaTeX command
\providecommand{\tan}{}\renewcommand{\tan}{\hspace{2pt}\mathrm{tg\,}}
Including \, is necessary to render \tan{2x} as tg 2x. However, such addition causes \tan(2x) to be rendered with an unnecessary space before the argument: tg (2x)
How could I conditionally include that \, based on the presence of curly brackets?
\let\tan\undefined. – Joseph Wright Aug 12 '20 at 11:42\DeclareMathOperatorfrom amsmath. – David Carlisle Aug 12 '20 at 18:38