]> www.ginac.de Git - ginac.git/commitdiff
Output LaTeX-symbols using \mathrm, instead of \mbox.
authorRichard Kreckel <kreckel@ginac.de>
Sun, 4 Oct 2009 20:30:45 +0000 (22:30 +0200)
committerRichard Kreckel <kreckel@ginac.de>
Sun, 4 Oct 2009 20:30:45 +0000 (22:30 +0200)
Using \mathrm improves printing in complex formulae.
One reason is that it scales in fractions. [by Vladimir Kisil]

ginac/constant.cpp
ginac/inifcns.cpp
ginac/inifcns_gamma.cpp
ginac/inifcns_nstdsums.cpp

index c7ef59d58cdacf3a488938951400d8f19b37d60d..00f0163d3b505b81c89f7fe33e3de5155fb340bd 100644 (file)
@@ -60,7 +60,7 @@ constant::constant(const std::string & initname, evalffunctype efun, const std::
   : name(initname), ef(efun), serial(next_serial++), domain(dm)
 {
        if (texname.empty())
-               TeX_name = "\\mbox{" + name + "}";
+               TeX_name = "\\mathrm{" + name + "}";
        else
                TeX_name = texname;
        setflag(status_flags::evaluated | status_flags::expanded);
@@ -70,7 +70,7 @@ constant::constant(const std::string & initname, const numeric & initnumber, con
   : name(initname), ef(0), number(initnumber), serial(next_serial++), domain(dm)
 {
        if (texname.empty())
-               TeX_name = "\\mbox{" + name + "}";
+               TeX_name = "\\mathrm{" + name + "}";
        else
                TeX_name = texname;
        setflag(status_flags::evaluated | status_flags::expanded);
@@ -131,7 +131,7 @@ void constant::do_print_latex(const print_latex & c, unsigned level) const
 void constant::do_print_python_repr(const print_python_repr & c, unsigned level) const
 {
        c.s << class_name() << "('" << name << "'";
-       if (TeX_name != "\\mbox{" + name + "}")
+       if (TeX_name != "\\mathrm{" + name + "}")
                c.s << ",TeX_name='" << TeX_name << "'";
        c.s << ')';
 }
index 0abe001bb68f248299f5390ec1b1eb293efc9554..20ea659ff52dee8286ce5ff09877f847a7c4a61e 100644 (file)
@@ -647,7 +647,7 @@ REGISTER_FUNCTION(Li2, eval_func(Li2_eval).
                        evalf_func(Li2_evalf).
                        derivative_func(Li2_deriv).
                        series_func(Li2_series).
-                       latex_name("\\mbox{Li}_2"));
+                       latex_name("\\mathrm{Li}_2"));
 
 //////////
 // trilogarithm
@@ -661,7 +661,7 @@ static ex Li3_eval(const ex & x)
 }
 
 REGISTER_FUNCTION(Li3, eval_func(Li3_eval).
-                       latex_name("\\mbox{Li}_3"));
+                       latex_name("\\mathrm{Li}_3"));
 
 //////////
 // Derivatives of Riemann's Zeta-function  zetaderiv(0,x)==zeta(x)
index 7d15231bbc5d35f7dfcd28e6eecccfed6e92715f..e1e67eea25a41e755cf0810f76f1a47abfb6aba5 100644 (file)
@@ -328,7 +328,7 @@ REGISTER_FUNCTION(beta, eval_func(beta_eval).
                         evalf_func(beta_evalf).
                         derivative_func(beta_deriv).
                         series_func(beta_series).
-                        latex_name("\\mbox{B}").
+                        latex_name("\\mathrm{B}").
                                                set_symmetry(sy_symm(0, 1)));
 
 
index 11a91dd1eed81cc08dd1b69e72c5535013afe3c4..3284ff698d267757e47e6b23b1f79a563e121283 100644 (file)
@@ -1686,7 +1686,7 @@ static void Li_print_latex(const ex& m_, const ex& x_, const print_context& c)
        } else {
                x = lst(x_);
        }
-       c.s << "\\mbox{Li}_{";
+       c.s << "\\mathrm{Li}_{";
        lst::const_iterator itm = m.begin();
        (*itm).print(c);
        itm++;
@@ -2202,7 +2202,7 @@ static ex S_deriv(const ex& n, const ex& p, const ex& x, unsigned deriv_param)
 
 static void S_print_latex(const ex& n, const ex& p, const ex& x, const print_context& c)
 {
-       c.s << "\\mbox{S}_{";
+       c.s << "\\mathrm{S}_{";
        n.print(c);
        c.s << ",";
        p.print(c);
@@ -3408,7 +3408,7 @@ static void H_print_latex(const ex& m_, const ex& x, const print_context& c)
        } else {
                m = lst(m_);
        }
-       c.s << "\\mbox{H}_{";
+       c.s << "\\mathrm{H}_{";
        lst::const_iterator itm = m.begin();
        (*itm).print(c);
        itm++;