summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-04-04 14:45:45 +0000
committerKarl Berry <karl@freefriends.org>2022-04-04 14:45:45 +0000
commit2ce6cae309475dafb8b34c940e8b28115946a20f (patch)
tree20d7355430fbc4510c465c6bd7db72620cd10105 /Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
parentf404266c0f5f8c80182d9c7c14c1b19c5128b307 (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/tex4ht/tex4ht-4ht.tex')
-rw-r--r--Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex118
1 files changed, 87 insertions, 31 deletions
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}
>>>