The study of heavy-flavour mesons and baryons in hadronic collisions provides unique access to the properties of heavy-quark hadronisation in the presence of large partonic densities, where new mechanisms of hadron formation beyond in-vacuum fragmentation can emerge. Performing these measurements in intervals of charged-particle multiplicities across different collision systems provides sensitivity to understand whether different hadronisation mechanisms are at play in small and large hadronic colliding systems. In this contribution, a selection of the latest charm and beauty production measurements in proton–proton (pp) collisions is presented, which can shed light on the modification of the heavy-quark hadronisation mechanisms with respect to leptonic collisions. New published results of the production of all prompt charm ground states in pp collisions at √S = 13 TeV, which allowed us to measure the charm fragmentation fractions and the total cc production cross section at midrapidity, will be shown. The new final measurement of non-prompt (i.e. originating from beauty-hadron decays) Λc+ baryons in the same collisions system will be discussed to provide a quantitative comparison between the hadronisation properties of beauty and charm hadrons. New measurements of Ξc0 production as a function of charged-particle multiplicity in pp collisions at √S = 13, and of Ξc0 production in p–Pb collisions at √SNN = 5.02 TeV, will be also presented, shedding further light on the hadronisation of charm-strange baryons in different colliding systems.