1

I am trying to remove the white spaces following a custom macro. I am having the worst time understanding what is happening. I have looked through most of the answers here for how to remove white spaces but I cannot get it to work correctly.

\documentclass{article}

\NewDocumentCommand{\programName}{m}{% \textbf{#1} program }

\begin{document} I want to use the \programName{ProperItem}. I want to use the \textbf{ProperItem} program. \end{document}

Ingmar
  • 6,690
  • 5
  • 26
  • 47
Nebabon
  • 115
  • 3
    Put another % right after programm ... i.e. at the end of each line inside a macro definition. – MS-SPO Jun 13 '22 at 10:23

1 Answers1

4

You could replace

\NewDocumentCommand{\programName}{m}{%
  \textbf{#1} program
} 

with

\NewDocumentCommand{\programName}{m}{%
  \textbf{#1} program} 

If you don't want to move the closing curly brace up one line as suggested above, do place a % (comment symbol) immediately after program.


enter image description here

\documentclass{article}
\NewDocumentCommand{\programName}{m}{%
  \textbf{#1} program}

\begin{document} I want to use the \programName{ProperItem}.

I want to use the \textbf{ProperItem} program. \end{document}

Mico
  • 506,678
  • 1
    I had a brain fart and thought I had already added the "%" to it. I have the "}" on the next line because the stupid opinionated code formatter keeps messing indenting the rest of the lines. – Nebabon Jun 13 '22 at 13:13