diff options
author | Karl Berry <karl@freefriends.org> | 2022-04-04 14:45:45 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-04-04 14:45:45 +0000 |
commit | 2ce6cae309475dafb8b34c940e8b28115946a20f (patch) | |
tree | 20d7355430fbc4510c465c6bd7db72620cd10105 /Master/texmf-dist/source/generic | |
parent | f404266c0f5f8c80182d9c7c14c1b19c5128b307 (diff) |
tex4ht updates, texhr r1096-1106
git-svn-id: svn://tug.org/texlive/trunk@62897 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/generic')
7 files changed, 199 insertions, 70 deletions
diff --git a/Master/texmf-dist/source/generic/tex4ht/ChangeLog b/Master/texmf-dist/source/generic/tex4ht/ChangeLog index c69257cad6e..8bd91f94e15 100644 --- a/Master/texmf-dist/source/generic/tex4ht/ChangeLog +++ b/Master/texmf-dist/source/generic/tex4ht/ChangeLog @@ -1,10 +1,60 @@ -2021-03-21 Michal Hoftich <michal.h21@gmail.com> +2022-04-04 Michal Hoftich <michal.h21@gmail.com> + + * tex4ht-4ht.tex (minted.4ht): fixed spurious whitespace produced by + \mintinline. + * tex4ht-html4.tex (html4.4ht): disable ht-fonts for inline Minted. + +2022-03-31 Michal Hoftich <michal.h21@gmail.com> + + * tex4ht-html4.tex (html4.4ht): support frames and background colors + in custom Listings environments. + https://tex.stackexchange.com/a/639135/2891 + +2022-03-30 Michal Hoftich <michal.h21@gmail.com> + + * tex4ht-sty.tex (tex4ht.sty): don't redefine \IfFileExists. It can + break packages that don't expect extra tokens at it's end. + https://tex.stackexchange.com/a/638965/2891 + +2022-03-29 Michal Hoftich <michal.h21@gmail.com> + + * tex4ht-4ht.tex (subfiles.4ht): fixed support for multiple included + files in the Subfiles package. + https://tex.stackexchange.com/a/353117/2891 + + * tex4ht-html4.tex (html4.4ht): handle \# character in \title. + https://tex.stackexchange.com/a/638821/2891 + +2022-03-28 Michal Hoftich <michal.h21@gmail.com> + + * tex4ht-ooffice.tex (ooffice.4ht): don't use bold font for \textsf + command. + +2022-03-25 Michal Hoftich <michal.h21@gmail.com> + + * tex4ht-4ht.tex (biblatex.4ht): fixed issues with backref page + numbers. + https://github.com/michal-h21/make4ht/issues/58 + +2022-03-24 Michal Hoftich <michal.h21@gmail.com> + + * tex4ht-mathjax.tex (mathjax-latex-4ht.4ht): use \detokenize to + prevent math environments from expansion. + https://puszcza.gnu.org.ua/bugs/?557 + * tex4ht-4ht.tex (listings.4ht): ignore spurious spaces at beginning + of listings. + * tex4ht-html4.tex (html4.4ht): removed extra <br> tags, fixed + issues with extra newlines. + * tex4ht-4ht.tex (biblatex.4ht): removed spurious whitespace after + backrefences. + +2022-03-21 Michal Hoftich <michal.h21@gmail.com> * tex4ht-4ht.tex (arydshln.4ht): added basic support for the Arydshln package. https://tex.stackexchange.com/a/637897/2891 -2021-03-20 Michal Hoftich <michal.h21@gmail.com> +2022-03-20 Michal Hoftich <michal.h21@gmail.com> * tex4ht-4ht.tex (graphics.4ht): don't execute graphics rules when user selected other driver than dvips. @@ -13,13 +63,13 @@ * update-htfonts: add installed files, not dev. -2021-03-20 Michal Hoftich <michal.h21@gmail.com> +2022-03-20 Michal Hoftich <michal.h21@gmail.com> * tex4ht-html4.tex (html4.4ht): added support for background and border colors in Listings. https://tex.stackexchange.com/a/637789/2891 -2021-03-17 Michal Hoftich <michal.h21@gmail.com> +2022-03-17 Michal Hoftich <michal.h21@gmail.com> * tex4ht-fonts-opensans.tex: added support for OpenSans fonts. https://tex.stackexchange.com/q/637314/2891 diff --git a/Master/texmf-dist/source/generic/tex4ht/mktex4ht-cnf.tex b/Master/texmf-dist/source/generic/tex4ht/mktex4ht-cnf.tex index 65fe3c18818..5a1bcfbba61 100644 --- a/Master/texmf-dist/source/generic/tex4ht/mktex4ht-cnf.tex +++ b/Master/texmf-dist/source/generic/tex4ht/mktex4ht-cnf.tex @@ -1,4 +1,4 @@ -% $Id: mktex4ht-cnf.tex 1095 2022-03-21 13:29:42Z michal_h21 $ +% $Id: mktex4ht-cnf.tex 1103 2022-03-29 15:46:43Z michal_h21 $ % Manually-maintained file, listing *.4ht files created by tex4ht-4ht.tex. % Read by tex4ht-cond4ht. % @@ -369,5 +369,6 @@ \AddFile{9}{menukeys} \AddFile{9}{animate} \AddFile{9}{sectionbreak} +\AddFile{9}{subfiles} \AddFile{9}{fontawesome5} % \AddFile{9}{mktex4ht} diff --git a/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex b/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex index b4ce6fa169f..c8020013b08 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 1095 2022-03-21 13:29:42Z michal_h21 $ +% $Id: tex4ht-4ht.tex 1106 2022-04-04 10:06:26Z michal_h21 $ % tex tex4ht-4ht or ht tex tex4ht-4ht % % Copyright 2009-2022 TeX Users Group @@ -2795,7 +2795,8 @@ Fix backlink support in BibLaTeX % insert link to the page \html:addr\Link-{}{|<haddr prefix|>\last:haddr}\EndLink% % save link to the .xref file - \Tag{)Q##1\thepage}{|<haddr prefix|>\last:haddr}% + % we need to use \protected@write to get correct page numbers in backrefs + \protected@write\:refout{}{\string\:CrossWord{)Q##1\thepage}{|<haddr prefix|>\last:haddr}{\folio}} % we need to save the link destination in .xref file % too, otherwise \Link command would issue warning \Tag{)Q|<haddr prefix|>\last:haddr}{\FileNumber}% @@ -2823,18 +2824,18 @@ Fix backlink support in BibLaTeX % back to the citations on the given pages \let\orig:hyperlink\hyperlink% \let\hyperlink\bbx:hyperlink% - \ifnumless{\abx@pagerefstyle}{0} + \ifnumless{\abx@pagerefstyle}{0}% {\usebibmacro{list:plain}% - \ifhyperref - {\hyperlink{page.#1}{#1}} - {#1}} - {\ifnumequal{\value{listcount}}{1} - {\usebibmacro{pageref:init}} + \ifhyperref% + {\hyperlink{page.#1}{#1}}% + {#1}}% + {\ifnumequal{\value{listcount}}{1}% + {\usebibmacro{pageref:init}}% {}% \usebibmacro{pageref:comp}{#1}% - \ifnumequal{\value{listcount}}{\value{liststop}} - {\usebibmacro{pageref:dump}} - {}} + \ifnumequal{\value{listcount}}{\value{liststop}}% + {\usebibmacro{pageref:dump}}% + {}}% \let\hyperlink\orig:hyperlink% } @@ -4745,6 +4746,43 @@ PDF mode, it is safest thing to do to just disable the package. \Hinput{sectionbreak} >>> \AddFile{9}{sectionbreak} + +\<subfiles.4ht\><<< +% subfiles.4ht (|version), generated from |jobname.tex +% Copyright 2022 TeX Users Group +|<TeX4ht license text|> +|<subfiles enddocument|> +\Hinput{subfiles} +\endinput +>>> \AddFile{9}{subfiles} + +We use the original version of \Verb|\subfiles@renewEndDocument|, the only +change is that we added the \Verb|\choose:begin| redefinition. It is necessary +to prevent processing of the document after \Verb|\end{document}| in the +included subfile. + +\<subfiles enddocument\><<< +\def\:tempa#1{% + \ifcsname subfiles@end\endcsname + \else + \subfiles@saveEndTo\subfiles@end + \fi + \let\choose:begin\@secondoftwo + \expandafter\def\csname end \endcsname##1{% + \romannumeral + \subfiles@StrIfEqTF{##1}{document}{% + \z@ + \subfiles@restoreEndFrom\subfiles@end + #1% + }{% + \expandafter\expandafter\expandafter\z@\subfiles@end{##1}% + }% + }% +} + +\HLet\subfiles@renewEndDocument\:tempa +>>> + \Section{url.sty} %%%%%%%%%%%%%%%%%% @@ -24776,22 +24814,44 @@ of LaTeX. The \''\:gobbleII' is for getting rid of the \<minted.4ht\><<< % minted.4ht (|version), generated from |jobname.tex -% Copyright 2020-2021 TeX Users Group +% Copyright 2022 TeX Users Group |<TeX4ht license text|> + +|<minted inline fixes|> +|<minted background color|> +|<minted background color|> +|<minted input fixes|> + +\Hinput{minted} +\endinput +>>> \AddFile{9}{minted} + +Support for inline Minted listings. We need to take care of +newline and space characters, as they produce unwanted white space +in the generated HTML. + +\<minted inline fixes\><<< \NewConfigure{InlineCode}{2} +% this is a hack to hide a newline that is produced, and which causes spurious space in the output +\NewConfigure{MintedHideNewline}{2} +\Configure{MintedHideNewline}{\HCode{<!--}}{\HCode{-->}} \def\:tempa#1{% \endgroup% \begingroup% - \Configure{BVerbatimInput}{\HCode{}}{}{}{}{}\a:InlineCode% The \HCode is necessary for correct paragraph handling + \Configure{BVerbatimInput}{\HCode{}\ht:special{t4ht@(}}% \HCode is necessary for correct paragraph handlingling + {\a:MintedHideNewline}{\ht:special{t4ht@)}}{}{}% also hide newline and spurious spaces + \a:InlineCode% \begingroup% - \o:minted@inline@iii:{#1}% + \o:minted@inline@iii:{#1}\b:MintedHideNewline% \b:InlineCode% \endgroup% } \HLet\minted@inline@iii\:tempa +>>> +\<minted background color\><<< % support for background color in Minted listings \NewConfigure{MintedColorbg}{2} \renewenvironment{minted@colorbg}[1]{% @@ -24801,13 +24861,7 @@ of LaTeX. The \''\:gobbleII' is for getting rid of the \a:MintedColorbg% } {\b:MintedColorbg\medskip\noindent} - -|<minted input fixes|> - -\Hinput{minted} -\endinput ->>> \AddFile{9}{minted} - +>>> Minted sometimes produces unexpected results. For example, << characters get translated to guilelemets. To prevent that, we define new configuration, @@ -30938,19 +30992,21 @@ Configure list of listings \lst@newlinetrue }% \HLet\lst@NewLine\:tempa -\def\lst@InputListing#1{% - \begingroup - \lsthk@PreSet \gdef\lst@intname{#1}% +\def\:tempa#1{ + \begingroup% + \lsthk@PreSet\gdef\lst@intname{#1}% \expandafter\lstset\expandafter{\lst@set}% - \lsthk@DisplayStyle - \catcode\active=\active - \a:lstinputlisting \lst@Init\relax \let\lst@gobble\z@ - \lst@SkipToFirst + \lsthk@DisplayStyle% + \catcode\active=\active% + \a:lstinputlisting\special{t4ht@[}\lst@Init\relax \let\lst@gobble\z@% + \lst@SkipToFirst% \lst@ifprint \def\lst@next{\input{#1}}% - \else \let\lst@next\@empty \fi - \lst@next \lst@DeInit - \b:lstinputlisting + \else \let\lst@next\@empty \fi% + \special{t4ht@]}\lst@next \lst@DeInit% + \b:lstinputlisting% \endgroup} + +\HLet\lst@InputListing\:tempa \NewConfigure{lstinputlisting}{2} >>> diff --git a/Master/texmf-dist/source/generic/tex4ht/tex4ht-html4.tex b/Master/texmf-dist/source/generic/tex4ht/tex4ht-html4.tex index f9edbd385b3..ba40def116e 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 1093 2022-03-20 16:15:35Z karl $ +% $Id: tex4ht-html4.tex 1106 2022-04-04 10:06:26Z michal_h21 $ % Compile 4 times: latex tex4ht-html4 % Copy html4.4ht into the work directory before all but the last compilation. % @@ -6328,6 +6328,8 @@ thanks author date and>>> \def\mbox{\hbox}% \def\gobble:font##1##2{##2}\:TITLE: \no:fonts \def\footnotemark[##1]{}% +\def\:hashintitle{\protect\symbol{35}} +\let\#\:hashintitle \Tag{TITLE+}{\@title}} >>> @@ -6352,6 +6354,8 @@ Old latex files need \verb'\no:fonts', but not new ones.---wrong, as far as writ \def\mbox{\hbox}% \def\gobble:font##1##2{##2}\:TITLE: \no:fonts \def\footnotemark[##1]{}% +\def\:hashintitle{\protect\symbol{35}} +\let\#\:hashintitle \Tag{TITLE+}{\shorttitle}} >>> @@ -6378,6 +6382,8 @@ Old latex files need \verb'\no:fonts', but not new ones.---wrong, as far as writ \let \bf=\empty \let \centering=\empty \def \ignorespaces##1\vskip##2//{##1}% +\def\:hashintitle{\protect\symbol{35}} +\let\#\:hashintitle \Tag{TITLE+}{\@title//}% }% >>> @@ -6391,6 +6397,8 @@ Old latex files need \verb'\no:fonts', but not new ones.---wrong, as far as writ \def\mbox{\hbox}% \let\\\space \def\TeX{TeX}% \def\gobble:font##1##2{##2}\:TITLE: \no:fonts +\def\:hashintitle{\protect\symbol{35}} +\let\#\:hashintitle \Tag{TITLE+}{\@title}}% >>> @@ -12566,6 +12574,7 @@ y{\ht:special{t4ht@+\string&{35}x00FD{59}}y}% \<env for titles\><<< \let\"=\:same \let\~=\:same \let\^=\:same \let\v=\:same \let\'=\:same \let\r=\:same +\let\#=\:same \PictureOff >>> @@ -15197,7 +15206,8 @@ listings.dtx. Configuration for the inline code \<configure html4 minted\><<< -\Configure{InlineCode}{\HCode{<code>}}{\HCode{</code>}} +\Configure{InlineCode}{\HCode{<code class="minted-inline">}\NoFonts}{\EndNoFonts\HCode{</code>}} +\Css{code.minted-inline{font-family:monospace,monospace;}} >>> Configuration for listings with colored backgrounds @@ -15236,21 +15246,29 @@ Inline listings snippets fixed size fonts (see listings.dtx)} >>> +This configuration is used mainly when user defines new environment using \verb|lstnewenvironment|. + \<configure html4 listings\><<< +\HAssign\listingN=0 \HAssign\listings:Depth = 0 \Configure{listings} - {\ifvmode \IgnorePar\fi \EndP + {\ifvmode \IgnorePar\fi \EndP% {\everypar{}\leavevmode}\HCode{<!--l. \the\inputlineno-->}% - \ifnum \listings:Depth=0 \HCode{<pre class="listings">}\else - \HCode{<span class="listings-nested">}\fi - \gHAdvance\listings:Depth by 1 + \ifnum \listings:Depth=0 \HCode{<pre class="listings" id="listing-\listingN">}\else% + \HCode{<span class="listings-nested" id="listing-\listingN">}\fi% + \gHAdvance\listings:Depth by 1% + \gdef\start:LstLn{}% } {\gHAdvance\listings:Depth by -1 \ifnum \listings:Depth=0 \HCode{</pre>}\else \HCode{</span>}\fi } - {|<nbsp|>\HCode{<br /><span class="label">}} + {\start:LstLn\HCode{<span class="label">}% + \gdef\start:LstLn{\HCode{\Hnewline}}}% {\HCode{</span>}}% +\Css{pre.listings{font-family: monospace,monospace; white-space: pre-wrap; + margin-top:0.5em; margin-bottom:0.5em; + }} >>> \<configure html4 listings\><<< @@ -15280,14 +15298,12 @@ Inline listings snippets \<configure html4 listings\><<< -\HAssign\listingN=0 \ConfigureEnv{lstlisting} {\ifvmode \IgnorePar\fi \EndP - \gHAdvance\listingN by 1 \HCode{<!--l. \the\inputlineno-->}% \gdef\start:LstLn{% \HCode{<pre class="lstlisting" id="listing-\listingN">}% - \gdef\start:LstLn{|<nbsp|>\HCode{<br />\Hnewline}}} + \gdef\start:LstLn{\HCode{\Hnewline}}} \bgroup% % we put the closing </div> here in order to support floating listings % https://tex.stackexchange.com/a/615703/2891 @@ -15301,7 +15317,7 @@ Inline listings snippets {\egroup\par} {} {} \Css{.lstlisting .label{margin-right:0.5em; }} -\Css{pre.lstlisting{font-family: monospace,monospace; white-space: nowrap; +\Css{pre.lstlisting{font-family: monospace,monospace; white-space: pre-wrap; margin-top:0.5em; margin-bottom:0.5em; }} >>> @@ -15310,14 +15326,12 @@ Inline listings snippets \Configure{lstinputlisting} {\ifvmode \IgnorePar\fi \EndP \HCode{<!--l. \the\inputlineno-->}% - \gHAdvance\listingN by 1% - \HCode{<pre class="lstinputlisting" id="listing-\listingN">}% + \gdef\start:LstLn{\HCode{<pre class="lstinputlisting" id="listing-\listingN">}\gdef\start:LstLn{\HCode{\Hnewline}}}% ignore first newline, to prevent spurious line \bgroup\ttfamily%\special{t4ht@(}% \Configure{listings}% {{\everypar{}\leavevmode}}% {{\everypar{}\leavevmode}}% - {|<nbsp|>% - \HCode{<br />\Hnewline<span class="label">}}% + {\start:LstLn\HCode{<span class="label">}}% {\HCode{</span>}}% } {%\special{t4ht@)} @@ -15325,7 +15339,7 @@ Inline listings snippets \ifvmode \IgnorePar\fi \EndP \HCode{</pre>}\par}% \Css{pre.lstinputlisting{ font-family: monospace,monospace; - white-space: nowrap; + white-space: pre-wrap; }} \Css{.lstinputlisting .label{margin-right:0.5em;}} >>> @@ -15362,7 +15376,8 @@ Support for background and border color \<configure html4 listings\><<< \lst@AddToHook{Init}{% -\bgroup% + \gHAdvance\listingN by 1% increase the ID before we save colors. + \bgroup% % handle backround color and border in listings \ifx\lst@fillcolor\@empty\else% \lst@fillcolor% diff --git a/Master/texmf-dist/source/generic/tex4ht/tex4ht-mathjax.tex b/Master/texmf-dist/source/generic/tex4ht/tex4ht-mathjax.tex index 3c50d2cacf5..730a778fce7 100644 --- a/Master/texmf-dist/source/generic/tex4ht/tex4ht-mathjax.tex +++ b/Master/texmf-dist/source/generic/tex4ht/tex4ht-mathjax.tex @@ -1,4 +1,4 @@ -% $Id: tex4ht-mathjax.tex 1023 2021-12-02 09:42:42Z michal_h21 $ +% $Id: tex4ht-mathjax.tex 1098 2022-03-24 22:18:43Z michal_h21 $ % compile: latex tex4ht-mathjax % % Copyright 2018-2021 TeX Users Group @@ -104,7 +104,7 @@ verbatim to the HTML output. \newcommand\VerbMath[1]{% \cs_if_exist:cTF{#1}{ \RenewDocumentEnvironment{#1}{+!b}{% - \NoFonts\expandafter\VerbMathToks\expandafter{##1}{#1}\EndNoFonts% + \NoFonts\expandafter\VerbMathToks\expandafter{\detokenize{##1}}{#1}\EndNoFonts% }{} }{}% } diff --git a/Master/texmf-dist/source/generic/tex4ht/tex4ht-ooffice.tex b/Master/texmf-dist/source/generic/tex4ht/tex4ht-ooffice.tex index 0395dadac0a..56de7c4c9c1 100644 --- a/Master/texmf-dist/source/generic/tex4ht/tex4ht-ooffice.tex +++ b/Master/texmf-dist/source/generic/tex4ht/tex4ht-ooffice.tex @@ -1,4 +1,4 @@ -% $Id: tex4ht-ooffice.tex 1074 2022-02-06 19:43:26Z michal_h21 $ +% $Id: tex4ht-ooffice.tex 1101 2022-03-28 11:52:50Z michal_h21 $ % compile 3 times: latex tex4ht-ooffice % htlatex tex4ht-ooffice "xhtml,4,sections+" % @@ -7409,7 +7409,7 @@ The section style can't be in style.xml? \<oo textsf style\><<< <style:style style:name="textsf" style:family="text">\Hnewline <style:text-properties fo:font-style="normal" - fo:font-weight="bold" + fo:font-weight="normal" style:font-family-generic="swiss" style:font-pitch="variable" />\Hnewline </style:style>\Hnewline diff --git a/Master/texmf-dist/source/generic/tex4ht/tex4ht-sty.tex b/Master/texmf-dist/source/generic/tex4ht/tex4ht-sty.tex index 6a5c7ed0e11..7bf410fe7a0 100644 --- a/Master/texmf-dist/source/generic/tex4ht/tex4ht-sty.tex +++ b/Master/texmf-dist/source/generic/tex4ht/tex4ht-sty.tex @@ -1,4 +1,4 @@ -% $Id: tex4ht-sty.tex 981 2021-09-14 20:14:03Z michal_h21 $ +% $Id: tex4ht-sty.tex 1104 2022-03-30 12:06:52Z michal_h21 $ % tex tex4ht-sty or ht tex tex4ht-sty % % Copyright 2009-2020 TeX Users Group @@ -9082,18 +9082,25 @@ and \`'\Configure{SUP}{ before }{ after }' get into effect. \<defs for early latex subs/sups\><<< \append:def\:RestoreCatcodes{\early:sub\early:sup} \let\:IfFileExists\IfFileExists -\long\def\IfFileExists#1#2#3{% - \csname recall:sub\endcsname - \csname recall:sup\endcsname - \expandafter\let\csname #1:sub\endcsname=\early:sub - \expandafter\let\csname #1:sup\endcsname=\early:sup - \let\early:sub=\relax \let\recall:sub\relax - \let\early:sup=\relax \let\recall:sup\relax - \:IfFileExists{#1}{#2}{#3}% - \expandafter\let\expandafter\early:sub\csname #1:sub\endcsname - \expandafter\let\expandafter\early:sup\csname #1:sup\endcsname - \early:sub \early:sup -} + +% I am not sure why we used this declaration. It is from the original +% TeX4ht sources, so it probably had some reason. The problem is that it +% inserts extra tokens after \:IfFileExists, and if some package uses +% something like \IfFileExists{foo.sty}{\@firstoftwo}{\@secondoftwo}{aa}{bb}, +% then it fails. I've found this issue with the Standalone class. +% See https://tex.stackexchange.com/a/638965/2891 for example where it fails. +% \long\def\IfFileExists#1#2#3{% +% \csname recall:sub\endcsname +% \csname recall:sup\endcsname +% \expandafter\let\csname #1:sub\endcsname=\early:sub +% \expandafter\let\csname #1:sup\endcsname=\early:sup +% \let\early:sub=\relax \let\recall:sub\relax +% \let\early:sup=\relax \let\recall:sup\relax +% \:IfFileExists{#1}{#2}{#3}% +% \expandafter\let\expandafter\early:sub\csname #1:sub\endcsname +% \expandafter\let\expandafter\early:sup\csname #1:sup\endcsname +% \early:sub \early:sup +% } \ifx \o:document\:UnDef \pend:def\Preamble{% \csname recall:sub\endcsname |