Skip to content
Permalink
Browse files

format author block consistently

https://bugs.debian.org/223565

Remove left/right alignment of individual elements within author block.
Process \And and \AND the same way as \and (though they depend on latex style).
Don't drop lines after third line in author block.
Author name is still rendered <strong>, which is not standard in latex.
  • Loading branch information...
Dan Gildea
Dan Gildea committed May 25, 2019
1 parent 2e549c5 commit c0c97a2ca689f42d2b384c8b6063e09bc3e5853e
Showing with 23 additions and 19 deletions.
  1. +2 −0 Changes
  2. +14 −12 latex2html.pin
  3. +7 −7 styles/amsmath.perl
@@ -112,6 +112,8 @@
# A more detailed log history can be found within the particular files, near
# the top.
#
# - format author block consistently
# https://bugs.debian.org/223565
# - convert -- to &ndash; and --- to &mdash;
# If you want "--", use "-{}-", even inside \texttt{}
# Behavior of \textt{--} in latex depends on font encoding.
@@ -7393,6 +7393,8 @@ sub style_sheet {
DIV.equation { text-align-last:justify; white-space: nowrap; } /* place eq nos */
SPAN.MATH { display:inline-block; } /* don't stretch spaces inside eqn */
DIV.author_info { text-align:center; } /* latex centers author */
.LEFT { text-align:left; }
.CENTER { text-align:center; }
.CENTER > * { margin:auto; }
@@ -12647,14 +12649,14 @@ sub do_cmd_author {
(s/$next_pair_pr_rx/$next = $2;''/seo)
||(s/$next_pair_rx/$next = $2;''/seo));
local($after) = $_;
if ($next =~ /\\and/) {
my @author_list = split(/\s*\\and\s*/, $next);
if ($next =~ /\\and/i) { # \And and \AND are defined by many packages
my @author_list = split(/\s*\\and\s*/i, $next);
my $t_author, $t_affil, $t_address;
foreach (@author_list) {
$t_author = &translate_environments($_);
$t_author =~ s/\s+/ /g;
$t_author = &simplify(&translate_commands($t_author));
($t_author,$t_affil,$t_address) = split (/\s*<BR>s*/, $t_author);
($t_author,$t_affil,$t_address) = split (/\s*<BR>s*/, $t_author, 3);
push @authors, $t_author;
push @affils, $t_affil;
push @addresses, $t_address;
@@ -12663,7 +12665,7 @@ sub do_cmd_author {
$_ = &translate_environments($next);
$next = &translate_commands($_);
($t_author) = &simplify($next);
($t_author,$t_affil,$t_address) = split (/\s*<BR>s*/, $t_author);
($t_author,$t_affil,$t_address) = split (/\s*<BR>s*/, $t_author, 3);
push @authors, $t_author;
push @affils, $t_affil if $t_affil;
push @addresses, $t_address if $t_address;
@@ -12813,24 +12815,24 @@ sub make_singleauthor_title {
local($href) = &translate_commands($t_authorURL);
$href = &make_named_href('author'
, $href, "<STRONG>${t_author}</STRONG>");
$t_title .= "\n<P$alignc>$href</P>";
$t_title .= "\n$href";
} else {
$t_title .= "\n<P$alignc><STRONG>$t_author</STRONG></P>";
$t_title .= "\n<STRONG>$t_author</STRONG>";
}
} else { &write_warnings("\nThere is no author for this document."); }
if ($t_institute&&!($t_institute=~/^\s*(($O|$OP)\d+($C|$CP))\s*\1\s*$/)) {
$t_title .= "\n<P$alignc><SMALL>$t_institute</SMALL></P>";}
$t_title .= "\n<BR>$t_institute";}
if ($t_affil&&!($t_affil=~/^\s*(($O|$OP)\d+($C|$CP))\s*\1\s*$/)) {
$t_title .= "\n<P$alignc><I>$t_affil</I></P>";}
if ($t_date&&!($t_date=~/^\s*(($O|$OP)\d+($C|$CP))\s*\1\s*$/)) {
$t_title .= "\n<P$alignc><STRONG>$t_date</STRONG></P>";}
$t_title .= "\n<BR>$t_affil";}
if ($t_address&&!($t_address=~/^\s*(($O|$OP)\d+($C|$CP))\s*\1\s*$/)) {
$t_title .= "\n<P$alignl><SMALL>$t_address</SMALL></P>";
$t_title .= "\n<BR>$t_address";
} # else { $t_title .= "\n<P$alignl>"}
if ($t_email&&!($t_email=~/^\s*(($O|$OP)\d+($C|$CP))\s*\1\s*$/)) {
$t_title .= "\n<P$alignl><SMALL>$t_email</SMALL></P>";
$t_title .= "\n<BR>$t_email";
} # else { $t_title .= "</P>" }
if ($t_date&&!($t_date=~/^\s*(($O|$OP)\d+($C|$CP))\s*\1\s*$/)) {
$t_title .= "\n<P>$t_date</P>";}
join("\n", $s_author_info, $t_title, $e_author_info);
}
@@ -197,14 +197,14 @@ sub do_cmd_author {
||(s/$next_pair_rx/$next = $2;''/seo));
$after = $_;
}
if ($next =~ /\\and/) {
my @author_list = split(/\s*\\and\s*/, $next);
if ($next =~ /\\and/i) {
my @author_list = split(/\s*\\and\s*/i, $next);
my $t_author, $t_affil, $t_address;
foreach (@author_list) {
$t_author = &translate_environments($_);
$t_author =~ s/\s+/ /g;
$t_author = &simplify(&translate_commands($t_author));
($t_author,$t_affil,$t_address) = split (/\s*<BR>s*/, $t_author);
($t_author,$t_affil,$t_address) = split (/\s*<BR>s*/, $t_author, 3);
push @authors, $t_author;
push @affils, $t_affil;
push @addresses, $t_address;
@@ -213,7 +213,7 @@ sub do_cmd_author {
$_ = &translate_environments($next);
$next = &translate_commands($_);
($t_author) = &simplify($next);
($t_author,$t_affil,$t_address) = split (/\s*<BR>s*/, $t_author);
($t_author,$t_affil,$t_address) = split (/\s*<BR>s*/, $t_author, 3);
push @authors, $t_author;
push @affils, $t_affil if $t_affil;
push @addresses, $t_address if $t_address;
@@ -391,11 +391,11 @@ sub make_singleauthor_title{
$the_title .= "<P class=\"CENTER\"><STRONG>$t_author</STRONG>\n";
} else { &write_warnings("There is no author for this document."); }
if (($t_affil)&&!($t_affil=~/^\s*(($O|$OP)\d+($C|$CP))\s*\1\s*$/)) {
$the_title .= "<BR><I>$t_affil</I>\n";}
$the_title .= "<BR>$t_affil\n";}
if ($t_address&&!($t_address=~/^\s*(($O|$OP)\d+($C|$CP))\s*\1\s*$/)) {
$the_title .= "<BR><SMALL>$t_address</SMALL>\n"}
$the_title .= "<BR>$t_address\n"}
if ($t_email&&!($t_email=~/^\s*(($O|$OP)\d+($C|$CP))\s*\1\s*$/)) {
$the_title .= "<BR><SMALL>$t_email</SMALL></P>\n";
$the_title .= "<BR>$t_email</P>\n";
} else { $the_title .= "</P>" }
$the_title;
}

0 comments on commit c0c97a2

Please sign in to comment.
You can’t perform that action at this time.