Optical properties and the electro-optic and photoelastic effects in crystals expressed in tensor form