The strangeness around TeX output for log
is a bug, which I'm working on. But here is a work around which gets the behavior you want, I think.
Here I'm calling both texput(log, "\ln ")
and texput(log, "\ln ", prefix)
, to set the TeX output for log
in different contexts, and also :lisp (push log *tex-mexpt-trig-like-fns*)
to have log
treated similarly to trig functions.
(%i1) stringdisp: true $
(%i2) map (tex1, [log(x), log(x+1), log(x)^n]);
(%o2) ["log x", "log left(x+1
ight)", "left(log x
ight)^{n}"]
(%i3) texput (log, "\ln ");
(%o3) "ln "
(%i4) texput (log, "\ln ", prefix);
(%o4) "ln "
(%i5) map (tex1, [log(x), log(x+1), log(x)^n]);
(%o5) ["ln x", "ln left(x+1
ight)", "ln x^{n}"]
Hmm, that's not quite enough. Oh, that's right, I forgot the bit about trig functions.
(%i6) :lisp (push '%log *tex-mexpt-trig-like-fns*)
(%LOG %SIN %COS %TAN %SINH %COSH %TANH %ASIN %ACOS %ATAN %ASINH %ACOSH %ATANH)
(%i6) map (tex1, [log(x), log(x+1), log(x)^n]);
(%o6) ["ln x", "ln left(x+1
ight)", "ln ^{n}x"]
Does that seem right?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…