]*)?>//g; -# $close_tags .= "\n".$preitems if $preitems; +# $pre_items = $`; $_ = $&.$'; +# $pre_items =~ s/
]*)?>//g; +# $close_tags .= "\n".$pre_items if $pre_items; # } # $/ = $savedRS; # @@ -11879,9 +11995,9 @@ $_ =~ /\Q$item_sep\E|
]*)?>//gm; - $close_tags .= "\n".$preitems if $preitems; + $pre_items = $`; $_ = $&.$'; + $pre_items =~ s/
]*)?>//gm;
+	$close_tags = '' unless $pre_items;
     }
     # remove \n from end of the last item
     $_ =~ s/\n$//s;
@@ -11891,8 +12007,8 @@
 
     $/ = $savedRS;
 
-    join('' , $close_tags , "\n<$tag$compact>\n" 
-	 , $_ , "$ctag>" , $reopens);
+    join('' , "\n<$tag$compact>\n" 
+	 , $pre_items , $_ , $close_tags , "$ctag>");
 }
 
 
@@ -12295,7 +12411,7 @@
     if ((defined &do_cmd_refname)||$new_command{'refname'}) {
 	$br_id=++$global{'max_id'};
 	$title = &translate_environments("$O$br_id$C\\refname$O$br_id$C");
-    } else { $title = $ref_name }
+    } else { $title = $ref_title; }
     return $title;
 }
 
@@ -12645,7 +12761,13 @@
 #	    $color = $next unless ($color);
 #	}
 	$declarations{$next} =~ m|/);
