摘要:Context. Pulsars are well studied all over the electromagnetic spectrum, and the Crab pulsar may be the most studied object in the sky. Nevertheless, a high-quality optical to near-infrared (NIR) spectrum of the Crab or any other pulsar has not been published to date.Aims. Obtaining a properly flux-calibrated spectrum enables us to measure the spectral index of the pulsar emission, without many of the caveats from previous studies. This was the main aim of this project, but in addition we could also detect absorption and emission features from the pulsar and nebula over an unprecedentedly wide wavelength range.Methods. A spectrum was obtained with the X-shooter spectrograph on the Very Large Telescope. Special care was given to the flux-calibration of these data.Results. A high signal-to-noise spectrum of the Crab pulsar was obtained from 300 nm to 2400 nm. The spectral index fit to this spectrum is flat withαν = 0.16 ± 0.07. For the emission lines we measured a maximum velocity of ∼1600 km s−1, whereas the absorption lines from the material between us and the pulsar is unresolved at the ∼50 km s−1resolution. A number of diffuse interstellar bands and a few NIR emission lines that have previously not been reported from the Crab are highlighted.