From 2ea2cee6498139387ba3c0815d105b4344c0fb50 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sat, 6 Nov 2021 03:01:01 +0000 Subject: CTAN sync 202111060300 --- support/tex4ebook/README | 2 +- support/tex4ebook/changelog.tex | 20 ++++++ support/tex4ebook/readme.tex | 2 +- support/tex4ebook/tex4ebook | 2 +- support/tex4ebook/tex4ebook-doc.pdf | Bin 84685 -> 85209 bytes support/tex4ebook/tex4ebook.4ht | 122 ++++++++++++++++++------------------ support/tex4ebook/tex4ebook.sty | 10 +++ 7 files changed, 94 insertions(+), 64 deletions(-) (limited to 'support/tex4ebook') diff --git a/support/tex4ebook/README b/support/tex4ebook/README index d19ca44e1b..8339341c51 100644 --- a/support/tex4ebook/README +++ b/support/tex4ebook/README @@ -86,7 +86,7 @@ For example: `-e,--build-file (default nil)` : Specify make4ht build file^[https://github.com/michal-h21/make4ht#build-file]. - Defaulf build file filename is `filename.mk4`, use this option if you use + Default build file filename is `filename.mk4`, use this option if you use different filename. `-f,--format (default epub)` diff --git a/support/tex4ebook/changelog.tex b/support/tex4ebook/changelog.tex index 8c9445b910..0e05776851 100644 --- a/support/tex4ebook/changelog.tex +++ b/support/tex4ebook/changelog.tex @@ -2,6 +2,26 @@ \section{Changes}\label{changes}} \begin{itemize} +\item + 2021/11/04 + + \begin{itemize} + \tightlist + \item + released version \texttt{0.3f} + \item + fixed spurious numbers in NCX TOC caused by wrong use of + \texttt{\textbackslash{}cs\_if\_exist\_use:cTF} command. + \end{itemize} +\item + 2021/10/08 + + \begin{itemize} + \tightlist + \item + fix for \texttt{\textbackslash{}author} support in \texttt{amsart} + class + \end{itemize} \item 2021/09/30 diff --git a/support/tex4ebook/readme.tex b/support/tex4ebook/readme.tex index 99853b4d39..52982d65c4 100644 --- a/support/tex4ebook/readme.tex +++ b/support/tex4ebook/readme.tex @@ -101,7 +101,7 @@ that this behaviour is default. \begin{description} \item[\texttt{-e,-\/-build-file\ (default\ nil)}] Specify make4ht build file\footnote{\url{https://github.com/michal-h21/make4ht\#build-file}}. -Defaulf build file filename is \texttt{filename.mk4}, use this option if +Default build file filename is \texttt{filename.mk4}, use this option if you use different filename. \item[\texttt{-f,-\/-format\ (default\ epub)}] Output format. Possible values are \texttt{epub}, \texttt{epub3}, diff --git a/support/tex4ebook/tex4ebook b/support/tex4ebook/tex4ebook index 5c6aca5546..9f4469e569 100755 --- a/support/tex4ebook/tex4ebook +++ b/support/tex4ebook/tex4ebook @@ -67,7 +67,7 @@ else end if args.version then - print "tex4ebook v0.3e" + print "tex4ebook v0.3f" return end diff --git a/support/tex4ebook/tex4ebook-doc.pdf b/support/tex4ebook/tex4ebook-doc.pdf index 62a87cd250..7c2c0a8e11 100644 Binary files a/support/tex4ebook/tex4ebook-doc.pdf and b/support/tex4ebook/tex4ebook-doc.pdf differ diff --git a/support/tex4ebook/tex4ebook.4ht b/support/tex4ebook/tex4ebook.4ht index 7cd6ca39fe..923cd8daa1 100644 --- a/support/tex4ebook/tex4ebook.4ht +++ b/support/tex4ebook/tex4ebook.4ht @@ -231,29 +231,29 @@ href="#1" media-type="\a:CoverMimeType" />}} % Support for: chapter, section, subsection \def\resettoclevels#1{% - \def\do##1{\csgdef{nav##1finish}{}} - \docsvlist{#1} + \def\do##1{\csgdef{nav##1finish}{}}% + \docsvlist{#1}% } \def\usetoclevels#1{% \def\do##1{\csuse{nav##1finish}}% \docsvlist{#1}% } \def\finishtoclevel#1{% - \csgdef{nav#1finish}{\d:NavSection} + \csgdef{nav#1finish}{\d:NavSection}% } -\def\closelevels#1{ - \expandafter\usetoclevels\expandafter{#1} - \expandafter\resettoclevels\expandafter{#1} -} +\def\closelevels#1{% + \expandafter\usetoclevels\expandafter{#1}% + \expandafter\resettoclevels\expandafter{#1}% +}% % 1 - section type 2 - closed sections -\def\navsection#1#2{ +\def\navsection#1#2{% \ConfigureToc{#1}% - {\expandafter\closelevels\expandafter{#2} - \def\curr:sect:type{#1}\a:NavSection\Ncx:Mark} - {\c:NavSection} - {} + {\expandafter\closelevels\expandafter{#2}% + \def\curr:sect:type{#1}\a:NavSection\Ncx:Mark}% + {\c:NavSection}% + {}% {\b:NavSection% \expandafter\finishtoclevel\expandafter{#1}% } @@ -261,20 +261,20 @@ href="#1" media-type="\a:CoverMimeType" />}} % define closing groups for all levels defined in \Configure{resettoclevels} -\def\tmp:processlevel#1{ - \bgroup - \csxdef{tmp:resettoclevels#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} +\def\tmp:processlevel#1{% + \bgroup% + \csxdef{tmp:resettoclevels#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}% } - \expandafter\tmp:parse\a:resettoclevels\nil - \egroup - \navsection{#1}{\csname tmp:resettoclevels#1\endcsname} + \expandafter\tmp:parse\a:resettoclevels\nil% + \egroup% + \navsection{#1}{\csname tmp:resettoclevels#1\endcsname}% % define hierarchy also for starred sections - \navsection{like#1}{\csname tmp:resettoclevels#1\endcsname} + \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}}{} + \ifcsdef{appendix:type:#1}{\navsection{\csuse{appendix:type:#1}}{\csname tmp:resettoclevels#1\endcsname}}{}% } % define children levels for each sectioning level @@ -289,9 +289,9 @@ href="#1" media-type="\a:CoverMimeType" />}} % so just strip then out % \TitleMark does similar thing, but this solution is simpler, I hope it works correctly \def\Ncx:Mark#1{% - \edef\:temp{#1} - \def\z@ro{0} - \ifx\:temp\z@ro\else#1\fi + \edef\:temp{#1}% + \def\z@ro{0}% + \ifx\:temp\z@ro\else#1\fi% } % to create correct hiearchical NCX for appendices, we register corresponding appendix types @@ -305,16 +305,16 @@ href="#1" media-type="\a:CoverMimeType" />}} % \def\ncx:head{% -\HCode{\Hnewline} -\HCode{\Hnewline} -\HCode{\Hnewline} -\HCode{\Hnewline} -\HCode{\Hnewline} -\HCode{\Hnewline} +\HCode{\Hnewline}% +\HCode{\Hnewline}% +\HCode{\Hnewline}% +\HCode{\Hnewline}% +\HCode{\Hnewline}% +\HCode{\Hnewline}% } \def\ncx:title{% - \HCode{\Hnewline}\Title\HCode{\Hnewline\Hnewline} + \HCode{\Hnewline}\Title\HCode{\Hnewline\Hnewline}% } % Get filename from tableofcontents anchor @@ -326,16 +326,16 @@ href="#1" media-type="\a:CoverMimeType" />}} % the first number. we use the LaTeX 3 sequence list to get it. \tl_new:N\ncx:hfilename \def\ncx:newhfile#1{ - \cs_if_exist_use:cTF{cw:)Q#1}{% + \cs_if_exist:cTF{cw:)Q#1}{% % cw:)Q#1 is csname of tag from the xref file. we convert it to sequence - \seq_set_from_clist:Nc\l_tmpa_seq{cw:)Q#1} + \seq_set_from_clist:Nc\l_tmpa_seq{cw:)Q#1}% % get first item and put it to a token list - \seq_get_left:NN \l_tmpa_seq \l_tmpa_tl + \seq_get_left:NN \l_tmpa_seq \l_tmpa_tl% % \RefFileNumber returns file name for the given file number % \ncx:hfilename contains the filename for later use - \tl_set:Nx \ncx:hfilename {\RefFileNumber{\l_tmpa_tl}} - }{% - \tl_set:Nn \ncx:hfilename {nic} + \tl_set:Nx \ncx:hfilename {\RefFileNumber{\l_tmpa_tl}}% + }{% This shouldn't happen? + \tl_set:Nn \ncx:hfilename {}% } } \ExplSyntaxOff @@ -345,35 +345,35 @@ href="#1" media-type="\a:CoverMimeType" />}} \Configure{resettoclevels}{part,chapter,section,subsection,subsubsection,paragraph} \def\:tempa{% -\EndP -\HtmlParOff -\setcounter{tocdepth}{3} -\special{t4ht>\jobname.ncx} +\EndP% +\HtmlParOff% +\setcounter{tocdepth}{3}% +\special{t4ht>\jobname.ncx}% % We don't want crosslinks in xml % Basic sctructure of the ncx file -\NoFonts -{\HCode{\Hnewline}} -{\a:NcxDoctype} -{\Tg}{} +\NoFonts% +{\HCode{\Hnewline}}% +{\a:NcxDoctype}% +{\Tg}{}% % To print document map, we customize the tableofcontents. We don't want TOC title, % so: -\let\contentsname=\empty +\let\contentsname=\empty% \Configure{tableofcontents}{\boolfalse{tocnoempty}\Tg}{% \usetoclevels{part,appendix,chapter,likechapter,appendixsec,section,likesection,subsection,appendixsubsec,likesubsection,subsubsection,likesubsubsection,appendixsubsubsec,subsubsubsection,paragraph}% \ifbool{tocnoempty}{}% - {\HCode{ - Document - + {\HCode{% + Document% + % }}% - \Tg}{}{}{} + \Tg}{}{}{}0 % We need to configure TocLink % in navmapsrc is link to the file and anchor, where chapter or section is located - \def\navmapsrc{} + \def\navmapsrc{}% \Configure{TocLink}{% - \ncx:newhfile{##2} - \def\navmapsrc{\ncx:hfilename\:sharp ##2} - \opf:registerfilename{\ncx:hfilename} - ##4 + \ncx:newhfile{##2}% + \def\navmapsrc{\ncx:hfilename\:sharp ##2}% + \opf:registerfilename{\ncx:hfilename}% + ##4% } % Configuraion of entries \expandafter\resettoclevels\expandafter{\a:resettoclevels}% @@ -386,14 +386,14 @@ href="#1" media-type="\a:CoverMimeType" />}} }{\HCode{\Hnewline% \Hnewline}% \HCode{}% -}{\HCode{}}{\HCode{\Hnewline}} +}{\HCode{}}{\HCode{\Hnewline}}% % Meta inf -\ncx:head +\ncx:head% % Book title -\ncx:title +\ncx:title% \tableofcontents[part,appendix,chapter,likechapter,appendixsec,section,likesection,appendixsubsec,subsection,likesubsection]% %Hack to get close tag working -\HCode{} +\HCode{}% \EndNoFonts \special{t4ht<\jobname.ncx} \HtmlParOn diff --git a/support/tex4ebook/tex4ebook.sty b/support/tex4ebook/tex4ebook.sty index 4d8cb1db09..3ce94dd203 100644 --- a/support/tex4ebook/tex4ebook.sty +++ b/support/tex4ebook/tex4ebook.sty @@ -166,4 +166,14 @@ } %} + +% Fixes for AMS classess +\AddToHook{class/after}{% + \ifx\authors\@empty% + \def\@maketitle@hook{ + \global\let\Author\authors + } + \fi% +} + \newcommand\coverimage[2][]{\includegraphics[#1]{#2}} -- cgit v1.2.3