I have a macro that is purely functional (e.g. only defines other macros), and I want to be able to invoke this inline without any new paragraphs or blank spaces being typeset.
\documentclass{article}
\begin{document}
\def\test{
\gdef\a{1}
\gdef\b{1}
}
Hello {\test} world!
\end{document}
Following this, I was able to remove all \pars generated by blank lines.
\documentclass{article}
\begin{document}
\def\test{
\gdef\a{1}
\gdef\b{1}
}
Hello {\let\par\relax\test} world!
\end{document}
However, this results in a few spaces where the macro is called.
Is there a way to, more generally, suppress all typesetting within a group?
If not, is there a way to suppress all spaces within a group as well?







\defs in an external file which I\input. It would be pretty inconvenient to have to do this on every line. – rish987 Sep 06 '20 at 16:39