Many functions in mathematics are denoted using abbreviated names. However, the capitalisation of these function names seems to be inconsistent to me: functions like $\sin$, $\cos$ and $\exp$ are all lowercase, whereas $\mathrm{Re}$ and $\mathrm{Im}$ (real and imaginary parts of complex numbers) have the first letter capitalised.
To some extent this may be subjective or up to the style guides of a specific journal, but many appear to be quite standard. Is there any rule for when the abbreviation should be capitalised?