The production of J/psi and Upsilon mesons in pp collisions at sqrt(s) = 8 TeV is studied with the LHCb detector. The J/psi and Upsilon mesons are reconstructed in the mu+mu- decay mode and the signal yields are determined with a fit to the mu+mu- invariant mass distributions. The analysis is performed in the rapidity range 2.0<y<4.5 and transverse momentum range 0<p_T<14(15) GeV/c of the J/psi(Upsilon) mesons. The J/psi and Upsilon production cross-sections and the fraction of J/psi mesons from b-hadron decays are measured as a function of the meson p_T and y.
The production of J/$\psi$ mesons is studied in proton-lead collisions at the centre-of-mass energy per nucleon pair $\sqrt{s_{\text{NN}}}=8.16$ TeV with the LHCb detector at the LHC. The double differential cross-sections of prompt and nonprompt J/$\psi$ production are measured as functions of the J/$\psi$ transverse momentum and rapidity in the nucleon-nucleon centre-of-mass frame. Forward-to-backward ratios and nuclear modification factors are determined. The results are compared with theoretical calculations based on collinear factorisation using nuclear parton distribution functions, on the colour glass condensate or on coherent energy loss models.