2

Suppose I'm defining a macro of some word I'm using a lot: \providecommand{\pv}{\emph{p-valor }} I already put the trailing space because most of the time it'll save from adding it manually (yes, I try to save myself from adding a space). However, sometimes I need to add a comma or something after the command, but using \pv. renders as

enter image description here

With a space after between the stop and the command. How do I prevent this space from appearing after the command? Note that removing it from macro definition is not an option and I'm looking for something between the command and the stop that "eats up" the trailing space.

Alan Munn
  • 218,180
mrbolichi
  • 260
  • If I understood correctly the two links you provided, the solutions are 1. Keeping the current definition of the macro and calling it with \pv{} or \pv{} as needed. This doesn't solve my problem. 2. Changing my definition to \providecommand{\pv}{\emph{p-valor\xspace}}, load the package xspace and call the command as stated in 1. None of those solutions give me the desired output. – mrbolichi Jul 10 '16 at 20:20
  • The xspace solution does do what you want. If it doesn't, please post a minimal example document that shows the problem. – Alan Munn Jul 10 '16 at 20:21
  • Nevermind, my mistake. I didn't supress the trailing space after adding \xspace to the macro. Please write an answer so I can mark it as accepted – mrbolichi Jul 10 '16 at 20:29
  • We've closed your question as a duplicate, so there is no need for a duplicate answer. – Alan Munn Jul 10 '16 at 20:29

0 Answers0