[tex4ht-commits] [SCM] tex4ht updated: r470 - trunk/lit

michal_h21 at gnu.org.ua michal_h21 at gnu.org.ua
Thu Dec 27 21:43:48 CET 2018


Author: michal_h21
Date: 2018-12-27 22:43:48 +0200 (Thu, 27 Dec 2018)
New Revision: 470

Modified:
   trunk/lit/ChangeLog
   trunk/lit/Makefile
   trunk/lit/mktex4ht-cnf.tex
   trunk/lit/tex4ht-4ht.tex
Log:
Added basic support for the tabu package

Modified: trunk/lit/ChangeLog
===================================================================
--- trunk/lit/ChangeLog	2018-12-27 20:23:16 UTC (rev 469)
+++ trunk/lit/ChangeLog	2018-12-27 20:43:48 UTC (rev 470)
@@ -4,6 +4,7 @@
 	svg-option.4ht due to name conflict with svg.sty.
 	* tex4ht-options.tex (tex4ht.4ht): use svg-option.4ht instead of svg.4ht.
 	* tex4ht-4ht.tex (svg.4ht): added basic support for the svg.sty package.
+	* tex4ht-4ht.tex (tabu.4ht): added basic support for the tabu package.
 
 2018-12-20  Michal Hoftich  <michal.h21 at gmail.com>
 

Modified: trunk/lit/Makefile
===================================================================
--- trunk/lit/Makefile	2018-12-27 20:23:16 UTC (rev 469)
+++ trunk/lit/Makefile	2018-12-27 20:43:48 UTC (rev 470)
@@ -57,7 +57,7 @@
   reading.4ht \
   scrartcl.4ht scrbook.4ht scrreprt.4ht sectionbreak.4ht \
 	skak.4ht spanish.4ht subscript.4ht svg.4ht \
-  titlesec.4ht tocloft.4ht tuenc-luatex.4ht tuenc-xetex.4ht \
+  tabu.4ht titlesec.4ht tocloft.4ht tuenc-luatex.4ht tuenc-xetex.4ht \
   usepackage.4ht usepackage-fontspec.4ht \
   wrapfig.4ht \
   xcolor.4ht xr.4ht xr-hyper.4ht 

Modified: trunk/lit/mktex4ht-cnf.tex
===================================================================
--- trunk/lit/mktex4ht-cnf.tex	2018-12-27 20:23:16 UTC (rev 469)
+++ trunk/lit/mktex4ht-cnf.tex	2018-12-27 20:43:48 UTC (rev 470)
@@ -46,6 +46,7 @@
 \AddFile{8}{tabulary}
 \AddFile{8}{tabulary-a}
 \AddFile{7}{tabularx}
+\AddFile{9}{tabu}
 \AddFile{9}{mdwtab}
 \AddFile{9}{multirow}
 \AddFile{8}{theorem}

Modified: trunk/lit/tex4ht-4ht.tex
===================================================================
--- trunk/lit/tex4ht-4ht.tex	2018-12-27 20:23:16 UTC (rev 469)
+++ trunk/lit/tex4ht-4ht.tex	2018-12-27 20:43:48 UTC (rev 470)
@@ -9503,6 +9503,71 @@
 >>>        \AddFile{7}{tabularx}
 
 %%%%%%%%%%%%%%%%%%%%%%%%
+\Section{Tabu}
+%%%%%%%%%%%%%%%%%%%%%%%%
+
+Some details are \Link[https://tex.stackexchange.com/a/467126/2891]{}{here}\EndLink. I was
+not able to fix all tabu issues, it is too aggressive in basic table handling. Michal
+
+\<tabu.4ht\><<< 
+% sample.4ht (|version), generated from |jobname.tex 
+% Copyright 2017 TeX Users Group 
+|<TeX4ht license text|> 
+|<tabu config|>
+\Hinput{tabu} 
+\endinput
+>>> \AddFile{9}{tabu}
+
+\<tabu config\><<<
+% we must suppress \everyrow redefintion by tabu, so some macro patching is necessary
+\def\tabu at AtBeginDocument{
+\ifdefined\CT at arc@ \else \let\CT at arc@  \relax \fi
+\ifdefined\CT at drsc@\else \let\CT at drsc@ \relax \fi
+ \let\tabu at arc@L \CT at arc@ \let\tabu at drsc@L \CT at drsc@
+% \everyrow{}%
+}
+
+\let\orig:hline\hline
+\def\tabu at firstline{\orig:hline}
+\def\tabu at firsthline{\orig:hline}
+\def\tabu at lastline  {\orig:hline}
+\def\tabu at lasthline {\orig:hline}
+% there is a clash between tabu and tex4ht on \hline handling
+% we will just use \cr in place of \hline
+\def\tabu at hline {\cr}% \tabu at hline
+
+% this is basically a rewrite of the \tabu at select macro
+% the original code just crashed everything
+\def\tabu at select {%
+        \expandafter \tabuthepreamble
+}% \tabu at select
+
+
+\def\tabu at setup{\tabu at alloc@
+    \ifcase \tabu at nested
+        \ifmmode \else \iftabu at spread\else \ifdim\tabu at target=\z@
+            \let\tabu at afterendpar \par
+        \fi\fi\fi
+        \def\tabu at aligndefault{c}
+        \tabu at init 
+        \tabu at indent
+    \else       % <nested tabu>
+        \def\tabu at aligndefault{t}
+        \let\tabudefaulttarget \linewidth
+    \fi
+    \let\tabu at thetarget \tabudefaulttarget \let\tabu at restored \@undefined
+    \edef\tabu at NC@list{\the\NC at list}\NC at list{\NC at do \tabu at rewritefirst}%
+    %\everycr{} % don't let tabu redefine \everycr
+   \let\@startpbox \tabu at startpbox % for nested tabu inside longtabu...
+             \let\@endpbox   \tabu at endpbox   % idem "    "    "    "    "    "
+             \let\@tabarray  \tabu at tabarray  % idem "    "    "    "    "    "
+    \tabu at setcleanup 
+    % \tabu at setreset % this causes issues
+}% \tabu at setup
+>>>
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%
 \Section{mdwtab}
 %%%%%%%%%%%%%%%%%%%%%%%%
 



More information about the tex4ht-commits mailing list