Allow the output of code cells to be individually selectable when making slides

Pull request for #3841.