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

michal_h21 at gnu.org.ua michal_h21 at gnu.org.ua
Mon May 20 15:18:21 CEST 2019


Author: michal_h21
Date: 2019-05-20 16:18:20 +0300 (Mon, 20 May 2019)
New Revision: 566

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

Modified: trunk/lit/ChangeLog
===================================================================
--- trunk/lit/ChangeLog	2019-05-16 20:56:58 UTC (rev 565)
+++ trunk/lit/ChangeLog	2019-05-20 13:18:20 UTC (rev 566)
@@ -1,3 +1,8 @@
+2019-05-20  Michal Hoftich  <michal.h21 at gmail.com>
+
+	* tex4ht-4ht.tex(adjustbox.4ht),
+	tex4ht-html4.tex (html4.4ht): added support for the adjustbox package.
+
 2019-05-14  Michal Hoftich  <michal.h21 at gmail.com>
 
 	* tex4ht-mathjax.tex (mathjax-latex-4ht.4ht): redefine the 

Modified: trunk/lit/Makefile
===================================================================
--- trunk/lit/Makefile	2019-05-16 20:56:58 UTC (rev 565)
+++ trunk/lit/Makefile	2019-05-20 13:18:20 UTC (rev 566)
@@ -42,7 +42,7 @@
 tex4ht_cond4ht_derived = cond4ht.4ht mktex4ht.4ht
 derived += $(tex4ht_4ht_derived)
 tex4ht_4ht_derived = \
-  algorithmic.4ht amsmath.4ht animate.4ht authblk.4ht \
+  adjustbox.4ht algorithmic.4ht amsmath.4ht animate.4ht authblk.4ht \
   biblatex.4ht biblatex-chicago.4ht book.4ht \
   caption.4ht cleveref.4ht color.4ht colortbl.4ht \
   fontspec.4ht fontspec-4ht.lua fontspec-luatex.4ht fontspec-xetex.4ht \

Modified: trunk/lit/mktex4ht-cnf.tex
===================================================================
--- trunk/lit/mktex4ht-cnf.tex	2019-05-16 20:56:58 UTC (rev 565)
+++ trunk/lit/mktex4ht-cnf.tex	2019-05-20 13:18:20 UTC (rev 566)
@@ -260,6 +260,7 @@
 \AddFile{9}{floatflt}
 \AddFile{9}{floatpag}
 \AddFile{7}{fancybox}
+\AddFile{7}{adjustbox}
 \AddFile{7}{alltt}
 \AddFile{9}{lb}
 \AddFile{7}{latin1}

Modified: trunk/lit/tex4ht-4ht.tex
===================================================================
--- trunk/lit/tex4ht-4ht.tex	2019-05-16 20:56:58 UTC (rev 565)
+++ trunk/lit/tex4ht-4ht.tex	2019-05-20 13:18:20 UTC (rev 566)
@@ -29682,6 +29682,53 @@
 >>>
 
 %%%%%%%%%%%%%%%%%%%%%%%
