summaryrefslogtreecommitdiff
path: root/support/TeX4ht/source/tex4ht-4ht.tex
diff options
context:
space:
mode:
Diffstat (limited to 'support/TeX4ht/source/tex4ht-4ht.tex')
-rw-r--r--support/TeX4ht/source/tex4ht-4ht.tex118
1 files changed, 87 insertions, 31 deletions
diff --git a/support/TeX4ht/source/tex4ht-4ht.tex b/support/TeX4ht/source/tex4ht-4ht.tex
index b4ce6fa169..c8020013b0 100644
--- a/support/TeX4ht/source/tex4ht-4ht.tex
+++ b/support/TeX4ht/source/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}
>>>