+	my ($pre,$post) = ($`,$&);
+	if ($post =~ /$block_close_rx|$all_close_rx/ ) {
+	    # Don't close active block tags
+	    push (@$ot, $next);
+	    last;
+	}
+	$tags .= $post unless ($pre =~ /^<>/);
     }
     if ($size) {
 	$declarations{$size} =~ m|".$str) if ($inside_tabular);
+#
+#    my ($size,$closures,$reopens,@tags);
+#
+#    while (@$ot) {
+#	my $next = pop @$ot;
+#	$declarations{$next} =~ m|/);
+#	print STDOUT "\n$next>" if $VERBOSITY > 2;
+#
+#	if ($next =~ /$fontchange_rx/) {
+#	    # discard it
+#	} elsif ($next =~ /$fontweight_rx/) {
+#	    # discard it
+#	} elsif ($next =~ /$sizechange_rx/) {
+#	    $size = $next unless ($size);
+#	} else {
+#	    unshift (@tags, $next);
+#	    print STDOUT "\n<<$next>" if $VERBOSITY > 2;
+#	    $reopens .= $pre unless ($pre =~ /^<>/);
+#	}
+#    }
+#    push (@$ot, @tags);
+#    if ($size) {
+#	$declarations{$size} =~ m|/);
+#	push (@$ot,$size);
+#	print STDOUT "\n<$size>" if $VERBOSITY > 2;
+#    }
+#    join('', $closures, $reopens, $str);
+#}
+
 sub do_cmd_rmfamily{ &do_cmd_rm(@_) }
 
 sub do_cmd_textrm { 
@@ -13243,7 +13406,9 @@
 	$cmd =~ s/ //g;
 
 	# skip if a proper implementation already exists
-	$tmp = "do_cmd_$cmd";
+	local($dum1, $dum2) = ($cmd, '');
+	$dum1 = $cmd unless ($dum1 = &normalize($dum1, $dum2));
+	$tmp = "do_cmd_$dum1";
 	next if (defined &$tmp);
 
 	# Build routine body ...
@@ -13294,17 +13459,20 @@
 	# Generate a new subroutine
 	local($padding) = " ";
 	$padding = '' if (($cmd =~ /\W$/)||(!$args)||($args =~ /^\W/));
-	$code = "sub wrap_cmd_$cmd {" . "\n"
+	local($dum1, $dum2) = ($cmd, '');
+	$dum1 = $cmd unless ($dum1 = &normalize($dum1, $dum2));
+	local($wtmp) = "wrap_cmd_$dum1";
+	$code = "sub $wtmp {" . "\n"
 	    . 'local($cmd, $_) = @_; local ($args, $dummy, $pat) = "";' . "\n"
 	    . $body
-	    . (($thisone)? "print STDERR \"\\n$cmd:\".\$args.\"\\n\";\n" : '')
+	    . (($thisone)? "print STDERR \"\\n\", '$cmd', \":\".\$args.\"\\n\";\n" : '')
 	    . '(&make_wrapper(1).$cmd'
 	    . ($padding ? '"'.$padding.'"' : '')
 	    . '.$args.&make_wrapper(0), $_)}'
 	    . "\n";
 	print "\nWRAP_CMD: $code " if ($thisone); # for debugging
 	eval $code; # unless ($thisone);
-	print STDERR "\n*** sub wrap_cmd_$cmd  failed: $@" if ($@);
+	print STDERR "\n*** sub $wtmp  failed: $@" if ($@);
 
 	# And make sure the main loop will catch it ...
 #	$raw_arg_cmds{$cmd} = 1;
@@ -13378,30 +13546,33 @@
 	local($padding) = " ";
 	$padding = '' if (($cmd =~ /\W$/)||(!$args)||($args =~ /^\W/));
 	# Generate 2 new subroutines
-	$codeA = "sub wrap_cmd_$cmd {" . "\n"
+	local($dum1, $dum2) = ($cmd, '');
+	$dum1 = $cmd unless ($dum1 = &normalize($dum1, $dum2));
+	local($wtmp) = "wrap_cmd_$dum1";
+	$codeA = "sub $wtmp {" . "\n"
 	    .'local($cmd, $_) = @_; local($args, $dummy, $pat) = "";'."\n"
 	    . $bodyA
-	    . (($thisone)? "print \"\\nwrap $cmd:\\n\".\$args.\"\\n\";\n" : '')
+	    . (($thisone)? "print \"\\nwrap \", '$cmd', \":\\n\".\$args.\"\\n\";\n" : '')
 	    . '(&make_nowrapper(1)."\n".$cmd.'."\"$padding\""
 	    . '.$args.&make_nowrapper(0)," ".$_)}'
 	    ."\n";
 	print "\nWRAP_CMD: $codeA " if ($thisone); # for debugging
 	eval $codeA;
-	print STDERR "\n\n*** sub wrap_cmd_$cmd  failed: $@\n" if ($@);
-	$codeB = "do_cmd_$cmd";
+	print STDERR "\n\n*** sub $wtmp  failed: $@\n" if ($@);
+	$codeB = "do_cmd_$dum1";
 	do {
 	    $bodyB = '"";' if !($bodyB);
-	    $codeB = "sub do_cmd_$cmd {" . "\n"
+	    $codeB = "sub do_cmd_$dum1 {" . "\n"
 		. 'local($_,$ot) = @_;'."\n"
 		. 'local($open_tags_R) = defined $ot ? $ot : $open_tags_R;'."\n"
 		. 'local($cmd,$args,$dummy,$pat)=("'.$cmd.'","","","");'."\n"
 		. $bodyB
-		. (($thisone)? "print \"\\ndo $cmd:\".\$args.\"\\n\";\n" : '')
+		. (($thisone)? "print \"\\ndo \", '$cmd', \":\".\$args.\"\\n\";\n" : '')
 #		. '$latex_body.="\\n".&revert_to_raw_tex("'."\\\\$cmd$padding".'$args")."\\n\\n";'
 		. "\$_;}\n";
 	    print STDOUT "\nDO_CMD: $codeB " if ($thisone); # for debugging
 	    eval $codeB;
-	    print STDERR "\n\n*** sub do_cmd_$cmd  failed: $@\n" if ($@);
+	    print STDERR "\n\n*** sub do_cmd_$dum1  failed: $@\n" if ($@);
 	} unless (defined &$codeB );
 
 	# And make sure the main loop will catch it ...
@@ -13460,29 +13631,32 @@
 	local($padding) = " ";
 	$padding = '' if (($cmd =~ /\W$/)||(!$args)||($args =~ /^\W/));
 	# Generate 2 new subroutines
-	$codeA = "sub wrap_cmd_$cmd {" . "\n"
+	local($dum1, $dum2) = ($cmd, '');
+	$dum1 = $cmd unless ($dum1 = &normalize($dum1, $dum2));
+	local($wtmp) = "wrap_cmd_$dum1";
+	$codeA = "sub $wtmp {" . "\n"
 	    .'local($cmd, $_) = @_; local ($args, $dummy, $pat) = "";'."\n"
 	    . $bodyA #. ($bodyA ? "\n" : '')
-	    . (($thisone)? ";print \"\\nwrap $cmd:\".\$args.\"\\n\";\n" : '')
+	    . (($thisone)? ";print \"\\nwrap \", '$cmd', \":\".\$args.\"\\n\";\n" : '')
 	    .'(&make_deferred_wrapper(1).$cmd.'.$padding
 		.'$args.&make_deferred_wrapper(0),$_)}'
 	    ."\n";
 	print STDERR "\nWRAP_CMD: $codeA " if ($thisone); # for debugging
 	eval $codeA;
-	print STDERR "\n\n*** sub wrap_cmd_$cmd  failed: $@\n" if ($@);
+	print STDERR "\n\n*** sub $wtmp  failed: $@\n" if ($@);
 
 	#RRM: currently these commands only go to LaTeX or access counters.
 	#   They could be implemented more generally, as below with  do_dcmd_$cmd
 	#   requiring replacement to be performed before evaluation.
-	$codeB = "sub do_dcmd_$cmd {" . "\n"
+	$codeB = "sub do_dcmd_$dum1 {" . "\n"
 	    .'local($cmd, $_) = @_; local ($args, $dummy, $pat) = "";'."\n"
 	    . $bodyA . "\n" 
-            . (($thisone)? ";print \"\\ndo_def $cmd:\".\$args.\"\\n\";\n" : '')
+            . (($thisone)? ";print \"\\ndo_def \", '$cmd', \":\".\$args.\"\\n\";\n" : '')
             . $bodyB . "}" . "\n";
 	print "\nDEF_CMD: $codeB " if ($thisone); # for debugging
-	local($tmp) = "do_cmd_$cmd";
+	local($tmp) = "do_cmd_$dum1";
 	eval $codeB unless (defined &$tmp);
-	print STDERR "\n\n*** sub do_dcmd_$cmd  failed: $@\n" if ($@);
+	print STDERR "\n\n*** sub do_dcmd_$dum1  failed: $@\n" if ($@);
 
 	# And make sure the main loop will catch it ...
 #	$raw_arg_cmds{$cmd} = 1;
@@ -13531,17 +13705,20 @@
 	$padding = '' if (($cmd =~ /\W$/)||(!$args)||($args =~ /^\W/));
 	# Generate a new subroutine
 	my $itype = ($cmd =~ /^f.*box$/ ? 'inline' : 'nomath');
-	$code = "sub wrap_cmd_$cmd {" . "\n"
+	local($dum1, $dum2) = ($cmd, '');
+	$dum1 = $cmd unless ($dum1 = &normalize($dum1, $dum2));
+	local($wtmp) = "wrap_cmd_$dum1";
+	$code = "sub $wtmp {" . "\n"
 	    .'local($cmd, $_) = @_; local ($args) = "";' . "\n"
 	    . $body . "\n"
-            . (($thisone)? ";print \"\\ndo $cmd:\".\$args.\"\\n\";\n" : '')
+            . (($thisone)? ";print \"\\ndo \", '$cmd', \":\".\$args.\"\\n\";\n" : '')
 	    .'(&make_'.$itype.'_wrapper(1).$cmd.$padding.$args.'
 	    . '&make_'.$itype.'_wrapper(0),$_)}'
 	    ."\n";
 	print "\nWRAP_CMD:$raw_arg_cmds{$cmd}: $code "
 		if ($thisone); # for debugging
 	eval $code;
-	print STDERR "\n\n*** sub wrap_cmd_$cmd  failed: $@\n" if ($@);
+	print STDERR "\n\n*** sub $wtmp  failed: $@\n" if ($@);
 	# And make sure the main loop will catch it ...
 #	$raw_arg_cmds{$cmd} = 1;
 	++$raw_arg_cmds{$cmd};
@@ -13580,7 +13757,10 @@
 	($cmd, $star) = ($1.$2,$4);
 	if ($star eq '*') { $star = 'star';}
 	else { $after = $star.$after; $star = ''; }
-	$wrapper = "wrap_cmd_$cmd"; $teststar = $wrapper.'star';
+	local($dum1, $dum2) = ($cmd, '');
+	$dum1 = $cmd unless ($dum1 = &normalize($dum1, $dum2));
+	$wrapper = "wrap_cmd_$dum1";
+	$teststar = $wrapper.'star';
 	if ($star && defined &$teststar) { $wrapper = $teststar; $star = '*'; }
         # MRO: make {\bf**} work
 	elsif($star) { $after = '*'.$after; $star = '' }
@@ -13871,7 +14051,7 @@
 
 sub get_footnote_mark {
     local($mini) = @_;
-    return($footnote_mark) if ($HTML_VERSION < 3.0 );
+    return($footnote_mark) if ($HTML_VERSION < 3.0);
     local($cmd,$tmp,@tmp,$marker);
     $cmd = "the". (($mini)? 'mp' : '') . "footnote";
     if ($new_command{$cmd}) {
@@ -14141,6 +14321,7 @@
 sub do_cmd_datename { $date_name . $_[0] }
 sub do_cmd_refname { $ref_title . $_[0] }
 sub do_cmd_bibname { $bib_title . $_[0] }
+sub do_cmd_nomname { $nom_title . $_[0] }
 sub do_cmd_figurename { $fig_name . $_[0] }
 sub do_cmd_listfigurename { $lof_title . $_[0] }
 sub do_cmd_tablename { $tab_name . $_[0] }
@@ -14559,18 +14740,83 @@
 # This is used in $FILE.aux
 sub do_cmd_newlabel {
     local($_) = @_;
-    local($label,$val,$tmp);
+    local($label,$val,$valno,$valnam,$valpag,$tmp,$tmp2,$tmp3);
+
+    # 1st argument is always label
     $label = &missing_braces unless (
 	(s/$next_pair_pr_rx/$label = $2;''/eo)
 	||(s/$next_pair_rx/$label = $2;''/eo));
+    $label =~ s/$label_rx/_/g;	# Replace non alphanumeric characters
+    # next argument is a bracketed container
     $tmp = &missing_braces unless (
 	(s/$next_pair_pr_rx/$tmp=$2;''/eo)
 	||(s/$next_pair_rx/$tmp=$2;''/eo));
-    $val = &missing_braces unless (
-	($tmp =~ s/$next_pair_pr_rx/$val=$2;''/eo)
-	||($tmp =~ s/$next_pair_rx/$val=$2;''/eo));
-    $val =~ s/(^\s+|\s+$)//gs;
-    $label =~ s/$label_rx/_/g;	# Replace non alphanumeric characters
+    # 2nd argument may be either cap number or another bracketed container
+    $valno = '' unless (
+	($tmp =~ s/$next_pair_pr_rx/$valno=$&;''/eo)
+	||($tmp =~ s/$next_pair_rx/$valno=$&;''/eo));
+    $valno =~ s/(^\s+|\s+$)//gs;
+    # 3rd argument is always page number
+    $valpag = &missing_braces unless (
+	($tmp =~ s/$next_pair_pr_rx/$valpag=$2;''/eo)
+	||($tmp =~ s/$next_pair_rx/$valpag=$2;''/eo));
+    $valpag =~ s/(^\s+|\s+$)//gs;
+
+    if ($tmp eq '') {
+        # either article or memoir: try to unwrap and parse 2nd argument
+	$tmp2 = $valno;
+        $tmp = &missing_braces unless (
+	    ($tmp2 =~ s/$next_pair_pr_rx/$tmp=$2;''/eo)
+	    ||($tmp2 =~ s/$next_pair_rx/$tmp=$2;''/eo));
+	# 1st part of 2nd argument is either empty or actual new cap number
+	$tmp2 = '' unless (
+	    ($tmp =~ s/$next_pair_pr_rx/$tmp2=$&;''/eo)
+	    ||($tmp =~ s/$next_pair_rx/$tmp2=$&;''/eo));
+	$tmp2 =~ s/(^\s+|\s+$)//gs;
+	if ($tmp2 eq '') {
+	    # article: keep old cap number, cap text unavailable
+	    $valnam = '';
+	} else {
+	    # memoir: reassign new cap number, cap text following
+	    $valno = $tmp2;
+	    # memoir: 2nd part of 2nd argument is actual cap text
+	    $valnam = '' unless (
+	        ($tmp =~ s/$next_pair_pr_rx/$valnam=$&;''/eo)
+	        ||($tmp =~ s/$next_pair_rx/$valnam=$&;''/eo));
+	    $valnam =~ s/(^\s+|\s+$)//gs;
+	}
+    } else {
+        # special case: nameref without hyperref, 4th argument is cap text
+        $valnam = '' unless (
+	    ($tmp =~ s/$next_pair_pr_rx/$valnam=$&;''/eo)
+	    ||($tmp =~ s/$next_pair_rx/$valnam=$&;''/eo));
+	$valnam =~ s/(^\s+|\s+$)//gs;
+        # recheck for memoir: try to unwrap and parse 2nd argument
+	$tmp2 = $valno;
+        $tmp = &missing_braces unless (
+	    ($tmp2 =~ s/$next_pair_pr_rx/$tmp=$2;''/eo)
+	    ||($tmp2 =~ s/$next_pair_rx/$tmp=$2;''/eo));
+	# actual cap number is here if we have a container with two items
+	if ((($tmp =~ s/$next_pair_pr_rx/$tmp2=$&;''/eo) ||
+	     ($tmp =~ s/$next_pair_rx/$tmp2=$&;''/eo)) &&
+	    (($tmp =~ s/$next_pair_pr_rx/$tmp3=$&;''/eo) ||
+	     ($tmp =~ s/$next_pair_rx/$tmp3=$&;''/eo)) &&
+	    $tmp eq '')
+	{
+	    $valno = $tmp2;
+	    $valno =~ s/(^\s+|\s+$)//gs;
+	    if ($valnam eq '')
+	    {
+	        $valnam = $tmp3;
+		$valnam =~ s/(^\s+|\s+$)//gs;
+	    }
+	}
+    }
+
+    # Now combine number and text together, separated by one space
+    $tmp = '';
+    $tmp = ' ' if ($valno ne '' && $valnam ne '');
+    $val = join ($tmp, $valno, $valnam);
     $latex_labels{$label} = $val;
     &do_labels_helper($label);
     $_;
@@ -15959,6 +16205,7 @@
 	unless $AtBeginDocument_hook;
     $cross_ref_mark = ' 's.
+## Changed to a special ignoration followed by regular expression.
+## Left here in commented out form just for reference/debugging.
+#sub do_cmd_nomenclature {
+#  local($_) = @_;
+#
+#  local($dum1, $dum2);
+#  ($dum1,$dum2) = &get_next_optional_argument;
+#  $dum1 = &missing_braces unless (
+#    (s/$next_pair_pr_rx/$option=$2;''/eo)
+#    ||(s/$next_pair_rx/$option=$2;''/eo));
+#  $dum2 = &missing_braces unless (
+#    (s/$next_pair_pr_rx/$option=$2;''/eo)
+#    ||(s/$next_pair_rx/$option=$2;''/eo));
+#  s/^(\s* )*\s*/\n/;
+#
+#  $_;
+#}
+
+&ignore_commands (<<_IGNORED_CMDS_);
+makenomenclature
+nomenclature # [] # {} # {} # s/^(\\s* )*\\s*/\\n/;
+nomgroup # {}
+nomeqref # {}
+nompageref # {}
+nomrefeq
+nomrefpage
+nomrefeqpage
+nomnorefeq
+nomnorefpage
+nomnorefeqpage
+_IGNORED_CMDS_
+
+&process_commands_wrap_deferred (<<_RAW_ARG_DEFERRED_CMDS_);
+printnomenclature # []
+_RAW_ARG_DEFERRED_CMDS_
+
+1;	# Must be last line
diff -Naur latex2html-2021.orig/styles/polski.perl latex2html-2021/styles/polski.perl
--- latex2html-2021.orig/styles/polski.perl	2021-01-01 22:10:57.000000000 +0700
+++ latex2html-2021/styles/polski.perl	2021-01-10 23:19:41.000000000 +0700
@@ -35,8 +35,6 @@
 
 if (defined &addto_languages) { &addto_languages('polski') };
 
-&do_require_extension('unicode');
-
 sub polski_titles {
 #    $toc_title = "Spis rzeczy";
     $toc_title = "Spis tre\\'sci";
diff -Naur latex2html-2021.orig/styles/romanian.perl latex2html-2021/styles/romanian.perl
--- latex2html-2021.orig/styles/romanian.perl	2021-01-01 22:10:57.000000000 +0700
+++ latex2html-2021/styles/romanian.perl	2021-01-10 23:19:41.000000000 +0700
@@ -16,8 +16,6 @@
 
 if (defined &addto_languages) { &addto_languages('romanian') };
 
-&do_require_extension ('latin10');
-
 sub romanian_titles {
     $toc_title = "Cuprins";
     $lof_title = "Listg de figuri";
diff -Naur latex2html-2021.orig/styles/slovak.perl latex2html-2021/styles/slovak.perl
--- latex2html-2021.orig/styles/slovak.perl	2021-01-01 22:10:57.000000000 +0700
+++ latex2html-2021/styles/slovak.perl	2021-01-10 23:19:41.000000000 +0700
@@ -16,8 +16,6 @@
 
 if (defined &addto_languages) { &addto_languages('slovak') };
 
-&do_require_extension ('latin2');
-
 sub slovak_titles {
     $toc_title = "Obsah";
     $lof_title = "Zoznam obrázkov";
diff -Naur latex2html-2021.orig/versions/cp1251.pl latex2html-2021/versions/cp1251.pl
--- latex2html-2021.orig/versions/cp1251.pl	2021-01-01 22:10:57.000000000 +0700
+++ latex2html-2021/versions/cp1251.pl	2021-01-10 23:19:41.000000000 +0700
@@ -448,6 +448,8 @@
     $idx_title = " ";
     $ref_title = " ";
     $bib_title = "";
+  # $nom_title = " ";
+    $nom_title = "";
     $abs_title = "";
     $app_title = "";
     $pre_title = "";
diff -Naur latex2html-2021.orig/versions/html3_1.pl latex2html-2021/versions/html3_1.pl
--- latex2html-2021.orig/versions/html3_1.pl	2021-01-01 22:10:57.000000000 +0700
+++ latex2html-2021/versions/html3_1.pl	2021-02-04 23:36:27.370189453 +0700
@@ -1719,8 +1719,10 @@
 	    $cmd = $&; 
 	    print ".";
 	    print STDERR "$cmd" if ($VERBOSITY > 2);
+	    local($dum1, $dum2) = ($cmd, '');
+	    $dum1 = $cmd unless ($dum1 = &normalize($dum1, $dum2));
 	    local($mtmp, $ctmp, $wtmp) = 
-		("do_math_cmd_$cmd","do_cmd_$cmd", "wrap_cmd_$cmd");
+		("do_math_cmd_$dum1","do_cmd_$dum1", "wrap_cmd_$dum1");
 	    if ($cmd =~/color/) {
 		do {
 		    local($color_env,$inside_math) = ($color_env,1);
diff -Naur latex2html-2021.orig/versions/html4_01.pl latex2html-2021/versions/html4_01.pl
--- latex2html-2021.orig/versions/html4_01.pl	2021-01-01 22:10:57.000000000 +0700
+++ latex2html-2021/versions/html4_01.pl	2021-02-04 23:36:27.370189453 +0700
@@ -41,15 +41,16 @@
 sub do_env_raggedright { &declared_env('flushleft', @_) }
 sub do_env_raggedleft { &declared_env('flushright', @_) }
 
-sub do_cmd_centering { 
-    # MRO *opentags has no effect
-    local($_)= @_; &declared_env('center', $_) }
-sub do_cmd_raggedright {
-    # MRO *opentags has no effect
-    local($_) = @_; &declared_env('flushleft', $_) }
-sub do_cmd_raggedleftt {
-    # MRO *opentags has no effect
-    local($_) = @_; &declared_env('flushright', $_) }
+# SGE: reimplemented via $declarations{$cmd} in &process_command
+#sub do_cmd_centering { 
+#    # MRO *opentags has no effect
+#    local($_)= @_; &declared_env('center', $_) }
+#sub do_cmd_raggedright {
+#    # MRO *opentags has no effect
+#    local($_) = @_; &declared_env('flushleft', $_) }
+#sub do_cmd_raggedleft {
+#    # MRO *opentags has no effect
+#    local($_) = @_; &declared_env('flushright', $_) }
 
 sub do_cmd_underline {
     &styled_text_chunk('U','','text','decoration','underline','',@_)}
diff -Naur latex2html-2021.orig/versions/html4_0.pl latex2html-2021/versions/html4_0.pl
--- latex2html-2021.orig/versions/html4_0.pl	2021-01-01 22:10:57.000000000 +0700
+++ latex2html-2021/versions/html4_0.pl	2021-02-04 23:36:27.370189453 +0700
@@ -43,15 +43,16 @@
 sub do_env_raggedright { &declared_env('flushleft', @_) }
 sub do_env_raggedleft { &declared_env('flushright', @_) }
 
-sub do_cmd_centering { 
-    # MRO *opentags has no effect
-    local($_)= @_; &declared_env('center', $_) }
-sub do_cmd_raggedright {
-    # MRO *opentags has no effect
-    local($_) = @_; &declared_env('flushleft', $_) }
-sub do_cmd_raggedleftt {
-    # MRO *opentags has no effect
-    local($_) = @_; &declared_env('flushright', $_) }
+# SGE: reimplemented via $declarations{$cmd} in &process_command
+#sub do_cmd_centering { 
+#    # MRO *opentags has no effect
+#    local($_)= @_; &declared_env('center', $_) }
+#sub do_cmd_raggedright {
+#    # MRO *opentags has no effect
+#    local($_) = @_; &declared_env('flushleft', $_) }
+#sub do_cmd_raggedleft {
+#    # MRO *opentags has no effect
+#    local($_) = @_; &declared_env('flushright', $_) }
 
 sub do_cmd_underline {
     &styled_text_chunk('U','','text','decoration','underline','',@_)}
diff -Naur latex2html-2021.orig/versions/html5_0.pl latex2html-2021/versions/html5_0.pl
--- latex2html-2021.orig/versions/html5_0.pl	2021-01-01 22:10:57.000000000 +0700
+++ latex2html-2021/versions/html5_0.pl	2021-02-04 23:37:29.980190686 +0700
@@ -16,7 +16,7 @@
 $declarations{'tiny'} = '';
 $declarations{'Tiny'} = '';
 $declarations{'scriptsize'} = '';
-$declarations{'small'} = '';
+$declarations{'small'} = '';
 $declarations{'Small'} = '';
 $declarations{'SMALL'} = '';
 $declarations{'footnotesize'} = '';
diff -Naur latex2html-2021.orig/versions/koi8.pl latex2html-2021/versions/koi8.pl
--- latex2html-2021.orig/versions/koi8.pl	2021-01-01 22:10:57.000000000 +0700
+++ latex2html-2021/versions/koi8.pl	2021-01-10 23:19:41.000000000 +0700
@@ -431,6 +431,8 @@
     $ref_title = " ";
   #  $ref_title = "";
     $bib_title = "";
+  # $nom_title = " ";
+    $nom_title = "";
     $abs_title = "";
     $app_title = "";
     $pre_title = "";
diff -Naur latex2html-2021.orig/versions/math.pl latex2html-2021/versions/math.pl
--- latex2html-2021.orig/versions/math.pl	2021-01-01 22:10:57.000000000 +0700
+++ latex2html-2021/versions/math.pl	2021-02-04 23:36:27.370189453 +0700
@@ -1798,8 +1798,10 @@
 	    $cmd = $&; 
 	    print ".";
 	    print STDERR "$cmd" if ($VERBOSITY > 2);
+	    local($dum1, $dum2) = ($cmd, '');
+	    $dum1 = $cmd unless ($dum1 = &normalize($dum1, $dum2));
 	    local($mtmp, $ctmp, $wtmp) = 
-		("do_math_cmd_$cmd","do_cmd_$cmd", "wrap_cmd_$cmd");
+		("do_math_cmd_$dum1","do_cmd_$dum1", "wrap_cmd_$dum1");
 	    if ($cmd =~/color/) {
 		do {
 		    local($color_env,$inside_math) = ($color_env,1);
diff -Naur latex2html-2021.orig/versions/utf8ru.pl latex2html-2021/versions/utf8ru.pl
--- latex2html-2021.orig/versions/utf8ru.pl	2021-01-01 22:10:57.000000000 +0700
+++ latex2html-2021/versions/utf8ru.pl	2021-01-10 23:19:41.000000000 +0700
@@ -406,6 +406,8 @@
   $ref_title = "Список литературы";
 #  $ref_title = "Ссылки";
   $bib_title = "Литература";
+#  $nom_title = "Список обозначений";
+  $nom_title = "Обозначения";
   $abs_title = "Аннотация";
   $app_title = "Приложение";
   $pre_title = "Предисловие";
\n$_\n
No Nomenclature!
\n";
+  }
+
+  # Put the result in the right place
+  local($closures,$reopens) = &preserve_open_tags();
+  join('', "
\n", $closures,
+       &make_section_heading($title, $section_headings{'nomenclature'}),
+       $_, $reopens, $after);
+}
+
+## Discard all arguments, the following white space and possible paragraphs.
+## Simple ignoration leaves repeated unnecessary