LaTex provides a great environment for publishing mathematical documents. Chapter 3 of this guide, which shows how to write publication ready mathematical formulas, is especially valuable.
Tobias Oetiker, Marcin Serwin, Hubert Partl, Irene Hyna, Elisabeth Schlegl and Contributors. The Not So Short Introduction to LaTeX. Also see the github site.