I don't think St. Athanasius was excommunicated. I believe you are speaking about the antipope Anastasius Bibliothecarius.
"I don't think St. Athanasius was excommunicated."
Yes he was, but not by the Pope. Check out his entry in the Catholic Encyclopedia.
You must not have seen post #18, which contains this link:
http://www.sspxasia.com/Documents/Archbishop-Lefebvre/Apologia/Vol_one/Appendix_I.htm
It is a very well-written appendix, and quite worth taking the time to read carefully. It covers the historical reality of the early centuries and shows how our own recent history is not very much different in some ways.
There is a lot to learn from history if one pays attention to what really happened, and does not close his mind preferring instead the slanted commentaries of liberal detractors.