I was wondering if it was possible to use a variable within the document to quickly change a string. For example in my cover letter I want to insert the name of a different company but without changing the name manually.
So far I have used the command
\newcommand{\companyname}{Google }
Hi \companyname I want to ....
By \companyname, see you.
This method however causes problems with the text. It does not respect the space between the words that follow the command.
Result:
Hi GoogleI want to .... By Google, see you.
I thought about adding a space to the command but if I did this it would cause an extra space to the punctuation which does not suffer this effect.
Hi \companyname{} I want toorHi \companyname\ I want to– Phelype Oleinik Feb 18 '22 at 18:47xspaceand write\newcommand{\companyname}{NoGoogle\xspace}– Denis Feb 18 '22 at 19:00