]> www.ginac.de Git - ginac.git/blobdiff - ginac/symbol.cpp
Introducing method symbol::get_TeX_name() to match existing symbol::get_name().
[ginac.git] / ginac / symbol.cpp
index bedcff4a1f230f48c838036304949c76c834c94a..c1256d56eb8adcb256d63ac122cd2aeb82c90b61 100644 (file)
@@ -3,7 +3,7 @@
  *  Implementation of GiNaC's symbolic objects. */
 
 /*
- *  GiNaC Copyright (C) 1999-2016 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2017 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -157,6 +157,14 @@ std::string symbol::get_name() const
        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