  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 $\sqrt{s}=13$~TeV, which allowed
us to measure the charm fragmentation fractions and the total $\rm c\bar{c}$
production cross section at midrapidity, will be shown. The new final
measurement of non-prompt (i.e. originating from beauty-hadron decays) $\rm
\Lambda_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 $\rm \Xi_c^0$ production as a function of
charged-particle multiplicity in pp collisions at $\sqrt{s}=13$~TeV, and of
$\rm \Xi_c^0$ production in p--Pb collisions at $\sqrt{s_{\rm NN}}=5.02$~TeV,
will be also presented, shedding further light on the hadronisation of
charm-strange baryons in different colliding systems.
