Some things you can try are putting some lavender oil on a handkerchief and smelling it if the anxiety peaks. The smell does sooth anxiety. Another trick is to wear a rubber band around your wrist and if the anxiety starts getting bad snap yourself with it...the jolt of the snap can help you clear your head.
Keep your breathing slow and steady...do not allow yourself to hyperventilate.
Remember you can always get up and leave...pregnancy is the perfect excuse to leave any situation. And at a funeral if you panic and start crying or get a bit dizzy and need to put your head between your knees (if you still can) between grief and being pregnant no one will even wonder about it.
As your doctor if taking one Xanax will hurt...I was on anxiety meds my whole pregnancy because my attacks were effecting functioning everyday. I have two happy, healthy, smart kids...
Oh, I used to sit in class and try to imagine something about everyone else in the class...like what did each person eat for breakfast...or something silly like what kind or color underwear each person was wearing...mind over panic.
A big hug to you!! Panic attacks totally suck and you are not alone!!