Text this: Mathematical foundations for electromagnetic theory