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

Michal Hoftich INVALID.NOREPLY at gnu.org.ua
Thu Aug 31 17:26:11 CEST 2023


Author: michal_h21
Date: 2023-08-31 15:26:11 +0000 (Thu, 31 Aug 2023)
New Revision: 1363

Modified:
   trunk/lit/ChangeLog
   trunk/lit/tex4ht-html4.tex
Log:
calculate padding for tcolobox boxes

Modified: trunk/lit/ChangeLog
===================================================================
--- trunk/lit/ChangeLog	2023-08-27 15:01:41 UTC (rev 1362)
+++ trunk/lit/ChangeLog	2023-08-31 15:26:11 UTC (rev 1363)
@@ -1,3 +1,9 @@
+2023-08-31  Michal Hoftich  <michal.h21 at gmail.com>
+
+	* tex4ht-html4.tex (html4.4ht): calculate padding for individual
+	Tcolorbox boxes.
+	https://tex.stackexchange.com/a/694862/2891
+
 2023-08-27  Karl Berry  <karl at freefriends.org>
 
 	* tex4ht-4ht.tex,

Modified: trunk/lit/tex4ht-html4.tex
===================================================================
--- trunk/lit/tex4ht-html4.tex	2023-08-27 15:01:41 UTC (rev 1362)
+++ trunk/lit/tex4ht-html4.tex	2023-08-31 15:26:11 UTC (rev 1363)
@@ -16500,11 +16500,21 @@
 
 
 \<configure html4 tcolorbox\><<<
+% support macro for correct calculation of padding in Tcolorbox
+\def\calc:tcbpadding#1{\strip at pt\dimexpr \kvtcb at boxsep+#1\relax px}
+
 \Configure{tcolorbox}
 {\ifvmode\IgnorePar\fi\EndP\HCode{<div class="tcolorbox \@currenvir" id="\:tcbcolid">} 
   % \tcbcolid and colors are defined in tcolorbox.4ht
   \Css{\#\:tcbcolid\space .tcolorbox-title{color: \:tcbcoltitle; background-color: \:tcbcolframe;}}
   \Css{\#\:tcbcolid\space .tcolorbox-content{color: \:tcbcolupper; background-color: \:tcbcolback; border: 1px solid \:tcbcolframe;}}
+  % calculate paddings
+  \Css{\#\:tcbcolid\space div{
+      padding-top:\calc:tcbpadding{\kvtcb at top};
+      padding-bottom:\calc:tcbpadding{\kvtcb at bottom};
+      padding-left:\calc:tcbpadding{\kvtcb at leftupper};
+      padding-right:\calc:tcbpadding{\kvtcb at rightupper};
+  }}
 }
 {\HCode{\Hnewline<div class="tcolorbox-title">}\par}
 {\ifvmode\IgnorePar\fi\EndP\HCode{</div>\Hnewline<div class="tcolorbox-content">}}



More information about the tex4ht-commits mailing list.