The tilted axis cranking formalism is implemented in relativistic mean field (RMF) theory. It is used for a microscopic description of magnetic rotation in the framework of covariant density functional theory. We assume that the rotational axis is in the xz plane and consider systems with the two symmetries P (space reflection) and P(y)T (a combination of a reflection in the v direction and time reversal). A computer code based on these symmetries is developed, and first applications are discussed for the nucleus (142)Gd: the rotational band based on the configuration pi h(11/2)(2) circle times nu h(11/2)(-2) is investigated in a fully microscopic and self-consistent way. The results are compared with available data, such as spectra and electromagnetic transition ratios B(M1)/B(E2). The relation between rotational velocity and angular momentum are discussed in detail together with the shears mechanism characteristic of magnetic rotation.