Skip to content

Commit 1456979

Browse files
authored
Merge pull request #706 from Mathics3/latex_doc-tweaks
Latex doc tweaks
2 parents a24cbf8 + 916dd89 commit 1456979

File tree

2 files changed

+27
-9
lines changed

2 files changed

+27
-9
lines changed

mathics/builtin/specialfns/zeta.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22

33
"""
4-
Exponential Integral and Special Functions
4+
Zeta Functions and Polylogarithms
55
"""
66

77
import mpmath
@@ -12,11 +12,13 @@
1212

1313
class LerchPhi(_MPMathFunction):
1414
"""
15-
<url>:WMA link:https://reference.wolfram.com/language/ref/LerchPhi.html</url>
15+
<url>
16+
:WMA link:
17+
https://reference.wolfram.com/language/ref/LerchPhi.html</url>
1618
1719
<dl>
18-
<dt>'LerchPhi[z,s,a]'
19-
<dd>gives the Lerch transcendent Φ(z,s,a).
20+
<dt>'LerchPhi[z,s,a]'
21+
<dd>gives the Lerch transcendent Φ(z,s,a).
2022
</dl>
2123
2224
>> LerchPhi[2, 3, -1.5]
@@ -30,7 +32,7 @@ class LerchPhi(_MPMathFunction):
3032
sympy_name = "lerchphi"
3133
summary_text = "Lerch's trascendental ϕ function"
3234

33-
def apply(self, z, s, a, evaluation):
35+
def eval(self, z, s, a, evaluation):
3436
"%(name)s[z_, s_, a_]"
3537

3638
py_z = z.to_python()
@@ -45,10 +47,12 @@ def apply(self, z, s, a, evaluation):
4547

4648
class Zeta(_MPMathFunction):
4749
"""
48-
<url>:WMA link:https://reference.wolfram.com/language/ref/Zeta.html</url>
50+
<url>
51+
:WMA link:
52+
https://reference.wolfram.com/language/ref/Zeta.html</url>
4953
5054
<dl>
51-
<dt>'Zeta[$z$]'
55+
<dt>'Zeta[$z$]'
5256
<dd>returns the Riemann zeta function of $z$.
5357
</dl>
5458
@@ -62,3 +66,6 @@ class Zeta(_MPMathFunction):
6266
summary_text = "Riemann's ζ function"
6367
sympy_name = "zeta"
6468
mpmath_name = "zeta"
69+
70+
71+
# TODO: PolyLog, ReimannSiegelTheta, ReimannSiegelZ, ReimannXi, ZetaZero

mathics/doc/latex_doc.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,8 @@ def get_latex_escape_char(text):
325325

326326

327327
def latex_label_safe(s: str) -> str:
328-
s = s.replace("\\$", "")
329-
s = s.replace("$", "")
328+
s = s.replace("\\$", "dollar-")
329+
s = s.replace("$", "dollar-")
330330
return s
331331

332332

@@ -533,6 +533,17 @@ def __str__(self):
533533
return self.test
534534

535535
def latex(self, doc_data: dict) -> str:
536+
"""
537+
Produces the LaTeX-formatted fragment that corresponds the
538+
test sequence and results for a single Builtin that has been run.
539+
540+
The key for doc_data is the part/chapter/section{/subsection} test number
541+
and the value contains Result object data turned into a dictionary.
542+
543+
In partuclar, each test in the test sequence includes the, input test,
544+
the result produced and any additional error output.
545+
The LaTeX-formatted string fragment is returned.
546+
"""
536547
if self.key is None:
537548
return ""
538549
output_for_key = doc_data.get(self.key, None)

0 commit comments

Comments
 (0)