summaryrefslogtreecommitdiff
path: root/support/tex4ebook/tex4ebook.4ht
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-11-02 03:01:48 +0000
committerNorbert Preining <norbert@preining.info>2019-11-02 03:01:48 +0000
commit3479a92321ed7fe7e2133d3daec2d4f5fd53fbc6 (patch)
treef81c77e1742124279f68e41484d9e53ad40248ff /support/tex4ebook/tex4ebook.4ht
parent61b8d58232b999b6cc966aee9152fb86bbb759cd (diff)
CTAN sync 201911020301
Diffstat (limited to 'support/tex4ebook/tex4ebook.4ht')
-rw-r--r--support/tex4ebook/tex4ebook.4ht20
1 files changed, 18 insertions, 2 deletions
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