Skip to content

Commit bb55fb2

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents b36bda7 + d81e955 commit bb55fb2

File tree

7 files changed

+186
-169
lines changed

7 files changed

+186
-169
lines changed

lib/LaTeXML/Package/amsmath.sty.ltxml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -905,18 +905,22 @@ DefMath('\And', '&', role => 'ADDOP', meaning => 'and');
905905

906906
# Should be in LaTeX (& TeX): \overrightarrow, \overleftarrow
907907
# Note that the arrow is treated as an accent over/under the argument!
908-
DefMath('\underrightarrow{}', "\x{2192}", operator_role => 'UNDERACCENT');
909-
DefMath('\underleftarrow{}', "\x{2190}", operator_role => 'UNDERACCENT');
910-
DefMath('\overleftrightarrow{}', "\x{2194}", operator_role => 'OVERACCENT');
911-
DefMath('\underleftrightarrow{}', "\x{2194}", operator_role => 'UNDERACCENT');
908+
DefMath('\underrightarrow{}', "\x{2192}",
909+
operator_role => 'UNDERACCENT', operator_stretchy => 'true');
910+
DefMath('\underleftarrow{}', "\x{2190}",
911+
operator_role => 'UNDERACCENT', operator_stretchy => 'true');
912+
DefMath('\overleftrightarrow{}', "\x{2194}",
913+
operator_role => 'OVERACCENT', operator_stretchy => 'true');
914+
DefMath('\underleftrightarrow{}', "\x{2194}",
915+
operator_role => 'UNDERACCENT', operator_stretchy => 'true');
912916

913917
#======================================================================
914918
# Section 4.9 Extensible arrows
915919
# \xleftarrow, \xrightarrow
916920

