as "@code{\Box}" in LaTeX code (@xref{Input/output}, for more
information about the different output formats of expressions in GiNaC).
GiNaC automatically creates proper LaTeX code for symbols having names of
-greek letters (@samp{alpha}, @samp{mu}, etc.).
+greek letters (@samp{alpha}, @samp{mu}, etc.). You can retrive the name
+and the LaTeX name of a symbol using the respective methods:
+@cindex @code{get_name()}
+@cindex @code{get_TeX_name()}
+@example
+symbol::get_name() const;
+symbol::get_TeX_name() const;
+@end example
@cindex @code{subs()}
Symbols in GiNaC can't be assigned values. If you need to store results of
return name;
}
+std::string symbol::get_TeX_name() const
+{
+ if (TeX_name.empty()) {
+ return get_default_TeX_name(get_name());
+ }
+ return TeX_name;
+}
+
// protected
void symbol::do_print(const print_context & c, unsigned level) const
void set_name(const std::string & n) { name = n; }
void set_TeX_name(const std::string & n) { TeX_name = n; }
std::string get_name() const;
+ std::string get_TeX_name() const;
protected:
void do_print(const print_context & c, unsigned level) const;
void do_print_latex(const print_latex & c, unsigned level) const;