From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- support/tex4ebook/tex4ebook-epub3.4ht | 115 ++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 support/tex4ebook/tex4ebook-epub3.4ht (limited to 'support/tex4ebook/tex4ebook-epub3.4ht') diff --git a/support/tex4ebook/tex4ebook-epub3.4ht b/support/tex4ebook/tex4ebook-epub3.4ht new file mode 100644 index 0000000000..b30e1c3ef1 --- /dev/null +++ b/support/tex4ebook/tex4ebook-epub3.4ht @@ -0,0 +1,115 @@ +%\typeout{!!!!!!!!!!!!!!!!!!!!!!!!!!!epub3!!!!!!!!!!!!} +\Configure{NcxDoctype}{} +\Configure{VERSION}{} + +% we must remove attributes from opf namespace +\def\print:opf:scheme#1{} +\Configure{OpfScheme}{} + +\Configure{OpfMetadata}{\HCode{}\:iso:date\HCode{}} + +%%%%%%%%%%%%%%%%%%%%%%% +%% Configure toc nav %% +%%%%%%%%%%%%%%%%%%%%%%% +\Configure{tableofcontents}{ + \a:NavMap + \resettoclevels{part,chapter,section,subsection,subsubsection} + \navsection{part}{part,chapter,section,subsection,subsubsection} + \navsection{chapter}{chapter,section,subsection,subsubsection} + \navsection{section}{section,subsection,subsubsection} + \navsection{subsection}{subsection,subsubsection} + \navsection{subsubsection}{subsubsection} + %\HtmlParOff + \Configure{toTocLink}{}{} +}{\b:NavMap}{}{}{} +%%%%%%%%%%% +\Configure{NavMap}{\ifvmode\IgnorePar\fi\EndP\boolfalse{tocnoempty}\HCode{}} +%%%%%%%%%%% +\Configure{NavSection}{% + \booltrue{tocnoempty} + \HCode{
  • }}{\HCode{
      \Hnewline}}{}{\Tg
    \Tg
  • } +% Disable numbering of the TOC by the reading system, numbers are added by tex4ht +\Css{nav\#toc ol{list-style: none;}} +%%%% End toc nav configuration +\def\CoverMetadata#1{% +\special{t4ht+@File: #1}% +\Configure{OpfManifest}{\HCode{}}% +} +%\Configure{CoverImage}{% +% \HPage{}% +% \Configure{OpfManifest}{\HCode{}}% + %\box0=\hbox\bgroup +% \ifvmode \IgnorePar\fi \EndP% +% \HCode{
    \Hnewline}} +%} +% {%\ifvmode \IgnorePar\fi \EndP% + %\HCode{
    \Hnewline}% + %\EndHPage{} + %\egroup +%} +%\:CheckOption{mathml} +%\if:Option +\apptocmd{\a:DviMath}{\opf:add:property{mathml}}{}{}% +%\fi +\Configure{DOCTYPE}{\HCode{\Hnewline}} +\Configure{xmlns}{}{http://www.w3.org/1999/xhtml} +\Configure{xmlns}{epub}{http://www.idpf.org/2007/ops} +%\Configure{xmlns}{m}{http://www.w3.org/1998/Math/MathML} +%\Configure{HTML}{\HCode{\Hnewline}}{\HCode{\Hnewline}} +\Configure{HTML}{\HCode{\Hnewline}}{\HCode{\Hnewline}} +\Configure{@HEAD}{} +\Configure{@HEAD}{\HCode{\Hnewline}} +\Configure{@HEAD}{\HCode{\Hnewline}} +\Configure{@HEAD}{\HCode{\Hnewline}} +\Configure{EpubVersion}{3.0} +\Configure{OpfItemProperties}{properties="}{"} + +% Structural elements + +% Foootnote configuration for epub3 +% Footnotes are printed directly after the paragraph they appeared in +% footnotebox - configure box in which footnotes are printed +% default configuration doesn't work in ibooks, don't know why +\NewConfigure{footnotebox}{2} +\Configure{footnotebox}{\HCode{
    \Hnewline}} +{\HCode{\Hnewline
    \Hnewline}} +\newbox\footnotebox +% We must create new link command, so footnote mark can link to footnote text +\LinkCommand\fnlink{aside,href,id,class="footnote" epub:type="footnote"} +\Configure{footnotemark}{\NoFonts\Link[ epub:type="noteref"]{fn\FNnum x\minipageNum}{}}{\EndLink\EndNoFonts} +\Configure{footnotetext}{\global\setbox\footnotebox=\vtop\bgroup\NoFonts% + \ifvoid\footnotebox\else\unvbox\footnotebox\fi% + \IgnorePar% + \bgroup% + \fnlink{}{fn\FNnum x\minipageNum}\Tg

    % +}{\EndNoFonts} +{% + \HCode{

    \Hnewline} + \Endfnlink\egroup\egroup}% + +\def\printfn{% + \ifvoid\footnotebox\else% + \a:footnotebox% + \box\footnotebox% + \b:footnotebox% + \fi% +} + +% configure HtmlPar to print footnotebox. +\Configure{HtmlPar} +{\EndP\HCode{

    }} +{\EndP\HCode{

    }} +{\HCode{

    \Hnewline}\printfn} +{\HCode{

    \Hnewline}\printfn} + +\Css{.footnote{font-size:small;}} +\Css{.footnotes hr{width:30\%;margin:0 auto 0 0;}} -- cgit v1.2.3