"
@@ -1670,11 +1671,11 @@ DefConstructor('\trivlist@item@ OptionalUndigested',
properties => sub { ($_[1] ? (tag => Digest(Expand($_[1]))) : ()); });
DefMacro('\@trivlist', '\relax', locked => 1);
-DefRegister('\topsep' => Glue(0));
-DefRegister('\partopsep' => Glue(0));
-DefRegister('\lx@default@itemsep' => Glue(0));
-DefRegister('\itemsep' => Glue(0));
-DefRegister('\parsep' => Glue(0));
+DefRegister('\topsep' => Glue('8pt plus 2pt minus 4pt'));
+DefRegister('\partopsep' => Glue('2pt plus 1pt minus 1pt'));
+DefRegister('\lx@default@itemsep' => Glue('4pt plus 2pt minus 1pt'));
+DefRegister('\itemsep' => Glue('4pt plus 2pt minus 1pt'));
+DefRegister('\parsep' => Glue('4pt plus 2pt minus 1pt'));
DefRegister('\@topsep' => Glue(0));
DefRegister('\@topsepadd' => Glue(0));
DefRegister('\@outerparskip' => Glue(0));
@@ -1750,7 +1751,6 @@ sub beforeDigestVerbatim {
AssignValue(current_environment => 'verbatim');
DefMacroI('\@currenvir', undef, 'verbatim');
MergeFont(family => 'typewriter');
- # Digest(T_CS('\par')); # NO! See beforeConstruct!
return @stuff; }
sub afterDigestVerbatim {
@@ -1843,7 +1843,7 @@ DefConstructor('\@internal@math@verb{} Undigested {}',
DefConstructor('\@internal@text@verb{} Undigested {}',
"#3",
font => { family => 'typewriter', series => 'medium', shape => 'upright' },
- enterHorizontal => 1,
+ mode => 'restricted_horizontal', enterHorizontal => 1,
beforeConstruct => sub {
my ($doc, $whatsit) = @_;
$doc->canContain($doc->getElement, '#PCDATA') || $doc->openElement('ltx:p'); },
@@ -2025,6 +2025,9 @@ sub afterEquation {
elsif ($whatsit) {
$whatsit->setProperties(%{ LookupValue('EQUATIONROW_TAGS') }); }
$$numbering{in_equation} = 0;
+ $whatsit->setProperties(
+ padtop => LookupRegister('\abovedisplayskip'),
+ padbottom => LookupRegister('\belowdisplayskip')) if $whatsit;
return; }
# My first inclination is to Lock {math}, but it is surprisingly common to redefine it in silly ways... So...?
@@ -3359,11 +3362,25 @@ Tag('ltx:table', afterClose => sub { BuildPanelsAndID(@_, 'tab'); });
# These may need to float up to where they're allowed,
# or they may need to close or similar.
+# These (should) appear in an internal_vertical context,
+# BUT the arg should be processed to a horizontal (paragraph) List!
DefConstructor('\@@caption{}', "^^#1",
- sizer => 0, mode => 'restricted_horizontal',
+ sizer => '#1',
+ beforeDigest => sub {
+ $_[0]->beginMode('internal_vertical');
+ $_[0]->enterHorizontal; },
+ afterDigest => sub {
+ $_[0]->leaveHorizontal_internal;
+ $_[0]->endMode('internal_vertical') },
);
DefConstructor('\@@toccaption{}', "^^#1",
- sizer => 0, mode => 'restricted_horizontal',
+ sizer => 0,
+ beforeDigest => sub {
+ $_[0]->beginMode('internal_vertical');
+ $_[0]->enterHorizontal; },
+ afterDigest => sub {
+ $_[0]->leaveHorizontal_internal;
+ $_[0]->endMode('internal_vertical') },
);
sub beforeFloat {
@@ -4183,8 +4200,8 @@ DefConstructor('\@@cite []{}', "#2#3#4",
- enterHorizontal => 1,
- properties => sub { (bibrefs => CleanBibKey($_[2]),
+ mode => 'restricted_horizontal', enterHorizontal => 1,
+ properties => sub { (bibrefs => CleanBibKey($_[2]),
separator => DigestText(LookupValue('CITE_SEPARATOR')),
yyseparator => DigestText(LookupValue('CITE_YY_SEPARATOR')),
bibunit => LookupValue('CITE_UNIT')); });
@@ -4630,9 +4647,6 @@ DefPrimitive('\hspace OptionalMatch:* {Dimension}', sub {
width => $length, isSpace => 1); });
DefMacro('\vspace OptionalMatch:* {}', '\vskip #2\relax');
-DefPrimitive('\addvspace {}', undef);
-DefPrimitive('\addpenalty {}', undef);
-DefPrimitiveI('\@endparenv');
# \hfill, \vfill
@@ -4736,7 +4750,9 @@ Let('\lx@parboxnewline', '\lx@newline'); # Obsolete, but in case still used
# NOTE: There are 2 extra arguments (See LaTeX Companion, p.866)
# for height and inner-pos. We're ignoring inner-pos, for now, though.
DefMacro('\parbox[] [] [] {Dimension}{}',
-'\lx@hidden@bgroup\hsize=#4\textwidth\hsize\columnwidth\hsize\ifx.#2.\lx@parbox[#1]{#4}{#5}\else\lx@parbox[#1][#2][#3]{#4}{#5}\fi\lx@hidden@egroup');
+ '\lx@hidden@bgroup\hsize=#4\textwidth\hsize\columnwidth\hsize'
+ . '\parindent\z@\parskip\z@skip'
+ . '\ifx.#2.\lx@parbox[#1]{#4}{#5}\else\lx@parbox[#1][#2][#3]{#4}{#5}\fi\lx@hidden@egroup');
DefConstructor('\lx@parbox[][Dimension] OptionalUndigested {Dimension} VBoxContents', sub {
my ($document, $attachment, $b, $c, $width, $body, %props) = @_;
@@ -4749,9 +4765,9 @@ DefConstructor('\lx@parbox[][Dimension] OptionalUndigested {Dimension} VBoxConte
sizer => '#5',
properties => sub {
(width => $_[4],
- vattach => translateAttachment($_[1]),
- height => $_[2]); },
- mode => 'internal_vertical',
+ vattach => translateAttachment($_[1]),
+ totalheight => $_[2]); },
+ mode => 'inline_internal_vertical',
robust => 1,
beforeDigest => sub {
Let('\\\\', '\lx@newline'); });
@@ -4768,7 +4784,7 @@ DefEnvironment('{minipage}[] OptionalUndigested [] {Dimension}', sub {
class => 'ltx_minipage');
return; },
sizer => '#body',
- mode => 'internal_vertical',
+ mode => 'inline_internal_vertical',
beforeDigest => sub {
Digest(T_CS('\@minipagetrue')); },
afterDigestBegin => sub {
@@ -4951,7 +4967,7 @@ DefEnvironment('{picture} Pair OptionalPair',
. " fill='none' stroke='none' unitlength='#unitlength'>"
. "?#transform(#body)(#body)"
. "",
- mode => 'internal_vertical',
+ mode => 'inline_internal_vertical',
beforeDigest => \&before_picture,
properties => sub {
my ($stomach, $size, $pos) = @_;
diff --git a/lib/LaTeXML/Package/IEEEtran.cls.ltxml b/lib/LaTeXML/Package/IEEEtran.cls.ltxml
index e2c363b321..052d25dfee 100644
--- a/lib/LaTeXML/Package/IEEEtran.cls.ltxml
+++ b/lib/LaTeXML/Package/IEEEtran.cls.ltxml
@@ -343,20 +343,17 @@ DefMacro('\IEEEiedlabeljustifyr', '');
# also, we skip the internal @-named variants for now.
DefEnvironment('{IEEEitemize}[]',
"#body",
- properties => sub { beginItemize('itemize', '@item'); },
- beforeDigestEnd => sub { Digest('\par'); },
- locked => 1, mode => 'internal_vertical');
+ properties => sub { beginItemize('itemize', '@item'); },
+ locked => 1, mode => 'internal_vertical');
DefEnvironment('{IEEEenumerate}[]',
"#body",
- properties => sub { beginItemize('enumerate', 'enum'); },
- beforeDigestEnd => sub { Digest('\par'); },
- locked => 1, mode => 'internal_vertical');
+ properties => sub { beginItemize('enumerate', 'enum'); },
+ locked => 1, mode => 'internal_vertical');
DefEnvironment('{IEEEdescription}[]',
"#body",
- beforeDigest => sub { Let('\makelabel', '\descriptionlabel'); },
- properties => sub { beginItemize('description', '@desc'); },
- beforeDigestEnd => sub { Digest('\par'); },
- locked => 1, mode => 'internal_vertical');
+ beforeDigest => sub { Let('\makelabel', '\descriptionlabel'); },
+ properties => sub { beginItemize('description', '@desc'); },
+ locked => 1, mode => 'internal_vertical');
# override LaTeX's default IED lists
Let('\itemize', '\IEEEitemize');
diff --git a/lib/LaTeXML/Package/alltt.sty.ltxml b/lib/LaTeXML/Package/alltt.sty.ltxml
index ec05722ab1..f38ec50776 100644
--- a/lib/LaTeXML/Package/alltt.sty.ltxml
+++ b/lib/LaTeXML/Package/alltt.sty.ltxml
@@ -18,12 +18,13 @@ use LaTeXML::Package;
#**********************************************************************
DefEnvironment('{alltt}', "#body",
- font => { family => 'typewriter', series => 'medium', shape => 'upright' },
+ font => { family => 'typewriter', series => 'medium', shape => 'upright' },
+ mode => 'internal_vertical',
beforeDigest => sub {
map { AssignCatcode($_ => CC_OTHER) } '$', '&', '#', '^', '_', '%', '~';
AssignCatcode(" " => 13);
Let(T_ACTIVE(" "), '\space');
- AssignCatcode("\r" => 13); # Variant of \obeylines
+ AssignCatcode("\r" => 13); # Variant of \obeylines
Let(T_ACTIVE("\r"), Token("\n", CC_SPACE)); # More appropriate than \par, I think?
AssignValue(PRESERVE_NEWLINES => 1);
# \@noligs: This SHOULD inhibit ligature substitution! (eg quotes, dots, etc!!!)
diff --git a/lib/LaTeXML/Package/array.sty.ltxml b/lib/LaTeXML/Package/array.sty.ltxml
index 47dec92c15..ec26b51be8 100644
--- a/lib/LaTeXML/Package/array.sty.ltxml
+++ b/lib/LaTeXML/Package/array.sty.ltxml
@@ -24,18 +24,19 @@ DefMacroI('\lasthline', undef, '\hline');
DefColumnType('>{}', sub { $LaTeXML::BUILD_TEMPLATE->addBeforeColumn($_[1]->unlist); return; });
DefColumnType('<{}', sub { $LaTeXML::BUILD_TEMPLATE->addAfterColumn($_[1]->unlist); return; });
-# This is the same as p
-# but really needs to specify vertical alignment as centered
+# m{} and b{} are like p{}, but vertical alignment is middle or bottom
DefColumnType('m{Dimension}', sub {
- $LaTeXML::BUILD_TEMPLATE->addColumn(before => Tokens(T_CS('\vtop'), T_BEGIN), #Tokens(T_BEGIN),
- after => Tokens(T_END),
- align => 'justify', width => $_[1], vattach => 'middle'); return; });
-# This is also the same as p
-# but really needs to specify vertical alignment as bottom
+ $LaTeXML::BUILD_TEMPLATE->addColumn(
+ before => Tokens(T_CS('\lx@tabular@p'), T_LETTER('m'), T_BEGIN, $_[1]->revert, T_END, T_BEGIN),
+ after => Tokens(T_END),
+ vattach => 'middle',
+ ); return; });
DefColumnType('b{Dimension}', sub {
- $LaTeXML::BUILD_TEMPLATE->addColumn(before => Tokens(T_CS('\vbox'), T_BEGIN), #Tokens(T_BEGIN),
- after => Tokens(T_END),
- align => 'justify', width => $_[1], vattach => 'bottom'); return; });
+ $LaTeXML::BUILD_TEMPLATE->addColumn(
+ before => Tokens(T_CS('\lx@tabular@p'), T_LETTER('b'), T_BEGIN, $_[1]->revert, T_END, T_BEGIN),
+ after => Tokens(T_END),
+ vattach => 'bottom',
+ ); return; });
# Like @{}, but should NOT suppress intercolumn space
DefColumnType('!{}', sub {
diff --git a/lib/LaTeXML/Package/beamer.cls.ltxml b/lib/LaTeXML/Package/beamer.cls.ltxml
index 3e77aebad8..c1ccfe9303 100644
--- a/lib/LaTeXML/Package/beamer.cls.ltxml
+++ b/lib/LaTeXML/Package/beamer.cls.ltxml
@@ -98,7 +98,7 @@ sub readLiteralBalanced {
my ($gullet) = @_;
my $tok = $gullet->readXToken;
$gullet->unread($tok);
- return undef unless (ref $tok && ToString($tok) eq '{');
+ return unless (ref $tok && ToString($tok) eq '{');
return $gullet->readArg; }
#**********************************************************************
@@ -236,7 +236,7 @@ sub matchesModeSpec {
# process the specification into a list of modes!
$spec =~ s/\s//g;
my $haystacks = $BEAMER_SPECIFICATION->mode_spec($spec);
- return undef unless defined($haystacks);
+ return unless defined($haystacks);
# iterate over the list of modes, and check if at least one of them matches
foreach my $haystack (@{$haystacks}) {
return 1 if matchesMode($haystack, $mode); }
@@ -338,7 +338,7 @@ sub getNextSlide {
while ($temporal == -1) {
$no++;
$temporal = getTemporalSlide($actions, $no); }
- return undef if ($temporal == 1); # we don't have another slide!
+ return if ($temporal == 1); # we don't have another slide!
$no; }
#**********************************************************************
@@ -375,7 +375,7 @@ sub digestBeamerSpec {
# See getTemporalSlide for return values.
sub digestOverlaySpec {
my ($spec) = @_;
- return undef unless defined($spec);
+ return unless defined($spec);
$spec = ToString(Expand($spec)); # TODO: Should this be done ealier? Perhaps in the argument type?
# get the action
my $action = digestBeamerSpec($spec, 0);
@@ -394,14 +394,14 @@ sub digestOverlaySpec {
# See getSlideActions for return values.
sub digestActionSpec {
my ($spec) = @_;
- return undef unless defined($spec);
+ return unless defined($spec);
$spec = ToString(Expand($spec)); # TODO: Should this be done ealier? Perhaps in the argument type?
# get the action
my $action = digestBeamerSpec($spec, 1);
unless (defined($action)) {
Warn('unexpected', '', $spec, 'Missing overlay specification, treated as matching');
return 0; }
- return undef unless defined($action);
+ return unless defined($action);
# check if we need to do anything
getSlideActions($action); }
@@ -1160,22 +1160,22 @@ DefMacro('\beamer@item@before BeamerAngled []', sub {
DefEnvironment('{itemize} [BeamerAngled]',
"#body",
properties => sub { beginBeamerItemize($_[1], 'itemize', '@item'); },
- beforeDigestEnd => sub { Digest('\par'); Digest('\beamer@closeitem'); },
+ beforeDigestEnd => sub { Digest('\beamer@closeitem'); },
locked => 1, mode => 'internal_vertical');
# from enumitem package, because of the second arg!
DefEnvironment('{enumerate} [BeamerAngled] OptionalUndigested',
"#body",
properties => sub { beginBeamerItemize($_[1], 'enumerate', 'enum'); },
- beforeDigestEnd => sub { Digest('\par'); Digest('\beamer@closeitem'); },
- afterDigestBegin => sub { setEnumerationStyle($_[1]->getArg(2)); });
-
+ beforeDigestEnd => sub { Digest('\beamer@closeitem'); },
+ afterDigestBegin => sub { setEnumerationStyle($_[1]->getArg(2)); },
+ locked => 1, mode => 'internal_vertical');
# from LaTeX.Pool
DefEnvironment('{description} [BeamerAngled]',
"#body",
beforeDigest => sub { Let('\makelabel', '\descriptionlabel'); },
properties => sub { beginBeamerItemize($_[1], 'description', '@desc'); },
- beforeDigestEnd => sub { Digest('\par'); Digest('\beamer@closeitem'); },
+ beforeDigestEnd => sub { Digest('\beamer@closeitem'); },
locked => 1, mode => 'internal_vertical');
#**********************************************************************
diff --git a/lib/LaTeXML/Package/elsarticle.cls.ltxml b/lib/LaTeXML/Package/elsarticle.cls.ltxml
index 1b3d869fe3..fee20f9838 100644
--- a/lib/LaTeXML/Package/elsarticle.cls.ltxml
+++ b/lib/LaTeXML/Package/elsarticle.cls.ltxml
@@ -57,13 +57,11 @@ DefMacro('\biboptions{}', '\setcitestyle{#1}');
# (not even sure what the intended effect is)
DefEnvironment('{enumerate}[]',
"#body",
- properties => sub { beginItemize('enumerate', 'enum'); },
- beforeDigestEnd => sub { Digest('\par'); },
- locked => 1, mode => 'internal_vertical');
+ properties => sub { beginItemize('enumerate', 'enum'); },
+ locked => 1, mode => 'internal_vertical');
DefEnvironment('{itemize}[]',
"#body",
- properties => sub { beginItemize('itemize', 'enum'); },
- beforeDigestEnd => sub { Digest('\par'); },
- locked => 1, mode => 'internal_vertical');
+ properties => sub { beginItemize('itemize', 'enum'); },
+ locked => 1, mode => 'internal_vertical');
1;
diff --git a/lib/LaTeXML/Package/enumerate.sty.ltxml b/lib/LaTeXML/Package/enumerate.sty.ltxml
index 6109b0704a..e4b90b164e 100644
--- a/lib/LaTeXML/Package/enumerate.sty.ltxml
+++ b/lib/LaTeXML/Package/enumerate.sty.ltxml
@@ -18,8 +18,8 @@ use LaTeXML::Package;
# Redefines LaTeX's enumerate to take an additional style argument
DefEnvironment('{enumerate} OptionalUndigested',
"#body",
+ mode => 'internal_vertical',
properties => sub { beginItemize('enumerate', 'enum'); },
- beforeDigestEnd => sub { Digest('\par'); },
afterDigestBegin => sub { setEnumerationStyle($_[1]->getArg(1)); });
1;
diff --git a/lib/LaTeXML/Package/enumitem.sty.ltxml b/lib/LaTeXML/Package/enumitem.sty.ltxml
index c2c16eb52b..e65c7794e1 100644
--- a/lib/LaTeXML/Package/enumitem.sty.ltxml
+++ b/lib/LaTeXML/Package/enumitem.sty.ltxml
@@ -144,14 +144,12 @@ if (!LookupValue('enumitem@loadonly')) {
DefEnvironment('{itemize} OptionalKeyVals:enumitem',
"#body",
properties => sub { beginEnumItemize('itemize', '@item', $_[1]); },
- beforeDigestEnd => sub { Digest('\par'); },
afterDigestBody => sub { endEnumItemize($_[1]); },
mode => 'internal_vertical',
locked => 1);
DefEnvironment('{enumerate} OptionalKeyVals:enumitem',
"#body",
properties => sub { beginEnumItemize('enumerate', 'enum', $_[1]); },
- beforeDigestEnd => sub { Digest('\par'); },
afterDigestBody => sub { endEnumItemize($_[1]); },
mode => 'internal_vertical',
locked => 1);
@@ -159,7 +157,6 @@ if (!LookupValue('enumitem@loadonly')) {
"#body",
beforeDigest => sub { Let('\makelabel', '\descriptionlabel'); },
properties => sub { beginEnumItemize('description', '@desc', $_[1]); },
- beforeDigestEnd => sub { Digest('\par'); },
afterDigestBody => sub { endEnumItemize($_[1]); },
mode => 'internal_vertical',
locked => 1);
@@ -169,17 +166,17 @@ if (LookupValue('enumitem@inline')) {
"#body",
properties => sub { beginEnumItemize('inline@itemize', '@item', $_[1]); },
afterDigestBody => sub { endEnumItemize($_[1]); },
- mode => 'internal_vertical');
+ mode => 'inline_internal_vertical');
DefEnvironment('{enumerate*} OptionalKeyVals:enumitem',
"#body",
properties => sub { beginEnumItemize('inline@enumerate', 'enum', $_[1]); },
afterDigestBody => sub { endEnumItemize($_[1]); },
- mode => 'internal_vertical');
+ mode => 'inline_internal_vertical');
DefEnvironment('{description*} OptionalKeyVals:enumitem',
"#body",
properties => sub { beginEnumItemize('inline@description', '@desc', $_[1]); },
afterDigestBody => sub { endEnumItemize($_[1]); },
- mode => 'internal_vertical');
+ mode => 'inline_internal_vertical');
}
DefPrimitive('\newlist{}{}{}', sub {
my ($stomach, $listname, $listtype, $maxdepth) = @_;
@@ -199,9 +196,8 @@ DefPrimitive('\newlist{}{}{}', sub {
DefEnvironmentI($listname, "OptionalKeyVals:enumitem",
"#body",
properties => sub { beginEnumItemize($listname, $listname, $_[1]); },
- beforeDigestEnd => sub { Digest('\par'); },
afterDigestBody => sub { endEnumItemize($_[1]); },
- mode => 'internal_vertical',
+ mode => ($inline ? 'inline_internal_vertical' : 'internal_vertical'),
locked => 1);
return; });
Let('\renewlist', '\newlist');
diff --git a/lib/LaTeXML/Package/fancyvrb.sty.ltxml b/lib/LaTeXML/Package/fancyvrb.sty.ltxml
index e414f0bccf..caee3477f8 100644
--- a/lib/LaTeXML/Package/fancyvrb.sty.ltxml
+++ b/lib/LaTeXML/Package/fancyvrb.sty.ltxml
@@ -19,6 +19,10 @@ use LaTeXML::Package;
InputDefinitions('fancyvrb', type => 'sty', noltxml => 1);
+# Hack internals to add css class ltx_nowrap
+Let('\lx@save@FancyVerbFormatLine', '\FancyVerbFormatLine');
+DefMacro('\FancyVerbFormatLine{}',
+ '\lx@add@cssclass{ltx_verbatim}\lx@save@FancyVerbFormatLine{#1}');
#**********************************************************************
1;
diff --git a/lib/LaTeXML/Package/graphics.sty.ltxml b/lib/LaTeXML/Package/graphics.sty.ltxml
index f3878e1ea1..45cb608714 100644
--- a/lib/LaTeXML/Package/graphics.sty.ltxml
+++ b/lib/LaTeXML/Package/graphics.sty.ltxml
@@ -63,9 +63,9 @@ DefParameterType('GraphixDimensions', sub {
sub graphics_scaledbox_props {
my ($box, $xscale, $yscale) = @_;
my ($w, $h, $d) = $box->getSize;
- my ($sw, $sh, $sd) =
+ my ($sw, $sh, $sd) =
($w && $w->multiply($xscale), $h && $h->multiply($yscale), $d && $d->multiply($yscale));
- my $H = $h && ($d ? $h->add($d) : $h);
+ my $H = $h && ($d ? $h->add($d) : $h);
my $sH = $sh && ($sd ? $sh->add($sd) : $sh);
return (
box => $box,
@@ -78,7 +78,7 @@ sub graphics_scaledbox_props {
depth => $sd,
totalheight => $h && ($d ? $h->add($d) : $h)->multiply($yscale),
xtranslate => $sw && $w && $sw->subtract($w)->multiply(+0.5),
- ytranslate => $sH && $H && $sH->subtract($H)->multiply(-0.5) ); }
+ ytranslate => $sH && $H && $sH->subtract($H)->multiply(-0.5)); }
sub graphics_scaledbox_insert {
my ($document, %props) = @_;
diff --git a/lib/LaTeXML/Package/pgfsys-latexml.def.ltxml b/lib/LaTeXML/Package/pgfsys-latexml.def.ltxml
index 6d44b4072e..8ab9a5db61 100644
--- a/lib/LaTeXML/Package/pgfsys-latexml.def.ltxml
+++ b/lib/LaTeXML/Package/pgfsys-latexml.def.ltxml
@@ -84,10 +84,13 @@ DefConstructor('\lxSVG@insertpicture{}', sub {
$document->absorb($content);
$document->closeElement('svg:g'); }
else {
+ my $font = $props{_font};
$document->openElement('ltx:picture');
$document->openElement('svg:svg',
version => "1.1",
- width => $props{pxwidth}, height => $props{pxheight}, style => $props{style},
+ width => $props{width}->emValue(2, $font) . 'em',
+ height => $props{height}->emValue(2, $font) . 'em',
+ style => $props{style},
viewBox => "$props{minx} $props{miny} $props{pxwidth} $props{pxheight}",
overflow => "visible");
my $x0 = -(0 + $props{minx});
@@ -134,6 +137,8 @@ DefConstructor('\lxSVG@insertpicture{}', sub {
$whatsit->setProperty(pxwidth => $w);
$whatsit->setProperty(pxheight => $h);
$whatsit->setProperty(style => "vertical-align:" . $base . "px") if $base;
+ $whatsit->setProperty(_font => $whatsit->getFont);
+
# or tikz macro (see corescopes)
return; },
# \pgfpicture seems to make a 0 sized box, which throws off our postprocessor
diff --git a/lib/LaTeXML/Package/setspace.sty.ltxml b/lib/LaTeXML/Package/setspace.sty.ltxml
index 54c5a61f5c..bcf208c127 100644
--- a/lib/LaTeXML/Package/setspace.sty.ltxml
+++ b/lib/LaTeXML/Package/setspace.sty.ltxml
@@ -26,10 +26,11 @@ DefEnvironment("{onehalfspace}", "#body");
DefEnvironment("{doublespace}", "#body");
DefEnvironment("{spacing}{}", "#body");
-DefMacroI('\setstretch', '{}', '');
-DefMacroI('\SetSinglespace', '{}', '');
-DefMacroI('\setdisplayskipstretch', '{}', '');
-DefMacroI('\restore@spacing', undef, '');
+DefMacro('\setspace@singlespace', '1');
+DefMacro('\setstretch{}', '\def\baselinestretch{#1}');
+DefMacro('\SetSinglespace{}', '\def\setspace@singlespace{#1}');
+DefMacro('\setdisplayskipstretch{}', '');
+DefMacro('\restore@spacing', '');
#**********************************************************************
1;
diff --git a/lib/LaTeXML/Package/soul.sty.ltxml b/lib/LaTeXML/Package/soul.sty.ltxml
index 4fc1bf4edf..f6087dc083 100644
--- a/lib/LaTeXML/Package/soul.sty.ltxml
+++ b/lib/LaTeXML/Package/soul.sty.ltxml
@@ -68,7 +68,7 @@ sub getSOULcolor {
# (should set framecolor from \setulcolor)
DefConstructor('\textul{}',
"#1",
- enterHorizontal => 1,
+ enterHorizontal => 1, mode => 'restricted_horizontal',
properties => { framecolor => sub { getSOULcolor('soul_ul_color'); } });
# Customizing underlines
@@ -85,7 +85,7 @@ DefMacro('\setuloverlap{Dimension}', undef);
# but then how to make framecolor end up as text-decoration-color?
DefConstructor('\textst{}',
"#1",
- enterHorizontal => 1,
+ enterHorizontal => 1, mode => 'restricted_horizontal',
properties => { framecolor => sub {
my $framecolor = getSOULcolor('soul_strike_color');
return $framecolor ? "text-decoration-color:" . ($framecolor->toAttribute()) . ";" : ""; } });
@@ -97,7 +97,7 @@ DefPrimitive('\setstcolor{}', sub { AssignValue(soul_strike_color => $_[1]); });
DefMacro('\texthl', '\@ifpackageloaded{color}{\lx@texthl@color}{\textul}');
DefConstructor('\lx@texthl@color{}',
"#1",
- enterHorizontal => 1,
+ enterHorizontal => 1, mode => 'restricted_horizontal',
bounded => 1, beforeDigest => sub { MergeFont(background => getSOULcolor('soul_hl_color')); });
# Customizing highlight
AssignValue(soul_hl_color => 'yellow');
diff --git a/lib/LaTeXML/Package/xy.tex.ltxml b/lib/LaTeXML/Package/xy.tex.ltxml
index cb1105ec2f..410c44ff24 100644
--- a/lib/LaTeXML/Package/xy.tex.ltxml
+++ b/lib/LaTeXML/Package/xy.tex.ltxml
@@ -93,20 +93,18 @@ DefConstructor('\lx@xy@svgnested Digested',
return (width => $w, height => $y1, depth => $y0->negate, transform => $transform); });
DefConstructor('\lx@xy@svg Digested', sub {
-# ""
-# . ""
-# . "#1"
-# . "",
- my ($document,$content,%props) = @_;
+ my ($document, $content, %props) = @_;
+ my $font = $props{_font};
$document->openElement('ltx:picture');
$document->openElement('svg:svg',
- version => "1.1", overflow => "visible",
- width => $props{pxwidth}, height => $props{pxheight}, style => $props{style},
- viewBox => "$props{minx} $props{miny} $props{pxwidth} $props{pxheight}");
- $document->openElement('svg:g',transform => $props{transform}, _scopebegin => 1);
+ version => "1.1", overflow => "visible",
+ width => $props{width}->emValue(2, $font) . 'em',
+ height => $props{height}->emValue(2, $font) . 'em',
+ style => $props{style},
+ viewBox => "$props{minx} $props{miny} $props{pxwidth} $props{pxheight}");
+ $document->openElement('svg:g', transform => $props{transform}, _scopebegin => 1);
addSVGDebuggingBox($document,
- $props{x},$props{y},$props{width},$props{height},'#FF00FF')
+ $props{x}, $props{y}, $props{width}, $props{height}, '#FF00FF')
if $LaTeXML::DEBUG{svg};
$document->absorb($content);
$document->closeElement('svg:g');
@@ -118,26 +116,26 @@ DefConstructor('\lx@xy@svg Digested', sub {
|| [Dimension(0), Dimension(0), Dimension(0), Dimension(0)] };
Debug("XY: " . ToString($x0) . ' ' . ToString($y0) . ' ' . ToString($x1) . ' ' . ToString($y1))
if $LaTeXML::DEBUG{svg_verbose};
- my $w = $x1->subtract($x0);
- my $h = $y1->subtract($y0);
- if($w->valueOf < 0){ # Rarely, the range hasn't actually been set?!?
- $x0 = $x1 = Dimension(0); }
- if($h->valueOf < 0){
- $y0 = $y1 = Dimension(0); }
+ my $w = $x1->subtract($x0);
+ my $h = $y1->subtract($y0);
+ if ($w->valueOf < 0) { # Rarely, the range hasn't actually been set?!?
+ $x0 = $x1 = Dimension(0); }
+ if ($h->valueOf < 0) {
+ $y0 = $y1 = Dimension(0); }
my $x = $x0->negate;
my $y = $y1->subtract($y0);
my $minx = $x->pxValue;
my $miny = $y0->negate->pxValue;
my $transform = "matrix(1 0 0 -1 " . $x->pxValue . ' ' . $y->pxValue . ')';
- my $style = ($miny ? "vertical-align:".(-$miny)."px" : undef);
- my $pxwidth = max($w->pxValue,1);
- my $pxheight = max($h->pxValue,1);
+ my $style = ($miny ? "vertical-align:" . (-$miny) . "px" : undef);
+ my $pxwidth = max($w->pxValue, 1);
+ my $pxheight = max($h->pxValue, 1);
Debug("XY size: " . ToString($w) . ' x ' . ToString($h) . ' + ' . 0 . ' @ ' . ToString($x) . ' x ' . ToString($y))
if $LaTeXML::DEBUG{svg_verbose};
return (x => $x0, y => $y0, width => $w, height => $h,
- pxwidth => $pxwidth, pxheight => $pxheight,
- minx => $minx, miny => $miny, style => $style,
+ pxwidth => $pxwidth, pxheight => $pxheight,
+ minx => $minx, miny => $miny, style => $style,
transform => $transform); });
DefPrimitive('\lx@xy@capturerange', sub {
diff --git a/lib/LaTeXML/resources/CSS/LaTeXML.css b/lib/LaTeXML/resources/CSS/LaTeXML.css
index 5efd8d0186..aeafa34fd4 100644
--- a/lib/LaTeXML/resources/CSS/LaTeXML.css
+++ b/lib/LaTeXML/resources/CSS/LaTeXML.css
@@ -336,7 +336,7 @@ dl.ltx_description dl.ltx_description dd { margin-left:3em; }
max-width:0em; text-align:right; }
*/
.ltx_parbox {
- text-indent:0em;
+ text-indent:0em !important;
display: inline-block; }
/* NOTE that it is CRITICAL to put position:relative outside & absolute inside!!
@@ -442,10 +442,13 @@ span.ltx_framed { display:inline-block; text-indent:0; } /* avoid padding/
.ltx_rule { vertical-align: bottom; height: 0.4pt; width: 0.4pt; }
+.ltx_underline { text-decoration: underline; }
+.ltx_overline { text-decoration: overline; }
+
/*======================================================================
Misc */
/* .ltx_verbatim*/
-.ltx_verbatim { text-align:left; }
+.ltx_verbatim { text-align:left; white-space:nowrap; }
/*======================================================================
Meta stuff, footnotes */
.ltx_note_content { display:none; }
@@ -562,6 +565,7 @@ cite { font-style: normal; }
.ltx_minipage {
align-self: normal;
display: inline-block;
+ text-align: justify;
}
.ltx_minipage > .ltx_graphics {
max-width:100%;
diff --git a/lib/LaTeXML/resources/XSLT/LaTeXML-picture-xhtml.xsl b/lib/LaTeXML/resources/XSLT/LaTeXML-picture-xhtml.xsl
index 1c54000066..45dfda7a0c 100644
--- a/lib/LaTeXML/resources/XSLT/LaTeXML-picture-xhtml.xsl
+++ b/lib/LaTeXML/resources/XSLT/LaTeXML-picture-xhtml.xsl
@@ -169,8 +169,9 @@
ltx_foreignobject_container
ltx_foreignobject_content
-
-
+
+
+
diff --git a/t/alignment/array.xml b/t/alignment/array.xml
index be6d249e33..4096fbc791 100644
--- a/t/alignment/array.xml
+++ b/t/alignment/array.xml
@@ -19,24 +19,24 @@
- |
- Lorem ipsum dolor sit amet, consectetur adipisicing elit
+
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit
|
-
+ |
Lorem ipsum dolor sit amet, consectetur adipisicing elit
|
-
+ |
Lorem ipsum dolor sit amet, consectetur adipisicing elit
|
| | |
- |
- Lorem ipsum dolor sit amet, consectetur adipisicing elit
+
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit
|
-
+ |
Lorem ipsum dolor sit amet, consectetur adipisicing elit
|
-
+ |
Lorem ipsum dolor sit amet, consectetur adipisicing elit
|
| | |
diff --git a/t/alignment/cells.xml b/t/alignment/cells.xml
index 54cb7453f8..82b74577a0 100644
--- a/t/alignment/cells.xml
+++ b/t/alignment/cells.xml
@@ -69,8 +69,8 @@
- |
- Cell long text with predefined width
+
+ Cell long text with predefined width
|
|
|
@@ -79,8 +79,8 @@
- |
- Cell long…
+
+ Cell long…
|
|
|
@@ -148,13 +148,13 @@
- |
- Second multilined
+
+ Second multilined
|
|
- |
- column head
+
+ column head
|
|
@@ -298,8 +298,8 @@
- |
- Cell …
+
+ Cell …
|
|
|
@@ -308,8 +308,8 @@
- |
- Cell …
+
+ Cell …
|
|
|
diff --git a/t/alignment/colortbls.xml b/t/alignment/colortbls.xml
index 0ab5925dca..9a086e57b7 100644
--- a/t/alignment/colortbls.xml
+++ b/t/alignment/colortbls.xml
@@ -95,11 +95,11 @@ p{3cm}}"?>
- |
- P-column
+
+ P-column
|
-
- and another one
+
+ and another one
|
|
| |
- | Total |
- (wrong) |
+ Total |
+ (wrong) |
|
- |
- Some long text in the first column
+
+ Some long text in the first column
|
-
- bbb
+
+ bbb
|
|
| |
- |
- aaa
+
+ aaa
|
-
- and some long text in the second column
+
+ and some long text in the second column
|
|
| |
- | Total |
- (wrong) |
+ Total |
+ (wrong) |
|
- |
- aaa
+
+ aaa
|
-
- bbb
+
+ bbb
|
|
| |
- |
- Note that the coloured rules in all columns stretch to accomodate
+ |
+ Note that the coloured rules in all columns stretch to accomodate
large entries in one column.
|
-
- bbb
+
+ bbb
|
|
| |
- |
- aaa
+
+ aaa
|
-
- bbb
+
+ bbb
|
|
| |
- |
- aaa
+
+ aaa
|
-
- Depending on your driver you may get unsightly gaps or lines
+ |
+ Depending on your driver you may get unsightly gaps or lines
where the ‘screens’ used to produce different shapes interact
badly. You may want to cause adjacent panels of the same colour by
specifying a larger overhang
@@ -209,11 +209,11 @@ or by adding some negative space (in a ”“noalign” between rows.
|
| |
- |
- aaa
+
+ aaa
|
-
- bbb
+
+ bbb
|
| | |
- | * (first quarter only) |
+ * (first quarter only) |
diff --git a/t/alignment/tabular.xml b/t/alignment/tabular.xml
index b7cd9df21a..5bcfd6edf9 100644
--- a/t/alignment/tabular.xml
+++ b/t/alignment/tabular.xml
@@ -13,13 +13,13 @@
|
Price |
- |
+ |
| Year |
low |
high |
- Comments |
+ Comments |
@@ -27,24 +27,24 @@
1971 |
97– |
245 |
-
- Bad year.
+
+ Bad year.
|
| 72 |
245– |
245 |
-
- Light trading due to a heavy winter.
+
+ Light trading due to a heavy winter.
|
|
| 73 |
245– |
2001 |
-
- No gnus was very good gnus this year.
+
+ No gnus was very good gnus this year.
|
|
|
@@ -77,25 +77,25 @@
- | 1
- a
+ 1
+ a
2 |
-
- b
+
+ b
3 |
-
- c
+
+ c
4 |
| | |
- | 1
- a a a a a a a a a a
+ 1
+ a a a a a a a a a a
2 |
-
- b
+
+ b
3 |
-
- c
+
+ c
4 |
| | |
diff --git a/t/babel/numprints.xml b/t/babel/numprints.xml
index 2062b1feed..bb89e864a7 100644
--- a/t/babel/numprints.xml
+++ b/t/babel/numprints.xml
@@ -811,15 +811,15 @@ vs.
|