From fd2f9ef68518c5ae05d71a76af7835f3022200e6 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 10 Jan 2023 21:34:55 +0000 Subject: css for sections and page dimensions, tex4ht r1283 git-svn-id: svn://tug.org/texlive/trunk@65513 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/generic/tex4ht/ChangeLog | 17 +++++++ Master/texmf-dist/source/generic/tex4ht/Makefile | 26 +++++------ .../source/generic/tex4ht/mktex4ht-cnf.tex | 4 +- .../source/generic/tex4ht/tex4ht-html4.tex | 8 ++-- .../source/generic/tex4ht/tex4ht-html5.tex | 45 ++++++++++++++++-- Master/texmf-dist/tex/generic/tex4ht/html5.4ht | 53 ++++++++++++++++++++-- Master/texmf-dist/tex/generic/tex4ht/tex4ht.sty | 6 +-- .../texmf-dist/tex/generic/tex4ht/usepackage.4ht | 6 +-- 8 files changed, 132 insertions(+), 33 deletions(-) diff --git a/Master/texmf-dist/source/generic/tex4ht/ChangeLog b/Master/texmf-dist/source/generic/tex4ht/ChangeLog index 5974b09e6fc..d1cb7c2edcb 100644 --- a/Master/texmf-dist/source/generic/tex4ht/ChangeLog +++ b/Master/texmf-dist/source/generic/tex4ht/ChangeLog @@ -1,3 +1,20 @@ +2023-01-10 Michal Hoftich + + * tex4ht-html5.tex (html5.4ht): added default CSS style for sections + and page dimensions. + https://puszcza.gnu.org.ua/bugs/?592 + +2023-01-08 Karl Berry + + * Makefile (common_no_tex4ht_sty): rename to common_no_cond_sty, + since tex4ht.sty is what is left out. Mention that we also leave + out mktex4ht.4ht from all, since it's mostly just the list of packages. + (tex4ht_sty_derived): dependency is now $(common_no_tex4ht_sty). + (tex4ht_cond4ht_derived): can depend on $(common). + + * mktex4ht-cnf.tex, + * tex4ht-html4.tex (html4.4ht, html4-math.4ht): copyright 2023. + 2023-01-01 Michal Hoftich * tex4th-html4.tex (html4.4ht): set font size for \subsubsection diff --git a/Master/texmf-dist/source/generic/tex4ht/Makefile b/Master/texmf-dist/source/generic/tex4ht/Makefile index f901ebbb4f9..e66c7e99133 100644 --- a/Master/texmf-dist/source/generic/tex4ht/Makefile +++ b/Master/texmf-dist/source/generic/tex4ht/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile 1239 2022-11-16 22:27:35Z karl $ +# $Id: Makefile 1282 2023-01-08 15:27:15Z karl $ # This file is public domain. Originally written 2010, Karl Berry. # Assumes GNU make. @@ -72,18 +72,18 @@ HTTEX = ht "etex $(tex_opts)" # set tex options for plain tex default: all -# most files (not all, but it's not worth worrying about) read -# mktex4ht.4ht, but we have to avoid depending on it for the file which -# generates it (cond4ht), so we need two different variables. -# Similarly for tex4ht.sty, though that is modified far less often. +# tex4ht.sty is read by most (all?) files, but we have to avoid +# depending on it for the file which generates it (tex4ht-sty.tex), so +# we need two different variables. # -common_no_cond_sty = tex4ht-cpright.tex common.tex common-code.tex \ +common_no_tex4ht_sty = tex4ht-cpright.tex common.tex common-code.tex \ ProTex.sty AlProTex.sty tex4ht-dir.tex -# common = mktex4ht.4ht tex4ht.sty $(common_no_cond_sty) common = tex4ht.sty $(common_no_cond_sty) -# Michal 10/05/2017: it seems that when mktex4ht.4ht is included as -# common, it causes constant recompilations. common_info = $(common) common-info.tex +# +# mktex4ht.4ht is read by almost everything, but since it is mostly just +# the list of packages, it changes often, without any particular need to +# rebuild everything when it does. So leave it out. # Substitute directories used, especially for Java. tex4ht-dir.tex: tex4ht-dir.m4 @@ -389,8 +389,7 @@ endif # all: $(derived) - rm -f texput.log - texlua checklog.lua *.log + rm -f texput.log; texlua checklog.lua *.log $(tex4ht_4ht_derived): tex4ht-4ht.tex cond4ht.4ht $(common) etex $(tex_opts) $< @@ -401,8 +400,7 @@ $(tex4ht_bibtex2_derived): tex4ht-bibtex2.tex $(common) $(tex4ht_c_derived): tex4ht-c.tex $(common) etex $(tex_opts) $< -$(tex4ht_cond4ht_derived): tex4ht-cond4ht.tex mktex4ht-cnf.tex \ - $(common_no_cond_sty) +$(tex4ht_cond4ht_derived): tex4ht-cond4ht.tex mktex4ht-cnf.tex $(common) etex $(tex_opts) $< etex $(tex_opts) cond4ht.4ht @@ -548,7 +546,7 @@ $(tex4ht_ooimpress_derived): tex4ht-ooimpress.tex $(common) $(tex4ht_options_derived): tex4ht-options.tex $(common) htlatex $< "html,3,sections+" "" "" $(tex_1opt) -$(tex4ht_sty_derived): tex4ht-sty.tex $(common_no_cond_sty) +$(tex4ht_sty_derived): tex4ht-sty.tex $(common_no_tex4ht_sty) $(HTTEX) $< "" $(tex4ht_svg_derived): tex4ht-svg.tex $(common) diff --git a/Master/texmf-dist/source/generic/tex4ht/mktex4ht-cnf.tex b/Master/texmf-dist/source/generic/tex4ht/mktex4ht-cnf.tex index 8bc9a1deb1a..3143a5b33dd 100644 --- a/Master/texmf-dist/source/generic/tex4ht/mktex4ht-cnf.tex +++ b/Master/texmf-dist/source/generic/tex4ht/mktex4ht-cnf.tex @@ -1,8 +1,8 @@ -% $Id: mktex4ht-cnf.tex 1261 2022-12-09 16:06:10Z michal_h21 $ +% $Id: mktex4ht-cnf.tex 1282 2023-01-08 15:27:15Z karl $ % Manually-maintained file, listing *.4ht files created by tex4ht-4ht.tex. % Read by tex4ht-cond4ht. % -% Copyright 2016-2020 TeX Users Group +% Copyright 2016-2023 TeX Users Group % Released under LPPL 1.3c+. % See tex4ht-cpright.tex for license text. % diff --git a/Master/texmf-dist/source/generic/tex4ht/tex4ht-html4.tex b/Master/texmf-dist/source/generic/tex4ht/tex4ht-html4.tex index 6308f08f7b2..27620e4ee1c 100644 --- a/Master/texmf-dist/source/generic/tex4ht/tex4ht-html4.tex +++ b/Master/texmf-dist/source/generic/tex4ht/tex4ht-html4.tex @@ -1,8 +1,8 @@ -% $Id: tex4ht-html4.tex 1281 2023-01-01 22:05:02Z michal_h21 $ +% $Id: tex4ht-html4.tex 1282 2023-01-08 15:27:15Z karl $ % Compile 4 times: latex tex4ht-html4 % Copy html4.4ht into the work directory before all but the last compilation. % -% Copyright 2009-2022 TeX Users Group +% Copyright 2009-2023 TeX Users Group % Copyright 1996-2009 Eitan M. Gurari % Released under LPPL 1.3c+. % See tex4ht-cpright.tex for license text. @@ -65,7 +65,7 @@ \<<< % html4.4ht (|version), generated from |jobname.tex -% Copyright 2009-2022 TeX Users Group +% Copyright 2009-2023 TeX Users Group % Copyright |CopyYear.1997. Eitan M. Gurari | >>> @@ -73,7 +73,7 @@ \<<< % html4-math.4ht (|version), generated from |jobname.tex -% Copyright 2009-2022 TeX Users Group +% Copyright 2009-2023 TeX Users Group % Copyright |CopyYear.1999. Eitan M. Gurari | >>> diff --git a/Master/texmf-dist/source/generic/tex4ht/tex4ht-html5.tex b/Master/texmf-dist/source/generic/tex4ht/tex4ht-html5.tex index 761e9968fd6..d69fe6dfa1d 100644 --- a/Master/texmf-dist/source/generic/tex4ht/tex4ht-html5.tex +++ b/Master/texmf-dist/source/generic/tex4ht/tex4ht-html5.tex @@ -1,8 +1,8 @@ -% $Id: tex4ht-html5.tex 1182 2022-08-11 19:21:27Z michal_h21 $ +% $Id: tex4ht-html5.tex 1284 2023-01-10 21:33:09Z karl $ % compile 3 times: latex tex4ht-moz % or xhlatex tex4ht-moz "html,3,sections+" % -% Copyright 2009-2022 TeX Users Group +% Copyright 2009-2023 TeX Users Group % Copyright 2000-2009 Eitan M. Gurari % Released under LPPL 1.3c+. % See tex4ht-cpright.tex for license text. @@ -26,7 +26,7 @@ \<<< % html5.4ht (|version), generated from |jobname.tex -% Copyright 2016-2022 TeX Users Group +% Copyright 2016-2023 TeX Users Group | >>> @@ -69,6 +69,45 @@ \fi >>> +\section{Default CSS style} + +This style fixes some common issues regarding size of sectioning commands, +background of generated images in the dark mode, or line lenght. + + +\<<< +\:CheckOption{nostyle}\if:Option +\else +\Log:Note{We use a default CSS style. Use the `nostyle' option if you want to use custom a CSS design} +\Css{body{ + margin:1em auto; + max-width:80ch; + padding:0 .62em; +}} + +\Css{h1,h2,h3,h4,h5 { + line-height:1.2; +}} +\Css{@media print{ + body{ + 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{ + @media (prefers-color-scheme: dark) { + img[src^="\jobname"]{filter: invert(1); } + } +} +\fi +>>> + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{Language and charset setting} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/Master/texmf-dist/tex/generic/tex4ht/html5.4ht b/Master/texmf-dist/tex/generic/tex4ht/html5.4ht index f29e77b0d91..2e25a58bcb2 100644 --- a/Master/texmf-dist/tex/generic/tex4ht/html5.4ht +++ b/Master/texmf-dist/tex/generic/tex4ht/html5.4ht @@ -1,5 +1,5 @@ -% html5.4ht (2022-08-11-14:16), generated from tex4ht-html5.tex -% Copyright 2016-2022 TeX Users Group +% html5.4ht (2023-01-10-13:34), generated from tex4ht-html5.tex +% Copyright 2016-2023 TeX Users Group % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either @@ -16,7 +16,7 @@ % % If you modify this program, changing the % version identification would be appreciated. -\immediate\write-1{version 2022-08-11-14:16} +\immediate\write-1{version 2023-01-10-13:34} \exit:ifnot{amsart,% amsbook,% @@ -68,6 +68,35 @@ tex4ht} \else \Log:Note{To print a timestamp, use the command line option timestamp} \fi +\:CheckOption{nostyle}\if:Option +\else +\Log:Note{We use a default CSS style. Use the `nostyle' option if you want to use custom a CSS design} +\Css{body{ + margin:1em auto; + max-width:80ch; + padding:0 .62em; +}} + +\Css{h1,h2,h3,h4,h5 { + line-height:1.2; +}} +\Css{@media print{ + body{ + 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{ + @media (prefers-color-scheme: dark) { + img[src^="\jobname"]{filter: invert(1); } + } +} +\fi \def\Declare:Language#1#2{% \expandafter\gdef\csname rfclang#1\endcsname{#2}% } @@ -369,6 +398,8 @@ tex4ht} + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ConfigureHinput{amsart} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -416,7 +447,6 @@ tex4ht} \endinput\empty\empty\empty\empty\empty\empty %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ConfigureHinput{amsbook} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -730,6 +760,16 @@ tex4ht} + + + + + + + + + + @@ -1136,6 +1176,11 @@ tex4ht} + + + + + diff --git a/Master/texmf-dist/tex/generic/tex4ht/tex4ht.sty b/Master/texmf-dist/tex/generic/tex4ht/tex4ht.sty index 3a1ee6554d1..20079c61c6f 100644 --- a/Master/texmf-dist/tex/generic/tex4ht/tex4ht.sty +++ b/Master/texmf-dist/tex/generic/tex4ht/tex4ht.sty @@ -1,8 +1,8 @@ \ifnum\the\catcode`\%=14\else\expandafter\edef\csname \string:RestoreCatcodes\endcsname{\catcode`\%\the \catcode`\%}\catcode`\%14\fi -% tex4ht.sty (2022-09-16-14:11), generated from tex4ht-sty.tex -% Copyright 2009-2022 TeX Users Group +% tex4ht.sty (2023-01-01-18:19), generated from tex4ht-sty.tex +% Copyright 2009-2023 TeX Users Group % Copyright 1996-2009 Eitan M. Gurari % % This work may be distributed and/or modified under the @@ -20,7 +20,7 @@ % % If you modify this program, changing the % version identification would be appreciated. -\immediate\write-1{version 2022-09-16-14:11} +\immediate\write-1{version 2023-01-01-18:19} \ifx \Preamble\UnDef \else diff --git a/Master/texmf-dist/tex/generic/tex4ht/usepackage.4ht b/Master/texmf-dist/tex/generic/tex4ht/usepackage.4ht index 454125bf3ac..719a9ba96fe 100644 --- a/Master/texmf-dist/tex/generic/tex4ht/usepackage.4ht +++ b/Master/texmf-dist/tex/generic/tex4ht/usepackage.4ht @@ -1,6 +1,6 @@ -% usepackage.4ht (2022-11-22-14:29), generated from tex4ht-4ht.tex +% usepackage.4ht (2023-01-10-13:30), generated from tex4ht-4ht.tex % Copyright 2003-2009 Eitan M. Gurari -% Copyright 2009-2022 TeX Users Group +% Copyright 2009-2023 TeX Users Group % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either @@ -17,7 +17,7 @@ % % If you modify this program, changing the % version identification would be appreciated. -\immediate\write-1{version 2022-11-22-14:29} +\immediate\write-1{version 2023-01-10-13:30} \def\:temp{tex4ht}\ifx \:temp\@currname \:warning{\string\usepackage{tex4ht} again?} -- cgit v1.2.3