I need to write idb in math mode. But a space appears after id and I get id b. How can I remove this space?
Code example:
$idb$ As I suggest idb here is meant to be a three-character variable. If this is the case you can write it in math mode as follows:
$\mathit{idb}$
Then you get the correct spacing because LaTex assumes idb is just i times db here and db is treated as a differential term.
If you mean the multiplication just write it as follows:
$idb$
An image is provided for the first (upper) and the second (lower) approach.

$idb$: i.sstatic.net/IFAid.png There is no strange space, so it's necessary you give some more information.