917921
# set up a general macro to support variations on xarrows macros (see mathtools)
918922
# \lx@long@arrow{token}{arrow}[under]{over}
919-
DefConstructor('\lx@long@arrow DefToken {}[]{}',
923+
DefConstructor('\lx@long@arrow DefToken {} OptionalInScriptStyle InScriptStyle',
920924
"?#3("
921925
. "<ltx:XMApp role='ARROW'>"
922926
. "<ltx:XMWrap role='UNDERACCENT'>#3</ltx:XMWrap>"
@@ -937,24 +941,29 @@ DefConstructor('\lx@long@arrow DefToken {}[]{}',
937941
# specialize to ldots ???
938942
properties => { font => sub { LookupValue('font')->specialize("\x{2026}"); } });
939943

940-
DefMacro('\xrightarrow', '\lx@long@arrow{\xrightarrow}{\rightarrow}');
941-
DefMacro('\xleftarrow', '\lx@long@arrow{\xleftarrow}{\leftarrow}');
944+
DefMacro('\xrightarrow', '\lx@long@arrow{\xrightarrow}{\lx@stretchy@rightarrow}');
945+
DefMacro('\xleftarrow', '\lx@long@arrow{\xleftarrow}{\lx@stretchy@leftarrow}');
946+
947+
DefMathI('\lx@stretchy@leftarrow', undef, "\x{2190}",
948+
role => 'ARROW', stretchy => 'true', alias => '\leftarrow');
949+
DefMathI('\lx@stretchy@rightarrow', undef, "\x{2192}",
950+
role => 'ARROW', stretchy => 'true', alias => '\rightarrow');
942951

943952
#======================================================================
944953
# Section 4.10 Affixing symbols to other symbols
945954

946955
# Note that the 1st argument is treated set as an accent over (or under) the 2nd argument.
947-
DefConstructor('\overset{}{}',
956+
DefConstructor('\overset InScriptStyle {}',
948957
"<ltx:XMApp>"
949958
. "<ltx:XMWrap role='OVERACCENT'>#1</ltx:XMWrap>"
950959
. "<ltx:XMArg>#2</ltx:XMArg>"
951960
. "</ltx:XMApp>");
952-
DefConstructor('\underset{}{}',
961+
DefConstructor('\underset InScriptStyle {}',
953962
"<ltx:XMApp>"
954963
. "<ltx:XMWrap role='UNDERACCENT'>#1</ltx:XMWrap>"
955964
. "<ltx:XMArg>#2</ltx:XMArg>"
956965
. "</ltx:XMApp>");
957-
DefConstructor('\overunderset{}{}{}',
966+
DefConstructor('\overunderset InScriptStyle InScriptStyle {}',
958967
"<ltx:XMApp>"
959968
. "<ltx:XMWrap role='OVERACCENT'>#1</ltx:XMWrap>"
960969
. "<ltx:XMApp>"

lib/LaTeXML/Package/mathtools.sty.ltxml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ DefMacro('\noeqref{}', '');
247247

248248
## 3.3
249249

250-
DefConstructor('\xleftrightarrow[]{}', # not centered anymore
250+
DefConstructor('\xleftrightarrow OptionalInScriptStyle InScriptStyle', # not centered anymore
251251
"?#1("
252252
. "<ltx:XMApp role='METARELOP'>"
253253
. "<ltx:XMWrap role='UNDERACCENT'>#1</ltx:XMWrap>"
@@ -259,12 +259,12 @@ DefConstructor('\xleftrightarrow[]{}', # not centered anymore
259259
. ")("
260260
. "<ltx:XMApp role='METARELOP'>"
261261
. "<ltx:XMWrap role='OVERACCENT'>#2</ltx:XMWrap>"
262-
. "<ltx:XMTok name='xleftrightarrow' role='METARELOP'>\x{2194}</ltx:XMTok>"
262+
. "<ltx:XMTok name='xleftrightarrow' role='METARELOP' stretchy='true'>\x{2194}</ltx:XMTok>"
263263
. "</ltx:XMApp>"
264264
. ")",
265265
properties => { font => sub { LookupValue('font')->specialize("\x{2026}"); } });
266266

267-
DefConstructor('\xLeftarrow[]{}',
267+
DefConstructor('\xLeftarrow OptionalInScriptStyle InScriptStyle',
268268
"?#1("
269269
. "<ltx:XMApp role='ARROW'>"
270270
. "<ltx:XMWrap role='UNDERACCENT'>#1</ltx:XMWrap>"
@@ -276,12 +276,12 @@ DefConstructor('\xLeftarrow[]{}',
276276
. ")("
277277
. "<ltx:XMApp role='ARROW'>"
278278
. "<ltx:XMWrap role='OVERACCENT'>#2</ltx:XMWrap>"
279-
. "<ltx:XMTok name='xLeftarrow' role='ARROW'>\x{21D0}</ltx:XMTok>"
279+
. "<ltx:XMTok name='xLeftarrow' role='ARROW' stretchy='true'>\x{21D0}</ltx:XMTok>"
280280
. "</ltx:XMApp>"
281281
. ")",
282282
properties => { font => sub { LookupValue('font')->specialize("\x{2026}"); } });
283283

284-
DefConstructor('\xRightarrow[]{}',
284+
DefConstructor('\xRightarrow OptionalInScriptStyle InScriptStyle',
285285
"?#1("
286286
. "<ltx:XMApp role='ARROW'>"
287287
. "<ltx:XMWrap role='UNDERACCENT'>#1</ltx:XMWrap>"
@@ -293,12 +293,12 @@ DefConstructor('\xRightarrow[]{}',
293293
. ")("
294294
. "<ltx:XMApp role='ARROW'>"
295295
. "<ltx:XMWrap role='OVERACCENT'>#2</ltx:XMWrap>"
296-
. "<ltx:XMTok name='xRightarrow' role='ARROW'>\x{21D2}</ltx:XMTok>"
296+
. "<ltx:XMTok name='xRightarrow' role='ARROW' stretchy='true'>\x{21D2}</ltx:XMTok>"
297297
. "</ltx:XMApp>"
298298
. ")",
299299
properties => { font => sub { LookupValue('font')->specialize("\x{2026}"); } });
300300

301-
DefConstructor('\xLeftrightarrow[]{}', # looks stretched
301+
DefConstructor('\xLeftrightarrow OptionalInScriptStyle InScriptStyle', # looks stretched
302302
"?#1("
303303
. "<ltx:XMApp role='ARROW'>"
304304
. "<ltx:XMWrap role='UNDERACCENT'>#1</ltx:XMWrap>"
@@ -310,12 +310,12 @@ DefConstructor('\xLeftrightarrow[]{}', # looks stretched
310310
. ")("
311311
. "<ltx:XMApp role='ARROW'>"
312312
. "<ltx:XMWrap role='OVERACCENT'>#2</ltx:XMWrap>"
313-
. "<ltx:XMTok name='xLeftrightarrow' role='ARROW'>\x{21D4}</ltx:XMTok>"
313+
. "<ltx:XMTok name='xLeftrightarrow' role='ARROW' stretchy='true'>\x{21D4}</ltx:XMTok>"
314314
. "</ltx:XMApp>"
315315
. ")",
316316
properties => { font => sub { LookupValue('font')->specialize("\x{2026}"); } });
317317

318-
DefConstructor('\xhookleftarrow[]{}',
318+
DefConstructor('\xhookleftarrow OptionalInScriptStyle InScriptStyle',
319319
"?#1("
320320
. "<ltx:XMApp role='ARROW'>"
321321
. "<ltx:XMWrap role='UNDERACCENT'>#1</ltx:XMWrap>"
@@ -327,12 +327,12 @@ DefConstructor('\xhookleftarrow[]{}',
327327
. ")("
328328
. "<ltx:XMApp role='ARROW'>"
329329
. "<ltx:XMWrap role='OVERACCENT'>#2</ltx:XMWrap>"
330-
. "<ltx:XMTok name='xhookleftarrow' role='ARROW'>\x{21A9}</ltx:XMTok>"
330+
. "<ltx:XMTok name='xhookleftarrow' role='ARROW' stretchy='true'>\x{21A9}</ltx:XMTok>"
331331
. "</ltx:XMApp>"
332332
. ")",
333333
properties => { font => sub { LookupValue('font')->specialize("\x{2026}"); } });
334334

335-
DefConstructor('\xhookrightarrow[]{}',
335+
DefConstructor('\xhookrightarrow OptionalInScriptStyle InScriptStyle',
336336
"?#1("
337337
. "<ltx:XMApp role='ARROW'>"
338338
. "<ltx:XMWrap role='UNDERACCENT'>#1</ltx:XMWrap>"
@@ -344,12 +344,12 @@ DefConstructor('\xhookrightarrow[]{}',
344344
. ")("
345345
. "<ltx:XMApp role='ARROW'>"
346346
. "<ltx:XMWrap role='OVERACCENT'>#2</ltx:XMWrap>"
347-
. "<ltx:XMTok name='xhookrightarrow' role='ARROW'>\x{21AA}</ltx:XMTok>"
347+
. "<ltx:XMTok name='xhookrightarrow' role='ARROW' stretchy='true'>\x{21AA}</ltx:XMTok>"
348348
. "</ltx:XMApp>"
349349
. ")",
350350
properties => { font => sub { LookupValue('font')->specialize("\x{2026}"); } });
351351

352-
DefConstructor('\xmapsto[]{}',
352+
DefConstructor('\xmapsto OptionalInScriptStyle InScriptStyle',
353353
"?#1("
354354
. "<ltx:XMApp role='ARROW'>"
355355
. "<ltx:XMWrap role='UNDERACCENT'>#1</ltx:XMWrap>"
@@ -361,12 +361,12 @@ DefConstructor('\xmapsto[]{}',
361361
. ")("
362362
. "<ltx:XMApp role='ARROW'>"
363363
. "<ltx:XMWrap role='OVERACCENT'>#2</ltx:XMWrap>"
364-
. "<ltx:XMTok name='xmapsto' role='ARROW'>\x{21A6}</ltx:XMTok>"
364+
. "<ltx:XMTok name='xmapsto' role='ARROW' stretchy='true'>\x{21A6}</ltx:XMTok>"
365365
. "</ltx:XMApp>"
366366
. ")",
367367
properties => { font => sub { LookupValue('font')->specialize("\x{2026}"); } });
368368

369-
DefConstructor('\xrightharpoondown[]{}',
369+
DefConstructor('\xrightharpoondown OptionalInScriptStyle InScriptStyle',
370370
"?#1("
371371
. "<ltx:XMApp role='ARROW'>"
372372
. "<ltx:XMWrap role='UNDERACCENT'>#1</ltx:XMWrap>"
@@ -383,7 +383,7 @@ DefConstructor('\xrightharpoondown[]{}',
383383
. ")",
384384
properties => { font => sub { LookupValue('font')->specialize("\x{2026}"); } });
385385

386-
DefConstructor('\xrightharpoonup[]{}',
386+
DefConstructor('\xrightharpoonup OptionalInScriptStyle InScriptStyle',
387387
"?#1("
388388
. "<ltx:XMApp role='ARROW'>"
389389
. "<ltx:XMWrap role='UNDERACCENT'>#1</ltx:XMWrap>"
@@ -395,12 +395,12 @@ DefConstructor('\xrightharpoonup[]{}',
395395
. ")("
396396
. "<ltx:XMApp role='ARROW'>"
397397
. "<ltx:XMWrap role='OVERACCENT'>#2</ltx:XMWrap>"
398-
. "<ltx:XMTok name='xrightharpoonup' role='ARROW'>\x{21C0}</ltx:XMTok>"
398+
. "<ltx:XMTok name='xrightharpoonup' role='ARROW' stretchy='true'>\x{21C0}</ltx:XMTok>"
399399
. "</ltx:XMApp>"
400400
. ")",
401401
properties => { font => sub { LookupValue('font')->specialize("\x{2026}"); } });
402402

403-
DefConstructor('\xleftharpoondown[]{}',
403+
DefConstructor('\xleftharpoondown OptionalInScriptStyle InScriptStyle',
404404
"?#1("
405405
. "<ltx:XMApp role='ARROW'>"
406406
. "<ltx:XMWrap role='UNDERACCENT'>#1</ltx:XMWrap>"
@@ -412,12 +412,12 @@ DefConstructor('\xleftharpoondown[]{}',
412412
. ")("
413413
. "<ltx:XMApp role='ARROW'>"
414414
. "<ltx:XMWrap role='OVERACCENT'>#2</ltx:XMWrap>"
415-
. "<ltx:XMTok name='xlefttharpoondown' role='ARROW'>\x{21BD}</ltx:XMTok>"
415+
. "<ltx:XMTok name='xlefttharpoondown' role='ARROW' stretchy='true'>\x{21BD}</ltx:XMTok>"
416416
. "</ltx:XMApp>"
417417
. ")",
418418
properties => { font => sub { LookupValue('font')->specialize("\x{2026}"); } });
419419

420-
DefConstructor('\xleftharpoonup[]{}',
420+
DefConstructor('\xleftharpoonup OptionalInScriptStyle InScriptStyle',
421421
"?#1("
422422
. "<ltx:XMApp role='ARROW'>"
423423
. "<ltx:XMWrap role='UNDERACCENT'>#1</ltx:XMWrap>"
@@ -429,12 +429,12 @@ DefConstructor('\xleftharpoonup[]{}',
429429
. ")("
430430
. "<ltx:XMApp role='ARROW'>"
431431
. "<ltx:XMWrap role='OVERACCENT'>#2</ltx:XMWrap>"
432-
. "<ltx:XMTok name='xleftharpoonup' role='ARROW'>\x{21BC}</ltx:XMTok>"
432+
. "<ltx:XMTok name='xleftharpoonup' role='ARROW' stretchy='true'>\x{21BC}</ltx:XMTok>"
433433
. "</ltx:XMApp>"
434434
. ")",
435435
properties => { font => sub { LookupValue('font')->specialize("\x{2026}"); } });
436436

437-
DefConstructor('\xrightleftharpoons[]{}',
437+
DefConstructor('\xrightleftharpoons OptionalInScriptStyle InScriptStyle',
438438
"?#1("
439439
. "<ltx:XMApp role='METARELOP'>"
440440
. "<ltx:XMWrap role='UNDERACCENT'>#1</ltx:XMWrap>"
@@ -446,12 +446,12 @@ DefConstructor('\xrightleftharpoons[]{}',
446446
. ")("
447447
. "<ltx:XMApp role='METARELOP'>"
448448
. "<ltx:XMWrap role='OVERACCENT'>#2</ltx:XMWrap>"
449-
. "<ltx:XMTok name='xrightleftharpoons' role='METARELOP'>\x{21CC}</ltx:XMTok>"
449+
. "<ltx:XMTok name='xrightleftharpoons' role='METARELOP' stretchy='true'>\x{21CC}</ltx:XMTok>"
450450
. "</ltx:XMApp>"
451451
. ")",
452452
properties => { font => sub { LookupValue('font')->specialize("\x{2026}"); } });
453453

454-
DefConstructor('\xleftrightharpoons[]{}',
454+
DefConstructor('\xleftrightharpoons OptionalInScriptStyle InScriptStyle',
455455
"?#1("
456456
. "<ltx:XMApp role='METARELOP'>"
457457
. "<ltx:XMWrap role='UNDERACCENT'>#1</ltx:XMWrap>"
@@ -463,7 +463,7 @@ DefConstructor('\xleftrightharpoons[]{}',
463463
. ")("
464464
. "<ltx:XMApp role='METARELOP'>"
465465
. "<ltx:XMWrap role='OVERACCENT'>#2</ltx:XMWrap>"
466-
. "<ltx:XMTok name='xleftrightharpoons' role='METARELOP'>\x{21CB}</ltx:XMTok>"
466+
. "<ltx:XMTok name='xleftrightharpoons' role='METARELOP' stretchy='true'>\x{21CB}</ltx:XMTok>"
467467
. "</ltx:XMApp>"
468468
. ")",
469469
properties => { font => sub { LookupValue('font')->specialize("\x{2026}"); } });

lib/LaTeXML/Post/MathML.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1492,7 +1492,7 @@ DefMathML('Apply:OVERACCENT:?', sub {
14921492
my ($xaccent, $xbase) = element_nodes($base);
14931493
if (($xaccent->getAttribute('role') || '') eq 'UNDERACCENT') {
14941494
return ['m:munderover', { accent => 'true', accentunder => 'true' },
1495-
pmml($xbase), pmml_scriptsize($xaccent), pmml($accent)]; } }
1495+
pmml($xbase), pmml($xaccent), pmml($accent)]; } }
14961496
return ['m:mover', { accent => 'true' }, pmml($base), pmml($accent)]; });
14971497

14981498
DefMathML('Apply:UNDERACCENT:?', sub {
@@ -1501,7 +1501,7 @@ DefMathML('Apply:UNDERACCENT:?', sub {
15011501
my ($xaccent, $xbase) = element_nodes($base);
15021502
if (($xaccent->getAttribute('role') || '') eq 'OVERACCENT') {
15031503
return ['m:munderover', { accent => 'true', accentunder => 'true' },
1504-
pmml($xbase), pmml_scriptsize($accent), pmml($xaccent)]; } }
1504+
pmml($xbase), pmml($accent), pmml($xaccent)]; } }
15051505
return ['m:munder', { accentunder => 'true' }, pmml($base), pmml($accent)]; });
15061506

15071507
DefMathML('Apply:ENCLOSE:?', sub {

lib/LaTeXML/resources/XSLT/LaTeXML-epub3.xsl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@
3838
<xsl:apply-templates select="." mode="doctype"/>
3939
<xsl:element name="html" namespace="{$html_ns}">
4040
<xsl:apply-templates select="." mode="begin"/>
41+
<xsl:choose>
42+
<xsl:when test="*/@xml:lang">
43+
<xsl:apply-templates select="*/@xml:lang" mode="copy-attribute"/>
44+
</xsl:when>
45+
<xsl:otherwise><!-- the default language is English -->
46+
<xsl:attribute name="lang">en</xsl:attribute>
47+
</xsl:otherwise>
48+
</xsl:choose>
4149
<xsl:apply-templates select="." mode="head"/>
4250
<xsl:apply-templates select="." mode="body"/>
4351
<xsl:apply-templates select="." mode="end"/>

0 commit comments

Comments
 (0)