ABSTRACT: Crystal structure solutions from thin films are often performed by grazing-incidence X-ray diffraction (GIXD) experiments. In particular, on isotropic substrates the thin film crystallites grow in a fibre texture showing a well defined crystallographic plane oriented parallel to the substrate surface with random in-plane order of the microcrystallites forming the film. In the present work, analytical mathematical expressions are derived for indexing experimental diffraction patterns, a highly challenging task which hitherto mainly relied on trial-and-error approaches. The six lattice constants a, b, c, ?, ? and ? of the crystallographic unit cell are thereby determined, as well as the rotation parameters due to the unknown preferred orientation of the crystals with respect to the substrate surface. The mathematical analysis exploits a combination of GIXD data and information acquired by the specular X-ray diffraction. The presence of a sole specular diffraction peak series reveals fibre-textured growth with a crystallographic plane parallel to the substrate, which allows establishment of the Miller indices u, v and w as the rotation parameters. Mathematical expressions are derived which reduce the system of unknown parameters from the three- to the two-dimensional space. Thus, in the first part of the indexing routine, the integers u and v as well as the Laue indices h and k of the experimentally observed diffraction peaks are assigned by systematically varying the integer variables, and by calculating the three lattice parameters a, b and ?. Because of the symmetry of the derived equations, determining the missing parameters then becomes feasible: (i) w of the surface parallel plane, (ii) the Laue indices l of the diffraction peak and (iii) analogously the lattice constants c, ? and ß. In a subsequent step, the reduced unit-cell geometry can be identified. Finally, the methodology is demonstrated by application to an example, indexing the diffraction pattern of a thin film of the organic semiconductor pentacenequinone grown on the (0001) surface of highly oriented pyrolytic graphite. The preferred orientation of the crystallites, the lattice constants of the triclinic unit cell and finally, by molecular modelling, the full crystal structure solution of the as-yet-unknown polymorph of pentacenequinone are determined.