+\Section{adjustbox.sty}
+%%%%%%%%%%%%%%%%%%%%%%%
+
+\<adjustbox.4ht\><<<
+% adjustbox.4ht (|version), generated from |jobname.tex
+% Copyright 2019 TeX Users Group
+|<TeX4ht license text|>
+\NewConfigure{AdjustboxValignTop}{1}
+\NewConfigure{AdjustboxValignMiddle}{1}
+\NewConfigure{AdjustboxValignCenter}{1}
+\NewConfigure{AdjustboxValignBottom}{1}
+\pend:def\adjbox at valign@t{\a:AdjustboxValignTop}
+\pend:def\adjbox at valign@t{\a:AdjustboxValignTop}
+\pend:def\adjbox at valign@T{\a:AdjustboxValignTop}
+\pend:def\adjbox at valign@M{\a:AdjustboxValignMiddle}
+\pend:def\adjbox at valign@m{\a:AdjustboxValignMiddle}
+\pend:defI\adjbox at valign@c{\a:AdjustboxValignCenter}
+\pend:def\adjbox at valign@b{\a:AdjustboxValignBottom}
+\pend:def\adjbox at valign@B{\a:AdjustboxValignBottom}
+
+% make an unique ID for each adjustbox environment
+\newcounter{adjustbox at 4ht}
+\def\update:adjustbox:id{\stepcounter{adjustbox at 4ht}\def\AdjustboxId{adjustbox-\arabic{adjustbox at 4ht}}}
+
+\NewConfigure{Adjustbox}{2}
+\def\:tempa#1#2#3#4{\update:adjustbox:id\a:Adjustbox\o:adjbox@@frame:{#1}{#2}{#3}{#4}\b:Adjustbox}
+\HLet\adjbox@@frame\:tempa
+
+% suppress trying to draw the frame
+\def\adjbox at boxframe#1#2#3{}
+
+% we should redefine all adjustbox environments, they may produce unvanted artifacts, math mode, etc.
+% keys are set, so it should be possible to extract  colors or frame size in theory
+% I just haven't found a working solution yet
+\renewenvironment{adjustbox}[1]{\update:adjustbox:id\adjbox at setkeys{#1}\a:Adjustbox}{\b:Adjustbox}
+
+% definitions for macros
+% we don't save any colors and just use one configuration for all box types.  
+\def\@bgcolorbox#1{\update:adjustbox:id\a:Adjustbox\BOXCONTENT\b:Adjustbox}
+\def\@foregroundbox#1#2#3{\update:adjustbox:id\leavevmode\a:Adjustbox\BOXCONTENT\b:Adjustbox}
+\def\@backgroundbox#1#2#3{\update:adjustbox:id\leavevmode\a:Adjustbox\BOXCONTENT\b:Adjustbox}
+
+\Hinput{adjustbox}
+\endinput
+>>> \AddFile{7}{adjustbox}
+
+%%%%%%%%%%%%%%%%%%%%%%%
 \Section{alltt.sty}
 %%%%%%%%%%%%%%%%%%%%%%%
 

Modified: trunk/lit/tex4ht-html4.tex
===================================================================
--- trunk/lit/tex4ht-html4.tex	2019-05-16 20:56:58 UTC (rev 565)
+++ trunk/lit/tex4ht-html4.tex	2019-05-20 13:18:20 UTC (rev 566)
@@ -15356,8 +15356,26 @@
    {\HCode{</td>}}
 >>>
 
+%%%%%%%%%%%%%%%%%%
+\subsection{adjustbox}
+%%%%%%%%%%%%%%%%%%
 
+\<configure html4 adjustbox\><<<
+% add support for vertical alignment of table rows
+\Configure{halignTR}{}
+\Configure{AdjustboxValignTop}{\Css{\#TBL-\TableNo-\HRow-{vertical-align:top;}}}
+\Configure{AdjustboxValignMiddle}{\Css{\#TBL-\TableNo-\HRow-{vertical-align:middle;}}}
+\Configure{AdjustboxValignCenter}{\Css{\#TBL-\TableNo-\HRow-{vertical-align:middle;}}}
+\Configure{AdjustboxValignBottom}{\Css{\#TBL-\TableNo-\HRow-{vertical-align:bottom;}}}
+% convert size in pt to em, based on the current font size
+\def\pt:to:em#1{\strip at pt\dimexpr#1/\f at size em}
+\Configure{Adjustbox}
+{\IgnorePar\EndP\IgnorePar\HCode{<div class="adjustbox" id="\AdjustboxId">}}
+{\Css{\#\AdjustboxId{border: \pt:to:em{\fboxrule} solid black;padding: \pt:to:em{\fboxsep};}}%
+\ifvmode\IgnorePar\fi\EndP\HCode{</div>}}
+>>>
 
+
 %%%%%%%%%%%%%%%%%%%
 \subsection{boxedminipage}
 %%%%%%%%%%%%%%%%%%%



More information about the tex4ht-commits mailing list