Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I create a command,

\newcommand{\cmd}{b}

but when I use this command

a\cmd{}c

What I get is

a b c

but what I want is

abc

How can I remove two blanks?

share|improve this question
7  
Welcome to TeX.SX! With that definition and usage you'll get the second instance, not the first. Probably you should show your real case. –  egreg Jul 4 '12 at 14:51
    
A complete code is necessary because like egreg wrote, you should show your real case. Perhaps you want a b c ? –  Alain Matthes Jul 4 '12 at 16:35
3  
if you never want a space before or after the contents of the command, define it as \newcommand{\cmd}{\unskip b\ignorespaces}. –  barbara beeton Jul 4 '12 at 17:07
1  
If there are line breaks in your actual command definition, you need to add comment signs, see Why the end-of-line % in macro definitions?. –  Caramdir Jul 4 '12 at 17:45
    
You sure your definition does not contain spaces as in \newcommand{\cmd}{ b }. This would yield the result that you describe that you are getting. –  Peter Grill Jul 4 '12 at 17:49
show 1 more comment

closed as too localized by Marco Daniel, Joseph Wright Aug 4 '12 at 21:50

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Browse other questions tagged or ask your own question.