the smallest heater with thermostat?

Visi-Therm's 50w is 7.5", which is probably one of the smallest and my favorite brand of heaters as well.

Tetra also makes one that's 5" or 6", but you can't adjust the temperature. It's permanently set to 78.
 
The Hydor Theo 50 watt is 7 inches long. I think that is the shortest I have ever seen with a selectable temp setting.
 
AquariaCentral.com