Chrome and similar browsers do not support the
mathvariant attribute that can be used to change
math fonts conveniently. Like for mathcal there is
a table that can be used to translate from latin
to mathfraktur chars.
Bug: T378433
Change-Id: Id8c3e121ed104ba3f08329b4151a7e3bec699754
* Add hline search in matrix construction:
** This avoids a second scan later for the cost of some
memory overhead
* Parse | in array column specification
* Add CSS based table lines as done by TMML, cf.
https://github.com/w3c/mathml-core/issues/245
Bug: T377167
Change-Id: I6e29b47b1731638ea9b06de3006ce2834e4f0c68
Implicitly marking parameter $... as nullable is deprecated in PHP
8.4. The explicit nullable type must be used instead.
Bug: T376276
Change-Id: Idcd0b50c1c01a33c4cabeed3e31828f77c3f6443
Changes to the use statements done automatically via script
Addition of missing use statement done manually
Change-Id: I4cf7903b9700e6366bdf349f99ffd4a04da0c087
Chains of single letter mi elements are rendered with no
space but one mi element with multiple letters gets
space. For example, the operator log will be translated
to <mi>log</mi> rather than <mi>l</mi><mi>o</mi><mi>g</mi>
as done by wikitexvc.
* Squash literals into single element, iff they don't
contain commands
Following the implementation of the literal rendering
it seems that all literals with special behaviour have
a command.
Bug: T375861
Change-Id: I97adf5f5132180503cbeb59d32fdb8d45b08aaa7
* Reapply the logic of \log rendering to \operatorname
* Deduplicate applyFunctionDetection
Note this still does not solve the rendering problem for
operator names with more than one letter as these generate
mrow elements with single letters. Those are not rendered
with space in FF.
Bug: T375861
Change-Id: I913d865b49d5894a63c8b9d244768f9bb1df4e28
* Add new class to identify what a (large) operator is
* Add some IDE hints about what methods exist in texutil
* Add tests for operators in display and block style
Bug: T375907
Change-Id: If734f194cd8fa30efaf6d8c8d89f85e3e1c96276
* For each letter l c or r that is found in the
column spec the respective mtable alignment
information is passed
* if the align information is given externally
the info will still be ignored
Bug: T376838
Change-Id: I3113f933502df2109b066959e4d001736dbae6e6
In LaTeX line breaks in matrix elements
have an optional argument that controls
the vertical spacing between the current
and the next line. For example,
{\begin{aligned}a\\[6pt] b\end{aligned}}
generates a 6pt space.
This was never implemented and ignored by
mathoid.
The native MathML implementation is unaware
of the optional argument and just prints it
to the next line.
* This commit ignores the input on the grammar
side.
Bug: T375295
Change-Id: I08996129beca9ad852d23f28d7136c982707aea1
As indicated in the comment the code intents
to add "additional italic mathvariant
when bold already". However, effectively it
always added an additional -italic when
any mathvariant was given.
* Only add '-italic' if mathvariant is 'bold'
Bug: T375244
Change-Id: Iafb375753a98ff41c3d076819288345a9e2efb0c
* Add native to default valid modes.
* Remove old Mathoid mode from the default valid modes.
* Set native as the default choice, replacing Mathoid.
* Adjust fallback mechanism.
Bug: T373705
Change-Id: Ie6412623577e3f954c1302417d1b1b667f88863e
Instead of manually crafted $this->testCase properties.
Also make use of the dedicated PHPUnit feature to mark as test as
passed. While assertTrue( true ) is a very common hack it can be
confusing.
Change-Id: Ic071bf561929c2a79537111bee18631865f91366
Add doc-typehints to class properties found by the PropertyDocumentation
sniff to improve the documentation and to remove the exclusion of the
sniff.
The activated sniff avoids that new code is missing doc-typehints or
real-typehints.
Change-Id: Id7fcfd086cdbb3f040091e1d1a81472e7a524091
Just removing unused code that never did anything. Note this is only
in a test. As long as all tests still succeed this can't really cause
any problems, I believe.
Change-Id: I272803353eed9de0ecf98c55b75710df16da2c44
Changes to the use statements done automatically via script
Addition of missing use statement done manually
Change-Id: Ifcc9113bc1d2cf79d21871abe7652d7ed8dde20a
In MathML outer table boarders are represented with the
notation attribute of an menclose element. The inner
boarders are represented by the rowlines attribute
of the mtable element. The rowline element accepts
a space seperated list of row boarders. In LaTeX
the bottom line is represented by a new matrix row
that only contains \hline.
This change discover \hline elements in matrix cells
and then determines if it is in the first or last line.
When it is in the last line, the line is removed to avoid
an empty <mtr /> in the output.
Bug: T366417
Change-Id: I196e0d14a183a63696363f9e3006cf65571dc56c
Originally the parse tree was a binary tree, from that
time matrix element were put into that data structure.
This was partially undone, but not full which leads to some artifacts
in matrix cells.
One of the problem is that due to the binary parse
tree structure the postprocessing did not correctly
identfy \limits.
This change changes reduces nesting from matrix, and regards
matrix instances as two-dimensional TexArrays.
Bug: T362344
Change-Id: I66a31a09f204709a51d6b5c9ecefc083f7ee2d6d
TexArray is an array of tex nodes. To improve
readability and type hinting we make TexArray
iterable.
Change-Id: I5b9b2ca63400400bc399c08445ff911f8e20a0d1
When collecting user feedback regarding the native
rendering option on the German Wikipedia (T346795)
it became apparent that some power users aim for bigger
and bolder fonts and a more LaTeX-like layout.
MathML, however, aims to format math as an integral part
of the text with uniform fonts and spacing.
To match both user needs, this patch adds a new rendering
option that uses client-side MathJax (without a need for
restbase or mathoid).
* Adjust MathJax`s loader to be compatible with the mw loader
* Add new rendering mode
* Copy MathJax source to resource module as foreign repo
Bug: T354136
Change-Id: I1ecf9c77fefc3b0f717107d81979276023f6cb84
To reduce the complexity of the parse tree we remove the curly
element which is used for grouping in TeX. Instead, we use
use an attribute which defines if the group is put into curly
brackets or not. The functionality of the curly element
is transferred to the TexArray which was the only possible
child of the curly element before. To ease the transition,
we add a special constructor to TexArray.
We could not measure any performance implications of this change.
Bug: T333973
Change-Id: Idcb58694022831113bdc437576bb9f48658fff2f
The LaTeXML reference variant seems to be generated
with a slightly different version than before
Bug: T354057
Change-Id: I3d51dc06664120a1c7f9a933d7328210b7c6817f
While investigating the dependency between
Math and Wikibase, it turned out there was
a hard dependency in the test code.
This change makes the availability of the Wikibase
Extension optional and conditionally skips tests.
Bug: T362027
Change-Id: I9401d7d4a3277b6923dcd81f411ac5a08f1242d2
Excluded Generic.WhiteSpace.ScopeIndent as
it impact many lines in switch/case syntax
Also disable BraceNotOnOwnLine due to T347440
Change-Id: Ia0c8072da9b7bff6a4010d3fb70cb0e576cdf98a