From bb1c271d6d302d8d5ed193f72dd902631b829bb2 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 9 Oct 2023 21:23:46 +0000 Subject: format toc with css, tex4ht r1378; fix css for starred section titles, tex4ht r1379; process some \newfontfamily keyval options, tex4ht r1380 git-svn-id: svn://tug.org/texlive/trunk@68494 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/generic/tex4ht/ChangeLog | 13 ++ .../source/generic/tex4ht/tex4ht-4ht.tex | 5 +- .../source/generic/tex4ht/tex4ht-html4.tex | 202 +++++++-------------- .../source/generic/tex4ht/tex4ht-html5.tex | 12 +- 4 files changed, 84 insertions(+), 148 deletions(-) (limited to 'Master/texmf-dist/source/generic') diff --git a/Master/texmf-dist/source/generic/tex4ht/ChangeLog b/Master/texmf-dist/source/generic/tex4ht/ChangeLog index e56e2545c34..5b65c3b2828 100644 --- a/Master/texmf-dist/source/generic/tex4ht/ChangeLog +++ b/Master/texmf-dist/source/generic/tex4ht/ChangeLog @@ -1,3 +1,16 @@ +2023-10-09 Michal Hoftich + + * tex4ht-4ht.tex (usepackage-fontspec.4ht): process keyval options + from the first optional argument in \newfontfamily. + https://tex.stackexchange.com/a/698071/2891 + + * tex4ht-html5.tex (html5.4ht): fixed CSS selector for setting size + of starred section titles. + + * tex4ht-html4.tex (html4.4ht): removed spurious spaces from TOCs, + simplified their formatting using CSS. + https://puszcza.gnu.org.ua/bugs/?605 + 2023-10-04 Michal Hoftich * tex4ht-mathml.tex (mathml.4ht): removed \mathchoice from diff --git a/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex b/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex index 90876bb70a8..2374a35fd96 100644 --- a/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex +++ b/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex @@ -1,4 +1,4 @@ -% $Id: tex4ht-4ht.tex 1375 2023-10-02 10:40:17Z michal_h21 $ +% $Id: tex4ht-4ht.tex 1381 2023-10-09 21:22:59Z karl $ % tex tex4ht-4ht or ht tex tex4ht-4ht % % Copyright 2009-2023 TeX Users Group @@ -4603,7 +4603,7 @@ The actual configurations which are used when fontspec is loaded: \<<< % usepackage-fontspec.4ht (|version), generated from |jobname.tex -% Copyright 2017-2020 TeX Users Group +% Copyright 2017-2023 TeX Users Group | % \RequirePackage{expl3}% we need to disable them before loading \ExplSyntaxOn @@ -4676,6 +4676,7 @@ The actual configurations which are used when fontspec is loaded: \DeclareDocumentCommand \newfontfamily { m O{} m O{} } { % \fontspec_set_family:cnn { g__fontspec_ \cs_to_str:N #1 _family } {#2} {#3} + \keys_set_known:nn {fontspec4ht}{#2} \keys_set_known:nn {fontspec4ht}{#4} \seq_put_right:Nn \fontspec_ht_fontfamilies {#3} \use:x diff --git a/Master/texmf-dist/source/generic/tex4ht/tex4ht-html4.tex b/Master/texmf-dist/source/generic/tex4ht/tex4ht-html4.tex index 21e7ea166ea..990317494a9 100644 --- a/Master/texmf-dist/source/generic/tex4ht/tex4ht-html4.tex +++ b/Master/texmf-dist/source/generic/tex4ht/tex4ht-html4.tex @@ -1,4 +1,4 @@ -% $Id: tex4ht-html4.tex 1372 2023-09-22 15:05:09Z michal_h21 $ +% $Id: tex4ht-html4.tex 1378 2023-10-09 11:33:14Z michal_h21 $ % Compile 4 times: latex tex4ht-html4 % Copy html4.4ht into the work directory before all but the last compilation. % @@ -1860,20 +1860,14 @@ should be used whe addcontentline instructions are present. #1 \fi #2\HCode{}\par} \def\toclikesection#1#2#3{\par \HCode{}#2\HCode{}\par}% - \def\tocsubsection#1#2#3{\par\ \toc:num{subsection}{#1}{#2}\par} - \def\toclikesubsection#1#2#3{\par\ - \HCode{}#2\HCode{}\par} - \def\tocsubsubsection#1#2#3{\par - \ \ \toc:num{subsubsection}{#1}{#2}\par} - \def\toclikesubsubsection#1#2#3{\par - \ \ \HCode{}#2\HCode{}\par} - \def\tocparagraph#1#2#3{\par\ \ \toc:num{paragraph}{#1}{#2}\par} - \def\toclikeparagraph#1#2#3{\par\ \ - \HCode{}#2\HCode{}\par} - \def\tocsubparagraph#1#2#3{\par - \ \ \ \ \toc:num{subparagraph}{#1}{#2}\par} - \def\toclikesubparagraph#1#2#3{\par - \ \ \ \ \HCode{}#2\HCode{}\par} + \def\tocsubsection#1#2#3{\par\toc:num{subsection}{#1}{#2}\par} + \def\toclikesubsection#1#2#3{\par\HCode{}#2\HCode{}\par} + \def\tocsubsubsection#1#2#3{\par\toc:num{subsubsection}{#1}{#2}\par} + \def\toclikesubsubsection#1#2#3{\par\HCode{}#2\HCode{}\par} + \def\tocparagraph#1#2#3{\par\toc:num{paragraph}{#1}{#2}\par} + \def\toclikeparagraph#1#2#3{\par\HCode{}#2\HCode{}\par} + \def\tocsubparagraph#1#2#3{\par\toc:num{subparagraph}{#1}{#2}\par} + \def\toclikesubparagraph#1#2#3{\par\HCode{}#2\HCode{}\par} \else |% \def\tocchapter#1#2#3{\par @@ -1883,22 +1877,16 @@ should be used whe addcontentline instructions are present. \HCode{}#2\HCode{}\par}% \def\tocappendix#1#2#3{\par \HCode{}#1 #2\HCode{}\par} - \def\tocsection#1#2#3{\par\ \toc:num{section}{#1}{#2}\par} - \def\toclikesection#1#2#3{\par\ \HCode{}#2\HCode{}\par} - \def\tocsubsection#1#2#3{\par\ \ \toc:num{subsection}{#1}{#2}\par} - \def\toclikesubsection#1#2#3{\par - \ \ \HCode{}#2\HCode{}\par} - \def\tocsubsubsection#1#2#3{\par - \ \ \ \toc:num{subsubsection}{#1}{#2}\par} - \def\toclikesubsubsection#1#2#3{\par - \ \ \ \HCode{}#2\HCode{}\par} - \def\tocparagraph#1#2#3{\par\ \ \ \toc:num{paragraph}{#1}{#2}\par} - \def\toclikeparagraph#1#2#3{\par - \ \ \ \HCode{}#2\HCode{}\par} - \def\tocsubparagraph#1#2#3{\par - \ \ \ \ \ \toc:num{subparagraph}{#1}{#2}\par} - \def\toclikesubparagraph#1#2#3{\par - \ \ \ \ \ \HCode{}#2\HCode{}\par} + \def\tocsection#1#2#3{\par\toc:num{section}{#1}{#2}\par} + \def\toclikesection#1#2#3{\par\HCode{}#2\HCode{}\par} + \def\tocsubsection#1#2#3{\par\toc:num{subsection}{#1}{#2}\par} + \def\toclikesubsection#1#2#3{\par\HCode{}#2\HCode{}\par} + \def\tocsubsubsection#1#2#3{\par\toc:num{subsubsection}{#1}{#2}\par} + \def\toclikesubsubsection#1#2#3{\par\HCode{}#2\HCode{}\par} + \def\tocparagraph#1#2#3{\par\toc:num{paragraph}{#1}{#2}\par} + \def\toclikeparagraph#1#2#3{\par\HCode{}#2\HCode{}\par} + \def\tocsubparagraph#1#2#3{\par\toc:num{subparagraph}{#1}{#2}\par} + \def\toclikesubparagraph#1#2#3{\par\HCode{}#2\HCode{}\par} \fi \def\toc:num#1#2#3{\def\:temp{#1#2}% \HCode{}\ifx \:temp\empty @@ -1919,30 +1907,24 @@ should be used whe addcontentline instructions are present. .appendixToc a, .appendixToc, .addchapToc a {line-height: 200\%; font-weight:bold;}} \def\tocchapter#1#2#3{\par - \HCode{}#1\ \ #2\HCode{}\par} + \HCode{}#1\ #2\HCode{}\par} \def\toclikechapter#1#2#3{\par \HCode{}#2\HCode{}\par}% \def\tocaddchap#1#2#3{\par \HCode{}#2\HCode{}\par}% \def\tocappendix#1#2#3{\par - \HCode{}#1\ \ #2\HCode{}\par} - \def\tocsection#1#2#3{\par\ \toc:num{section}{#1}{#2}\par} - \def\toclikesection#1#2#3{\par\ - \HCode{}#2\HCode{}\par} - \def\tocsubsection#1#2#3{\par\ \ \toc:num{subsection}{#1}{#2}\par} - \def\toclikesubsection#1#2#3{\par - \ \ \HCode{}#2\HCode{}\par} - \def\tocsubsubsection#1#2#3{\par - \ \ \ \toc:num{subsubsection}{#1}{#2}\par} - \def\toclikesubsubsection#1#2#3{\par - \ \ \ \HCode{}#2\HCode{}\par} - \def\tocparagraph#1#2#3{\par\ \ \ \toc:num{paragraph}{#1}{#2}\par} - \def\toclikeparagraph#1#2#3{\par - \ \ \ \HCode{}#2\HCode{}\par} - \def\tocsubparagraph#1#2#3{\par - \ \ \ \ \ \toc:num{subparagraph}{#1}{#2}\par} + \HCode{}#1\ #2\HCode{}\par} + \def\tocsection#1#2#3{\par\toc:num{section}{#1}{#2}\par} + \def\toclikesection#1#2#3{\par\HCode{}#2\HCode{}\par} + \def\tocsubsection#1#2#3{\par\toc:num{subsection}{#1}{#2}\par} + \def\toclikesubsection#1#2#3{\par\HCode{}#2\HCode{}\par} + \def\tocsubsubsection#1#2#3{\par\toc:num{subsubsection}{#1}{#2}\par} + \def\toclikesubsubsection#1#2#3{\par\HCode{}#2\HCode{}\par} + \def\tocparagraph#1#2#3{\par\toc:num{paragraph}{#1}{#2}\par} + \def\toclikeparagraph#1#2#3{\par\HCode{}#2\HCode{}\par} + \def\tocsubparagraph#1#2#3{\par\toc:num{subparagraph}{#1}{#2}\par} \def\toclikesubparagraph#1#2#3{\par - \ \ \ \ \ \HCode{}#2\HCode{}\par} + \HCode{}#2\HCode{}\par} \def\toc:num#1#2#3{\def\:temp{#1#2}% \HCode{}\ifx \:temp\empty \else \def\:temp{#2}\ifx\:temp\empty\else #2\ \ \fi\fi #3\HCode{}} @@ -1966,16 +1948,16 @@ should be used whe addcontentline instructions are present. \def\toclikesubsection#1#2#3{\par\ \HCode{}#2\HCode{}\par} \def\tocsubsubsection#1#2#3{\par - \ \ \toc:num{subsubsection}{#1}{#2}\par} + \toc:num{subsubsection}{#1}{#2}\par} \def\toclikesubsubsection#1#2#3{\par - \ \ \HCode{}#2\HCode{}\par} + \HCode{}#2\HCode{}\par} \def\tocparagraph#1#2#3{\par\ \ \toc:num{paragraph}{#1}{#2}\par} \def\toclikeparagraph#1#2#3{\par\ \ \HCode{}#2\HCode{}\par} \def\tocsubparagraph#1#2#3{\par - \ \ \ \ \toc:num{subparagraph}{#1}{#2}\par} + \toc:num{subparagraph}{#1}{#2}\par} \def\toclikesubparagraph#1#2#3{\par - \ \ \ \ \HCode{}#2\HCode{}\par} + \HCode{}#2\HCode{}\par} \else \Css{.chapterToc a, .chapterToc, .likechapterToc a, .likechapterToc, .appendixToc a, .appendixToc @@ -1992,18 +1974,18 @@ should be used whe addcontentline instructions are present. \HCode{}#2\HCode{}\par} \def\tocsubsection#1#2#3{\par\ \ \toc:num{subsection}{#1}{#2}\par} \def\toclikesubsection#1#2#3{\par - \ \ \HCode{}#2\HCode{}\par} + \HCode{}#2\HCode{}\par} \def\tocsubsubsection#1#2#3{\par - \ \ \ \toc:num{subsubsection}{#1}{#2}\par} + \toc:num{subsubsection}{#1}{#2}\par} \def\toclikesubsubsection#1#2#3{\par - \ \ \ \HCode{}#2\HCode{}\par} + \HCode{}#2\HCode{}\par} \def\tocparagraph#1#2#3{\par\ \ \ \toc:num{paragraph}{#1}{#2}\par} \def\toclikeparagraph#1#2#3{\par - \ \ \ \HCode{}#2\HCode{}\par} + \HCode{}#2\HCode{}\par} \def\tocsubparagraph#1#2#3{\par - \ \ \ \ \ \toc:num{subparagraph}{#1}{#2}\par} + \toc:num{subparagraph}{#1}{#2}\par} \def\toclikesubparagraph#1#2#3{\par - \ \ \ \ \ \HCode{}#2\HCode{}\par} + \HCode{}#2\HCode{}\par} \fi \def\toc:num#1#2#3{\def\:temp{#1#2}% \HCode{}\ifx \:temp\empty @@ -2029,13 +2011,13 @@ should be used whe addcontentline instructions are present. {} {\HCode{
}} \ConfigureToc{subsection} - {\HCode{}\ \ \toc:Mark{subsection}} + {\HCode{}\toc:Mark{subsection}} {\End:Mark} {} {\HCode{
}} \ConfigureToc{subsubsection} {\HCode{}\ \ \ \ \toc:Mark{subsubsection}} + class="subsubsectionToc" \a:LRdir>}\toc:Mark{subsubsection}} {\End:Mark} {} {\HCode{
}} @@ -8843,27 +8825,10 @@ The hbox is for avoiding the start of a new paragraph, if in vmode. \fi | | -\:CheckOption{1} \if:Option -\else - \:CheckOption{2} \if:Option \else - \:CheckOption{3} \if:Option \else - \:CheckOption{4} \if:Option \else - \:CheckOption{5} \if:Option \else - \:CheckOption{6} \if:Option \else - \:CheckOption{7} \if:Option \else - \fi - \fi - \fi - \fi - \fi - \fi - \if:Option - \Css{.subsectionToc, .likesubsectionToc {margin-left:2em;}} - \Css{.subsubsectionToc, .likesubsubsectionToc {margin-left:4em;}} - \Css{.paragraphToc, .likeparagraphToc {margin-left:6em;}} - \Css{.subparagraphToc, .likesubparagraphToc {margin-left:8em;}} - \fi -\fi +\Css{.subsectionToc, .likesubsectionToc {margin-left:1em;}} +\Css{.subsubsectionToc, .likesubsubsectionToc {margin-left:2em;}} +\Css{.paragraphToc, .likeparagraphToc {margin-left:3em;}} +\Css{.subparagraphToc, .likesubparagraphToc {margin-left:4em;}} >>> @@ -8904,6 +8869,7 @@ The hbox is for avoiding the start of a new paragraph, if in vmode. | |<32,4 report,book|> |<32,4 report|> +| >>> \<32,4 report\><<< @@ -8985,70 +8951,26 @@ The hbox is for avoiding the start of a new paragraph, if in vmode. .likechapterToc {margin-left:0em;}} \Css{ -.chapterToc \string~ .likesectionToc, -.chapterToc \string~ .sectionToc, -.likechapterToc \string~ .likesectionToc, -.likechapterToc \string~ .sectionToc - {margin-left:2em;}} -\Css{ -.chapterToc \string~ .likesectionToc \string~ .likesubsectionToc, -.chapterToc \string~ .likesectionToc \string~ .subsectionToc, -.chapterToc \string~ .sectionToc \string~ .likesubsectionToc, -.chapterToc \string~ .sectionToc \string~ .subsectionToc, -.likechapterToc \string~ .likesectionToc \string~ .likesubsectionToc, -.likechapterToc \string~ .likesectionToc \string~ .subsectionToc, -.likechapterToc \string~ .sectionToc \string~ .likesubsectionToc, -.likechapterToc \string~ .sectionToc \string~ .subsectionToc - {margin-left:4em;}} -\Css{.chapterToc \string~ .likesectionToc \string~ .likesubsectionToc \string~ .likesubsubsectionToc, -.chapterToc \string~ .likesectionToc \string~ .likesubsectionToc \string~ .subsubsectionToc, -.chapterToc \string~ .likesectionToc \string~ .subsectionToc \string~ .likesubsubsectionToc, -.chapterToc \string~ .likesectionToc \string~ .subsectionToc \string~ .subsubsectionToc, -.chapterToc \string~ .sectionToc \string~ .likesubsectionToc \string~ .likesubsubsectionToc, -.chapterToc \string~ .sectionToc \string~ .likesubsectionToc \string~ .subsubsectionToc, -.chapterToc \string~ .sectionToc \string~ .subsectionToc \string~ .likesubsubsectionToc, -.chapterToc \string~ .sectionToc \string~ .subsectionToc \string~ .subsubsectionToc, -.likechapterToc \string~ .likesectionToc \string~ .likesubsectionToc \string~ .likesubsubsectionToc, -.likechapterToc \string~ .likesectionToc \string~ .likesubsectionToc \string~ .subsubsectionToc, -.likechapterToc \string~ .likesectionToc \string~ .subsectionToc \string~ .likesubsubsectionToc, -.likechapterToc \string~ .likesectionToc \string~ .subsectionToc \string~ .subsubsectionToc, -.likechapterToc \string~ .sectionToc \string~ .likesubsectionToc \string~ .likesubsubsectionToc, -.likechapterToc \string~ .sectionToc \string~ .likesubsectionToc \string~ .subsubsectionToc, -.likechapterToc \string~ .sectionToc \string~ .subsectionToc \string~ .likesubsubsectionToc -.likechapterToc \string~ .sectionToc \string~ .subsectionToc \string~ .subsubsectionToc - {margin-left:6em;}} - - -\Css{.paragraphToc, .likeparagraphToc {margin-left:8em;}} -\Css{.subparagraphToc, .likesubparagraphToc {margin-left:10em;}} - +.likesectionToc, +.sectionToc + {margin-left:1em;}} \Css{ -.likesectionToc , -.sectionToc - {margin-left:0em;}} -\Css{ -.likesectionToc \string~ .likesubsectionToc, -.likesectionToc \string~ .subsectionToc, -.sectionToc \string~ .likesubsectionToc, -.sectionToc \string~ .subsectionToc +.likesubsectionToc, +.subsectionToc {margin-left:2em;}} -\Css{.likesectionToc \string~ .likesubsectionToc \string~ .likesubsubsectionToc, -.likesectionToc \string~ .likesubsectionToc \string~ .subsubsectionToc, -.likesectionToc \string~ .subsectionToc \string~ .likesubsubsectionToc, -.likesectionToc \string~ .subsectionToc \string~ .subsubsectionToc, -.sectionToc \string~ .likesubsectionToc \string~ .likesubsubsectionToc, -.sectionToc \string~ .likesubsectionToc \string~ .subsubsectionToc, -.sectionToc \string~ .subsectionToc \string~ .likesubsubsectionToc, -.sectionToc \string~ .subsectionToc \string~ .subsubsectionToc - {margin-left:4em;}} \Css{ .likesubsectionToc, .subsectionToc - {margin-left:0em;}} -\Css{ -.likesubsectionToc \string~ .subsubsectionToc, -.subsectionToc \string~ .subsubsectionToc {margin-left:2em;}} +\Css{ +.likesubsubsectionToc, +.subsubsectionToc + {margin-left:3em;}} + + +\Css{.paragraphToc, .likeparagraphToc {margin-left:4em;}} +\Css{.subparagraphToc, .likesubparagraphToc {margin-left:5em;}} + >>> diff --git a/Master/texmf-dist/source/generic/tex4ht/tex4ht-html5.tex b/Master/texmf-dist/source/generic/tex4ht/tex4ht-html5.tex index d69fe6dfa1d..c49bd632d32 100644 --- a/Master/texmf-dist/source/generic/tex4ht/tex4ht-html5.tex +++ b/Master/texmf-dist/source/generic/tex4ht/tex4ht-html5.tex @@ -1,4 +1,4 @@ -% $Id: tex4ht-html5.tex 1284 2023-01-10 21:33:09Z karl $ +% $Id: tex4ht-html5.tex 1379 2023-10-09 11:56:53Z michal_h21 $ % compile 3 times: latex tex4ht-moz % or xhlatex tex4ht-moz "html,3,sections+" % @@ -93,11 +93,11 @@ background of generated images in the dark mode, or line lenght. max-width:none } }} -\Css{.partHead, likepartHead { font-size: 2em; }} -\Css{.chapterHead, likechapterHead { font-size: 1.7411em; }} -\Css{.sectionHead, likesectionHead { font-size: 1.5157em; }} -\Css{.subsectionHead, likesubsectionHead { font-size: 1.3195em; }} -\Css{.subsubsectionHead, likesubsubsectionHead { font-size: 1.1487em; }} +\Css{.partHead, .likepartHead { font-size: 2em; }} +\Css{.chapterHead, .likechapterHead { font-size: 1.7411em; }} +\Css{.sectionHead, .likesectionHead { font-size: 1.5157em; }} +\Css{.subsectionHead, .likesubsectionHead { font-size: 1.3195em; }} +\Css{.subsubsectionHead, .likesubsubsectionHead { font-size: 1.1487em; }} \Css{ @media (prefers-color-scheme: dark) { -- cgit v1.2.3