Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f9fd4e8

Browse files
committed
Put all the indexsubitem stuff together.
Support modified verbatim for both LaTeX2HTML 96.1* and 98.1. Make table column headers bold.
1 parent 7186783 commit f9fd4e8

1 file changed

Lines changed: 33 additions & 13 deletions

File tree

Doc/myformat.perl

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,10 @@ sub do_cmd_strong{
156156

157157
$INDEX_SUBITEM = "";
158158

159+
sub get_indexsubitem{
160+
$INDEX_SUBITEM ? " $INDEX_SUBITEM" : '';
161+
}
162+
159163
sub do_cmd_setindexsubitem{
160164
local($_) = @_;
161165
s/$any_next_pair_pr_rx//;
@@ -283,8 +287,8 @@ sub ref_module_index_helper{
283287

284288
sub init_myformat{
285289
# XXX need some way for this to be called after &initialise; ???
286-
# $anchor_mark = '';
287-
# $icons{'anchor_mark'} = '';
290+
$anchor_mark = '';
291+
$icons{'anchor_mark'} = '';
288292
# <<2>>...<<2>>
289293
$any_next_pair_rx3 = "$O(\\d+)$C([\\s\\S]*)$O\\3$C";
290294
$any_next_pair_rx5 = "$O(\\d+)$C([\\s\\S]*)$O\\5$C";
@@ -299,10 +303,6 @@ sub init_myformat{
299303

300304
&init_myformat;
301305

302-
sub get_indexsubitem{
303-
$INDEX_SUBITEM ? " $INDEX_SUBITEM" : '';
304-
}
305-
306306
# similar to make_index_entry(), but includes the string in the result
307307
# instead of the dummy filler.
308308
#
@@ -320,12 +320,28 @@ sub make_str_index_entry{
320320
"<a name=\"$br_id\">$str<\/a>";
321321
}
322322

323-
# Changed from the stock version to indent {verbatim} sections:
323+
# Changed from the stock version to indent {verbatim} sections,
324+
# and make them smaller, to better match the LaTeX version:
325+
326+
# (Used with LaTeX2HTML 96.1*)
324327
sub replace_verbatim {
325328
# Modifies $_
326-
s/$verbatim_mark(verbatim)(\d+)/<p><dl><dd><pre>$verbatim{$2}<\/pre><\/dl>/go;
329+
s/$verbatim_mark(verbatim)(\d+)/<p><dl><dd><font size=\"-1\"><pre>$verbatim{$2}<\/pre><\/font><\/dl>/go;
327330
s/$verbatim_mark(rawhtml)(\d+)/$verbatim{$2}/ego; # Raw HTML
328331
}
332+
333+
# (Used with LaTeX2HTML 98.1)
334+
sub replace_verbatim_hook{
335+
# Modifies $_
336+
s/$math_verbatim_rx/&put_comment("MATH: ".$verbatim{$1})/eg;
337+
# s/$verbatim_mark(verbatim\*?)(\d+)#/<PRE>\n$verbatim{$2}\n<\/PRE>/go;
338+
s/$verbatim_mark(\w*[vV]erbatim\*?)(\d+)#/\n<p><dl><dd><font size=\"-1\">$verbatim{$2}<\/font><\/dl>\n/go;
339+
# s/$verbatim_mark(rawhtml)(\d+)#/$verbatim{$2}/eg; # Raw HTML
340+
# Raw HTML, but replacements may have protected characters
341+
s/$verbatim_mark(rawhtml)(\d+)#/&unprotect_raw_html($verbatim{$2})/eg;
342+
s/$verbatim_mark$keepcomments(\d+)#/$verbatim{$2}/ego; # Raw TeX
343+
s/$unfinished_mark$keepcomments(\d+)#/$verbatim{$2}/ego; # Raw TeX
344+
}
329345

330346
sub do_env_cfuncdesc{
331347
local($_) = @_;
@@ -511,8 +527,10 @@ sub do_env_tableii{
511527
}
512528
local($th1,$th2,$th3) = &setup_column_alignments($2);
513529
$globals{"lineifont"} = $font;
514-
"<table border align=center>\n <tr>$th1$h1</th>\n $th2$h2</th>$'\n"
515-
. "</table>";
530+
"<table border align=center>"
531+
. "\n <tr>$th1<b>$h1</b></th>"
532+
. "\n $th2<b>$h2</b></th>$'"
533+
. "\n</table>";
516534
}
517535

518536
sub do_cmd_lineii{
@@ -542,9 +560,11 @@ sub do_env_tableiii{
542560
}
543561
local($th1,$th2,$th3) = &setup_column_alignments($2);
544562
$globals{"lineifont"} = $font;
545-
"<table border align=center>\n <tr>$th1$h1</th>\n $th2$h2</th>"
546-
. "\n $th3$h3</th>$'\n"
547-
. "</table>";
563+
"<table border align=center>"
564+
. "\n <tr>$th1<b>$h1</b></th>"
565+
. "\n $th2<b>$h2</b></th>"
566+
. "\n $th3<b>$h3</b></th>$'"
567+
. "\n</table>";
548568
}
549569

550570
sub do_cmd_lineiii{

0 commit comments

Comments
 (0)