Text this: Electromagnetic fields in cavities