From 8465e56f7c7afeaa728b24be277ce897acb37a49 Mon Sep 17 00:00:00 2001 From: Bruce Miller Date: Sun, 24 Nov 2024 14:58:52 -0500 Subject: [PATCH] Make \hrule close ltx:p, if it's a full-width rule --- lib/LaTeXML/Engine/TeX_Box.pool.ltxml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/LaTeXML/Engine/TeX_Box.pool.ltxml b/lib/LaTeXML/Engine/TeX_Box.pool.ltxml index c275e992f..788d1a104 100644 --- a/lib/LaTeXML/Engine/TeX_Box.pool.ltxml +++ b/lib/LaTeXML/Engine/TeX_Box.pool.ltxml @@ -679,6 +679,10 @@ DefConstructor('\hrule RuleSpecification', . "())", afterConstruct => sub { # NOTE: Only For xy development! Warn('unexpected', 'hrule', $_[0], "Encountered \\hrule in SVG") if inSVG(); }, + beforeConstruct => sub { + my ($document, $whatsit) = @_; + my $w = $whatsit->getProperty('rwidthr'); + $_[0]->maybeCloseElement('ltx:p') if $w && ($w eq '100%'); }, afterDigest => sub { my ($stomach, $whatsit) = @_; my $dims = $whatsit->getArg(1);