~function_options();
void initialize(void);
function_options & set_name(std::string const & n, std::string const & tn=std::string());
+ function_options & latex_name(std::string const & tn);
// the following lines have been generated for max. ${maxargs} parameters
$eval_func_interface
$evalf_func_interface
// functions overriding virtual functions from bases classes
public:
void print(const print_context & c, unsigned level = 0) const;
+ unsigned precedence(void) const {return 70;}
int degree(const ex & s) const;
int ldegree(const ex & s) const;
ex coeff(const ex & s, int n = 1) const;
public:
static unsigned register_new(function_options const & opt);
static unsigned find_function(const std::string &name, unsigned nparams);
- unsigned getserial(void) const {return serial;}
+ unsigned get_serial(void) const {return serial;}
std::string get_name(void) const;
// member variables
}
#define is_ex_the_function(OBJ, FUNCNAME) \\
- (is_ex_exactly_of_type(OBJ, function) && static_cast<GiNaC::function *>(OBJ.bp)->getserial() == function_index_##FUNCNAME)
+ (is_ex_exactly_of_type(OBJ, function) && static_cast<GiNaC::function *>(OBJ.bp)->get_serial() == function_index_##FUNCNAME)
} // namespace GiNaC
void function_options::initialize(void)
{
- set_name("unnamed_function","\\\\operatorname{unnamed}");
+ set_name("unnamed_function","\\\\mbox{unnamed}");
nparams=0;
eval_f=evalf_f=derivative_f=series_f=0;
evalf_params_first=true;
{
name=n;
if (tn==std::string()) {
- TeX_name="\\\\operatorname{"+name+"}";
+ TeX_name="\\\\mbox{"+name+"}";
} else {
TeX_name=tn;
}
return *this;
}
+function_options & function_options::latex_name(std::string const & tn)
+{
+ TeX_name=tn;
+ return *this;
+}
+
// the following lines have been generated for max. ${maxargs} parameters
$eval_func_implementation
$evalf_func_implementation
}
c.s << ")";
+ } else if is_of_type(c, print_latex) {
+ c.s << registered_functions()[serial].TeX_name;
+ printseq(c, '(', ',', ')', exprseq::precedence(), function::precedence());
} else {
c.s << registered_functions()[serial].name;
- printseq(c, '(', ',', ')', exprseq::precedence, function::precedence);
+ printseq(c, '(', ',', ')', exprseq::precedence(), function::precedence());
}
}