The thermomechanical Lehmann coefficient ν is directly measured as a function of temperature in a compensated cholesteric liquid crystal. The method consists of observing the continuous rotation of the director in samples treated for planar sliding anchoring when a temperature gradient is applied perpendicularly to the director. The main result is that there is no relationship between the Lehmann coefficient and the equilibrium twist q. In particular, we confirm that ν does not vanish at the compensation temperature at which q = 0, in agreement with previous static measurements of Éber and Jánossy (Mol. Cryst. Liq. Cryst., 72 (1982) 233) and of ourselves (Europhys. Lett., 80 (2007) 26001). In addition, the sign of the Lehmann coefficient is determined by observing between crossed polarizers the sense of rotation of the extinction branches of the disclination lines.