TeXmacs is a free visual text editor for mathematics that can be used to produce $\TeX$ output. It also supports interactive use with various symbolic algebra programs, such as Macaulay2. TeXmacs is available from TeXmacs.org.
Using TeXmacs as an interface to Macaulay2 is described in the TeXmacs online manual. The basic procedure is to pull down the Insert menu, select Session from it, then select Macaulay2 from the resulting submenu. Alternatively, you can click on the icon that looks like a computer and select Macaulay2.
The source of this document is in Macaulay2Doc/ov_editors_emacs.m2:459:0.