From 3479a92321ed7fe7e2133d3daec2d4f5fd53fbc6 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sat, 2 Nov 2019 03:01:48 +0000 Subject: CTAN sync 201911020301 --- support/tex4ebook/tex4ebook.4ht | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'support/tex4ebook/tex4ebook.4ht') diff --git a/support/tex4ebook/tex4ebook.4ht b/support/tex4ebook/tex4ebook.4ht index e4233fc55a..e623ac8bc2 100644 --- a/support/tex4ebook/tex4ebook.4ht +++ b/support/tex4ebook/tex4ebook.4ht @@ -178,6 +178,10 @@ href="#1" media-type="\a:CoverMimeType" />}} \patch:sec:register{likesection} \patch:sec:register{likesubsection} \patch:sec:register{likesubsubsection} +\patch:sec:register{appendix} +\patch:sec:register{appendixsec} +\patch:sec:register{appendixsubsec} +\patch:sec:register{appendixsubsubsec} \:CheckOption{epub} \if:Option @@ -264,7 +268,7 @@ href="#1" media-type="\a:CoverMimeType" />}} \def\tmp:processlevel#1{ \bgroup \csxdef{tmp:resettoclevels#1}{} - \def\do##1{\csxdef{tmp:resettoclevels#1}{\csname tmp:resettoclevels#1\endcsname ##1,like##1,}} + \def\do##1{\csxdef{tmp:resettoclevels#1}{\csname tmp:resettoclevels#1\endcsname ##1,like##1,\appendix:type{##1}}} \def\tmp:parse##1#1##2\nil{ \docsvlist{#1##2} } @@ -273,6 +277,8 @@ href="#1" media-type="\a:CoverMimeType" />}} \navsection{#1}{\csname tmp:resettoclevels#1\endcsname} % define hierarchy also for starred sections \navsection{like#1}{\csname tmp:resettoclevels#1\endcsname} + % and for appendices + \ifcsdef{appendix:type:#1}{\navsection{\csuse{appendix:type:#1}}{\csname tmp:resettoclevels#1\endcsname}}{} } % define children levels for each sectioning level @@ -292,6 +298,14 @@ href="#1" media-type="\a:CoverMimeType" />}} \ifx\:temp\z@ro\else#1\fi } +% to create correct hiearchical NCX for appendices, we register corresponding appendix types +% for various section types +\def\appendix:type#1{\ifcsdef{appendix:type:#1}{\csuse{appendix:type:#1},}{}} +\def\def:appendix:type#1#2{\csdef{appendix:type:#1}{#2}} +\def:appendix:type{chapter}{appendix} +\def:appendix:type{section}{appendixsec} +\def:appendix:type{subsection}{appendixsubsec} +\def:appendix:type{subsubsection}{appendixsubsubsec} % \def\ncx:head{% @@ -312,7 +326,7 @@ href="#1" media-type="\a:CoverMimeType" />}} % define toc levels which should be included in the NCX file \NewConfigure{resettoclevels}{1} -\Configure{resettoclevels}{part,appendix,chapter,appendixsec,section,appendixsubsec,subsection,appendixsubsubsec,subsubsection,paragraph} +\Configure{resettoclevels}{part,chapter,section,subsection,subsubsection,paragraph} \def\:tempa{% \EndP @@ -369,6 +383,8 @@ href="#1" media-type="\a:CoverMimeType" />}} \def\print:opf:scheme#1{ opf:scheme="#1"} \def\:tempa{% +% French language definition makes the : character active, which can cause compilation error +\ifdefined\XeTeXcharclass\XeTeXcharclass `\: \z@\fi% \bgroup \setcounter{tocdepth}{3} % Basic sctructure of the opf file -- cgit v1.2.3