Save lines between BODY and ENDBODY as file with name barg3d.tex. Then just run it through LaTeX2e. BODY