]> www.ginac.de Git - ginac.git/blobdiff - ginac/utils.h
- symbols can have a LaTeX name, e.g. symbol s("s", "\\sigma");
[ginac.git] / ginac / utils.h
index c2a5f232336f3576ee9d72f75bd5b6e2f2c18f2e..79719feb9e2131ae166f05ce810f38253b657c2d 100644 (file)
@@ -301,6 +301,18 @@ void classname::print(const print_context & c, unsigned level) const \
                c.s << text; \
 }
 
+#define DEFAULT_PRINT_LATEX(classname, text, latex) \
+void classname::print(const print_context & c, unsigned level) const \
+{ \
+       debugmsg(#classname " print", LOGLEVEL_PRINT); \
+       if (is_of_type(c, print_tree)) \
+               inherited::print(c, level); \
+       else if (is_of_type(c, print_latex)) \
+               c.s << latex; \
+       else \
+               c.s << text; \
+}
+
 } // namespace GiNaC
 
 #endif // ndef __GINAC_UTILS_H__