Summary: TeX has become one of the most popular tools for editing teaching materials or textbooks in collegiate mathematics education, since it enables usual mathematics teachers to easily produce high-quality mathematical documents. Its capabilities for visualization and computation are fairly limited, so that many teachers simultaneously use various software such as Computer Algebra System (CAS) or Dynamic Geometry Software (DGS) to generate and display high-quality mathematical artworks. In this paper, we discuss the conditions under which the graphics generated by CAS/DGS mostly enhance the educational effect of teaching materials edited by TeX. As a result, the use of a CAS macro package for generating high-quality graphics in TeX documents is proposed.