Skip to content

Commit

Permalink
small fix to the CONSOLE_RE. Several fixes for typos in documentation (
Browse files Browse the repository at this point in the history
…#1367)

Another round. More fixes to typos in the documentation. Now
`<console>...</console>` handles multiline entries.
  • Loading branch information
mmatera authored Feb 5, 2025
1 parent b973956 commit 4f2a910
Show file tree
Hide file tree
Showing 20 changed files with 72 additions and 72 deletions.
8 changes: 4 additions & 4 deletions mathics/builtin/arithmetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,11 @@ def eval_assuming(self, assumptions, expr, evaluation: Evaluation):


class Assumptions(Predefined):
"""
r"""
<url>:WMA link:https://reference.wolfram.com/language/ref/$Assumptions.html</url>
<dl>
<dt>'$Assumptions'
<dd>is the default setting for the Assumptions option used in such functions as Simplify, Refine, and Integrate.
<dt>'\$Assumptions'
<dd>is the default setting for the 'Assumptions' option used in such functions as 'Simplify', 'Refine', and 'Integrate'.
</dl>
"""

Expand Down Expand Up @@ -728,7 +728,7 @@ class Product(IterationFunction, SympyFunction):
>> Product[k, {k, 3, n}]
= n! / 2
Evaluate the $n$th primorial:
Evaluate the $n$-th primorial:
>> primorial[0] = 1;
>> primorial[n_Integer] := Product[Prime[k], {k, 1, n}];
>> primorial[12]
Expand Down
4 changes: 2 additions & 2 deletions mathics/builtin/drawing/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1544,8 +1544,8 @@ def _apply_fn(self, f: Callable, x_value):
class ParametricPlot(_Plot):
"""
<url>
:WMA link
: https://reference.wolfram.com/language/ref/ParametricPlot.html</url>
:WMA link:\
https://reference.wolfram.com/language/ref/ParametricPlot.html</url>
<dl>
<dt>'ParametricPlot'[{$f_x$, $f_y$}, {$u$, $u_{min}$, $u_{max}$}]
<dd>plots a parametric function $f$ with the parameter $u$ ranging from $u_{min}$ to $u_{max}$.
Expand Down
4 changes: 2 additions & 2 deletions mathics/builtin/functional/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class Slot(SympyFunction, PrefixOperator):
<dl>
<dt>'#$n$'
<dd>represents the $n$th argument to a pure function.
<dd>represents the $n$-th argument to a pure function.
<dt>'#'
<dd>is short-hand for '#1'.
Expand Down Expand Up @@ -220,7 +220,7 @@ class SlotSequence(PrefixOperator, Builtin):
<dd>is the sequence of arguments supplied to a pure function.
<dt>'##$n$'
<dd>starts with the $n$th argument.
<dd>starts with the $n$-th argument.
</dl>
>> Plus[##]& [1, 2, 3]
Expand Down
8 changes: 4 additions & 4 deletions mathics/builtin/image/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class BinaryImageQ(Test):
https://reference.wolfram.com/language/ref/BinaryImageQ.html</url>
<dl>
<dt>'BinaryImageQ'[$image]
<dd>returns True if the pixels of $image are binary bit values, and False otherwise.
<dt>'BinaryImageQ'[$image$]
<dd>returns 'True' if the pixels of $image$ are binary bit values, and 'False' otherwise.
</dl>
S> img = Import["ExampleData/hedy.tif"];
Expand All @@ -40,8 +40,8 @@ class ImageQ(Test):
<url>:WMA link:https://reference.wolfram.com/language/ref/ImageQ.html</url>
<dl>
<dt>'ImageQ[Image'[$pixels]]
<dd>returns True if $pixels has dimensions from which an Image can be constructed, and False otherwise.
<dt>'ImageQ[Image'[$pixels$]]
<dd>returns 'True' if $pixels$ has dimensions from which an Image can be constructed, and 'False' otherwise.
</dl>
>> ImageQ[Image[{{0, 1}, {1, 0}}]]
Expand Down
50 changes: 25 additions & 25 deletions mathics/builtin/intfns/combinatorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ class BellB(SympyFunction):
:WMA: https://reference.wolfram.com/language/ref/BellB.html</url>)
<dl>
<dt>'BellB'[$n$]
<dd>Bell number $B$_$n$.
<dd>Bell number $B_n$.
<dt>'BellB'[$n$, $x$]
<dd>Bell polynomial $B$_$n$($x$).
<dd>Bell polynomial $B_n(x)$.
</dl>
>> BellB[10]
Expand Down Expand Up @@ -171,7 +171,7 @@ class CatalanNumber(SympyFunction):
<dl>
<dt>'CatalanNumber'[$n$]
<dd>gives the $n$th Catalan number.
<dd>gives the $n$-th Catalan number.
</dl>
A list of the first five Catalan numbers:
Expand Down Expand Up @@ -203,8 +203,8 @@ class DiceDissimilarity(_BooleanDissimilarity):
<dl>
<dt>'DiceDissimilarity'[$u$, $v$]
<dd>returns the Dice dissimilarity between the two Boolean 1-D lists $u$ and $v$.
This is defined as ($c_tf$ + $c_ft$) / (2 * $c_tt$ + $c_ft$ + c_tf).
$n$ is len($u$) and $c_ij$ is the number of occurrences of $u$[$k$]=$i$ and $v$[$k$]=$j$ for $k$ < $n$.
This is defined as ($c_{tf}$ + $c_{ft}$) / (2 * $c_{tt}$ + $c_{ft}$ + $c_{tf}$).
$n$ is len($u$) and $c_{ij}$ is the number of occurrences of $u[k]=i$ and $v[k]=j$ for $k < n$.
</dl>
>> DiceDissimilarity[{1, 0, 1, 1, 0, 1, 1}, {0, 1, 1, 0, 0, 0, 1}]
Expand All @@ -227,10 +227,10 @@ class EulerE(SympyFunction):
:WMA: https://reference.wolfram.com/language/ref/EulerE.html</url>)
<dl>
<dt>'EulerE'[$n$]
<dd>Euler number $E$_$n$.
<dd>Euler number $E_n$.
<dt>'EulerE'[$n$, $x$]
<dd>Euler polynomial $E$_$n$($x$).
<dd>Euler polynomial $E_n(x)$.
</dl>
Odd-index Euler numbers are zero:
Expand Down Expand Up @@ -267,8 +267,8 @@ class JaccardDissimilarity(_BooleanDissimilarity):
<dt>'JaccardDissimilarity'[$u$, $v$]
<dd>returns the Jaccard-Needham dissimilarity between the two Boolean \
1-D lists $u$ and $v$, which is defined as \
$(c_tf + c_ft) / (c_tt + c_ft + c_tf)$, where $n$ is \
len($u$) and $c_ij$ is the number of occurrences of \
$(c_{tf} + c_{ft}) / (c_{tt} + c_{ft} + c_{tf})$, where $n$ is \
len($u$) and $c_{ij}$ is the number of occurrences of \
$u[k]=i$ and $v[k]=j$ for $k < n$.
</dl>
Expand Down Expand Up @@ -336,8 +336,8 @@ class MatchingDissimilarity(_BooleanDissimilarity):
<dl>
<dt>'MatchingDissimilarity'[$u$, $v$]
<dd>returns the Matching dissimilarity between the two Boolean \
1-D lists $u$ and $v$, which is defined as $(c_tf + c_ft) / n$, \
where $n$ is len($u$) and $c_ij$ is the number of occurrences of \
1-D lists $u$ and $v$, which is defined as $(c_{tf} + c_{ft}) / n$, \
where $n$ is len($u$) and $c_{ij}$ is the number of occurrences of \
$u[k]=i$ and $v[k]=j$ for $k < n$.
</dl>
Expand Down Expand Up @@ -402,10 +402,10 @@ class PolygonalNumber(Builtin):
:WMA: https://reference.wolfram.com/language/ref/PolygonalNumber.html</url>)
<dl>
<dt>'PolygonalNumber'[$n$]
<dd>gives the $n$th triangular number.
<dd>gives the $n$-th triangular number.
<dt>'PolygonalNumber'[$r$, $n$]
<dd>gives the $n$th $r$-gonal number.
<dd>gives the $n$-th $r$-gonal number.
</dl>
>> Table[PolygonalNumber[n], {n, 10}]
Expand Down Expand Up @@ -448,9 +448,9 @@ class RogersTanimotoDissimilarity(_BooleanDissimilarity):
<dt>'RogersTanimotoDissimilarity'[$u$, $v$]
<dd>returns the Rogers-Tanimoto dissimilarity between the two Boolean \
1-D lists $u$ and $v$, which is defined as \
$R / (c_tt + c_ff + R)$ where $n$ is $len(u)$, $c_ij$ is \
$R / (c_{tt} + c_{ff} + R)$ where $n$ is $len(u)$, $c_{ij}$ is \
the number of occurrences of $u[k]=i$, $v[k]=j$ for $k<n$, \
and $R = 2 (c_tf + c_ft)$.
and $R = 2 (c_{tf} + c_{ft})$.
</dl>
>> RogersTanimotoDissimilarity[{1, 0, 1, 1, 0, 1, 1}, {0, 1, 1, 0, 0, 0, 1}]
Expand All @@ -474,8 +474,8 @@ class RussellRaoDissimilarity(_BooleanDissimilarity):
<dl>
<dt>'RussellRaoDissimilarity'[$u$, $v$]
<dd>returns the Russell-Rao dissimilarity between the two Boolean \
1-D lists $u$ and $v$, which is defined as $(n - c_tt) / c_tt$ \
where $n$ is $len(u)$, $c_ij$ is \
1-D lists $u$ and $v$, which is defined as $(n - c_{tt}) / c_{tt}$ \
where $n$ is $len(u)$, $c_{ij}$ is \
the number of occurrences of $u[k]=i$ and $v[k]=j$ for $k < n$.
</dl>
Expand All @@ -500,10 +500,10 @@ class SokalSneathDissimilarity(_BooleanDissimilarity):
<dl>
<dt>'SokalSneathDissimilarity'[$u$, $v$]
<dd>returns the Sokal-Sneath dissimilarity between the two Boolean \
1-D lists $u$ and $v$, which is defined as $R / (c_tt + R)$ where \
$n$ is $len(u)$, $c_ij$ is the number of occurrences of \
1-D lists $u$ and $v$, which is defined as $R / (c_{tt} + R)$ where \
$n$ is $len(u)$, $c_{ij}$ is the number of occurrences of \
$u[k]=i$, $v[k]=j$ for $k < n$, \
and $R = 2 (c_tf + c_ft)$.
and $R = 2 (c_{tf} + c_{ft})$.
</dl>
>> SokalSneathDissimilarity[{1, 0, 1, 1, 0, 1, 1}, {0, 1, 1, 0, 0, 0, 1}]
Expand Down Expand Up @@ -542,7 +542,7 @@ class Subsets(Builtin):
<dd>finds a list of the first $n$ possible subsets.
<dt>'Subsets'[$list$, $spec$, {$n$}]
<dd>finds the $n$th possible subset.
<dd>finds the $n$-th possible subset.
</dl>
All possible subsets (power set):
Expand All @@ -569,7 +569,7 @@ class Subsets(Builtin):
>> Subsets[Range[5], All, {25}]
= {{2, 4, 5}}
The odd-numbered subsets of {a,b,c,d} in reverse order:
The odd-numbered subsets of {$a$,$b$,$c$,$d$} in reverse order:
>> Subsets[{a, b, c, d}, All, {15, 1, -2}]
= {{b, c, d}, {a, b, d}, {c, d}, {b, c}, {a, c}, {d}, {b}, {}}
"""
Expand Down Expand Up @@ -715,10 +715,10 @@ class YuleDissimilarity(_BooleanDissimilarity):
<dl>
<dt>'YuleDissimilarity'[$u$, $v$]
<dd>returns the Yule dissimilarity between the two Boolean 1-D lists $u$ \
and $v$, which is defined as $R / (c_tt c_ff + R / 2)$ \
where $n$ is $len(u)$, $c_ij$ is the number of occurrences of \
and $v$, which is defined as $R / (c_{tt} c_{ff} + R / 2)$ \
where $n$ is $len(u)$, $c_{ij}$ is the number of occurrences of \
$u[k]=i$, $v[k]=j$ for $k<n$, \
and $R = 2 c_tf c_ft$.
and $R = 2 c_{tf} c_{ft}$.
</dl>
>> YuleDissimilarity[{1, 0, 1, 1, 0, 1, 1}, {0, 1, 1, 0, 0, 0, 1}]
Expand Down
4 changes: 2 additions & 2 deletions mathics/builtin/intfns/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ class BernoulliB(MPMathFunction):
<dl>
<dt>'BernoulliB'[$n$]
<dd>represents the Bernoulli number B_$n$.
<dd>represents the Bernoulli number $B_n$.
<dt>'BernouilliB'[$n$, $x$]
<dd>represents the Bernoulli polynomial B_$n[x]$.
<dd>represents the Bernoulli polynomial $B_n(x)$.
</dl>
>> BernoulliB[42]
Expand Down
8 changes: 4 additions & 4 deletions mathics/builtin/intfns/recurrence.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ class Fibonacci(MPMathFunction):
<dl>
<dt>'Fibonacci'[$n$]
<dd>computes the $n$th Fibonacci number.
<dd>computes the $n$-th Fibonacci number.
<dt>'Fibonacci'[$n$, $x$]
<dd>computes the Fibonacci polynomial $F$_$n$($x$).
<dd>computes the Fibonacci polynomial $F_n(x)$.
</dl>
>> Fibonacci[0]
Expand Down Expand Up @@ -71,7 +71,7 @@ class HarmonicNumber(MPMathFunction):
<dl>
<dt>'HarmonicNumber[n]'
<dd>returns the $n$th harmonic number.
<dd>returns the $n$-th harmonic number.
</dl>
>> Table[HarmonicNumber[n], {n, 8}]
Expand Down Expand Up @@ -100,7 +100,7 @@ class LinearRecurrence(Builtin):
<dd>computes $n$ terms of the linear recurrence with kernel $ker$ and initial values $init$.
<dt>'LinearRecurrence'[$ker$, $init$, {$n$}]
<dd>computes the $n$th term.
<dd>computes the $n$-th term.
<dt>'LinearRecurrence'[$ker$, $init$, {$n_{min}$, $n_{max}$}]
<dd>computes $n$ terms of the linear recurrence with kernel $ker$ and initial values $init$.
Expand Down
18 changes: 9 additions & 9 deletions mathics/builtin/list/associations.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ class Key(Builtin):
<url>:WMA link:https://reference.wolfram.com/language/ref/Key.html</url>
<dl>
<dt>Key[$key$]
<dt>'Key'[$key$]
<dd> represents a key used to access a value in an association.
<dt>Key[$key$][$assoc$]
<dt>'Key'[$key$][$assoc$]
<dd>
</dl>
"""
Expand All @@ -185,11 +185,11 @@ class Keys(Builtin):
<url>:WMA link:https://reference.wolfram.com/language/ref/Keys.html</url>
<dl>
<dt>'Keys'[<|$key_1$ -> $val_1$, $key_2$ -> $val_2$, ...|>]
<dt>'Keys'['<|' $key_1$ '->' $val_1$, $key_2$ '->' $val_2$, ...'|>']
<dd>return a list of the keys $keyi$ in an association.
<dt>'Keys'[{$key_1$ -> $val_1$, $key_2$ -> $val_2$, ...}]
<dd>return a list of the $keyi$ in a list of rules.
<dt>'Keys'[{$key_1$ '->' $val_1$, $key_2$ '->' $val_2$, ...}]
<dd>return a list of the $key_i$ in a list of rules.
</dl>
>> Keys[<|a -> x, b -> y|>]
Expand Down Expand Up @@ -285,11 +285,11 @@ class Values(Builtin):
<url>:WMA link:https://reference.wolfram.com/language/ref/Values.html</url>
<dl>
<dt>'Values'[<|$key_1$ -> $val_1$, $key_2$ -> $val_2$, ...|>]
<dd>return a list of the values $vali$ in an association.
<dt>'Values'['<|'$key_1$ '->' $val_1$, $key_2$ -> $val_2$, ...'|>']
<dd>return a list of the values $val_i$ in an association.
<dt>'Values'[{$key_1$ -> $val_1$, $key_2$ -> $val_2$, ...}]
<dd>return a list of the $vali$ in a list of rules.
<dt>'Values'[{$key_1$ '->' $val_1$, $key_2$ '->' $val_2$, ...}]
<dd>return a list of the $val_i$ in a list of rules.
</dl>
>> Values[<|a -> x, b -> y|>]
Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/mainloop.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class In(Builtin):
<url>:WMA: https://reference.wolfram.com/language/ref/In</url>
<dl>
<dt>'In'[$k$]
<dd>gives the $k$th line of input.
<dd>gives the $k$-th line of input.
</dl>
>> x = 1
Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/numbers/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ class Overflow(Builtin):
See also <url>
:Integer Overflow:
<https://en.wikipedia.org/wiki/Integer_overflow></url>.
https://en.wikipedia.org/wiki/Integer_overflow</url>.
<dl>
<dt>'Overflow[]'
Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/numbers/diffeqns.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class C(Builtin):
<dl>
<dt>'C'[$n$]
<dd>represents the $n$th constant in a solution to a differential equation.
<dd>represents the $n$-th constant in a solution to a differential equation.
</dl>
"""

Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/numbers/numbertheory.py
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ class MersennePrimeExponent(SympyFunction):
<dl>
<dt>'MersennePrimeExponent'[$n$]
<dd>returns the exponent of the $n$th Mersenne prime.
<dd>returns the exponent of the $n$-th Mersenne prime.
</dl>
>> Table[MersennePrimeExponent[n], {n, 10}]
Expand Down
4 changes: 2 additions & 2 deletions mathics/builtin/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ class Default(Builtin):
<dd>gives the default value for an omitted parameter of $f$.
<dt>'Default'[$f$, $k$]
<dd>gives the default value for a parameter on the $k$th position.
<dd>gives the default value for a parameter on the $k$-th position.
<dt>'Default'[$f$, $k$, $n$]
<dd>gives the default value for the $k$th parameter out of $n$.
<dd>gives the default value for the $k$-th parameter out of $n$.
</dl>
Assign values to 'Default' to specify default values.
Expand Down
10 changes: 5 additions & 5 deletions mathics/builtin/patterns/composite.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,14 +309,14 @@ class Pattern(PatternObject):
<dl>
<dt>'Pattern'[$symb$, $pat$]
<dt>'$symb$ : $pat$'
<dt>$symb$ ':' $pat$
<dd>assigns the name $symb$ to the pattern $pat$.
<dt>'$symb$_$head$'
<dd>is equivalent to '$symb$ : _$head$' (accordingly with '__' \
<dt>$symb$'_'$head$
<dd>is equivalent to $symb$' : _'$head$ (accordingly with '__' \
and '___').
<dt>'$symb$ : $pat$ : $default$'
<dt>$symb$' : '$pat$' : '$default$
<dd>is a pattern with name $symb$ and default value $default$, \
equivalent to 'Optional[$pat$ : $symb$, $default$]'.
equivalent to 'Optional'[$pat$ : $symb$, $default$].
</dl>
>> FullForm[a_b]
Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/physchemdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class ElementData(Builtin):
<dd>gives the value of the $property$ for the chemical
specified by $name$.
<dt>'ElementData'[$n$, "$property$"]
<dd>gives the value of the $property$ for the $n$th chemical element.
<dd>gives the value of the $property$ for the $n$-th chemical element.
</dl>
>> ElementData[74]
Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/quantum_mechanics/angular.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class PauliMatrix(SympyFunction):
<dl>
<dt>'PauliMatrix'[$k$]
<dd>returns the $k$th Pauli spin matrix).
<dd>returns the $k$-th Pauli spin matrix).
</dl>
>> Table[PauliMatrix[i], {i, 1, 3}]
Expand Down
Loading

0 comments on commit 4f2a910

Please sign in to comment.