When nothing works and you're in a place where you can't leave (a train or airplane, both of which I've experienced more than once), what I find works really well is to intensely focus on your own situation and do not make eye contact with anyone else. Completely ignore and block out everyone else except you and your child. It at least eliminates the worrying what others are thinking / shame factor. It really is their problem if they can't deal with it because like it or not tantrums happen and sometimes in public and sometimes in a place you have no choice to leave. Let them get annoyed, just block them out. And the truth is, most people who have / had young children completely understand and even if they're annoyed they have sympathy.
For tantrums in public, when my tantrum-prone child was that age, if I could leave, I'd just leave. Often we'd just wait outside until her tantrum was done.
With tantrums, I think parents really are powerless. The child is out of control, and it isn't about us. Tantrums are normal and OK, but they do annoy other people, so if you can, I'd just leave. Like the OP said, if you're trapped somewhere, try not to worry about everyone else because it won't make the tantrum better, and will more likely just upset you too, and I think kids who are out of control respond better when we're relaxed and don't get so upset - when we're like a stable rock they can cling to.
My typical routine for tantrums was to empathize and try to help her name her feeling, "You sound angry. You wanted X." and then let her know I was there when she needed me and let her get it out of her system. Then when she was done, I'd give her some love and get on with life.
I think the biggest thing is to not get dragged into it or feed the drama. Just try to relax and see it as a part of parenting and don't take it personally. I think the more emotionally stable we remain during the tantrum, the more we give them what they need, and the more we model that upsetting things don't have to make us lose control.
I agree with many things previously said, such as staying calm, using a calm tone of voice (not an "annoyed-and-gritting-my-teeth" voice), naps are a necessity, having a baggie of snacks and/or sippy cup. One thing that is hugely successful for me is singing. When he starts fussing, I start a song quietly. We sing all of the time and it is now his go-to "happy place". Songs with motions are extra successful, like "The Wheels on the Bus" or "The Itsy Bitsy Spider". Another thing that works is "Find the color/shape/object/letter" game. Whatever you see, ask him if he can find it, such as an escaped mylar balloon up by the ceiling at the grocery store, or an Energizer Bunny display, or an eagle on someone's Harley Davidson shirt or find someone with glasses, etc. Sometimes, they are going to scream no matter what, but I've found that when they are fed and napped, things go MUCH easier for me and mine :)
What seemed to work for DS was prevention (avoiding things/situations that were known to cause a problem) , removal (from the scene--outdoors always worked better than indoors), and space (staying nearby but no talking or touching DS during the tantrum).
Now that I look at this, it reminds me of de-escalating an out-of-control student...hmmmm,