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

michal_h21 at gnu.org.ua michal_h21 at gnu.org.ua
Fri Mar 15 15:54:03 CET 2019


Author: michal_h21
Date: 2019-03-15 16:54:03 +0200 (Fri, 15 Mar 2019)
New Revision: 536

Modified:
   trunk/lit/ChangeLog
   trunk/lit/tex4ht-html5.tex
Log:
Use semantic elements for figures, floats and captions

Modified: trunk/lit/ChangeLog
===================================================================
--- trunk/lit/ChangeLog	2019-03-14 20:48:11 UTC (rev 535)
+++ trunk/lit/ChangeLog	2019-03-15 14:54:03 UTC (rev 536)
@@ -1,3 +1,8 @@
+2019-03-15  Michal Hoftich  <michal.h21 at gmail.com>
+
+	* tex4ht-html5.tex(html5.4ht): use semantic elements for floats, figures and
+	captions.
+
 2019-03-14  Michal Hoftich  <michal.h21 at gmail.com>
 
 	* tex4ht-ooffice.tex (ooffice.4ht): fixed image filename parsers.

Modified: trunk/lit/tex4ht-html5.tex
===================================================================
--- trunk/lit/tex4ht-html5.tex	2019-03-14 20:48:11 UTC (rev 535)
+++ trunk/lit/tex4ht-html5.tex	2019-03-15 14:54:03 UTC (rev 536)
@@ -203,11 +203,49 @@
 }
 >>>
 
+\section{LaTeX}
 
 \<configure html5 latex\><<<
 |<tabular fixes|>
 >>>
 
+\section{Article, book and report classes}
+\<configure html5 article\><<<
+|<article,report,book|>
+>>>
+
+\<configure html5 book\><<<
+|<article,report,book|>
+>>>
+
+\<configure html5 report\><<<
+|<article,report,book|>
+>>>
+
+Shared configurations for base LaTeX classes.
+
+\<article,report,book\><<<
+|<figcaption|>
+>>>
+
+\section{Configurations for Koma Script}
+
+\<configure html5 scrartcl\><<<
+|<scr article,report,book|>
+>>>
+
+\<configure html5 scrbook\><<<
+|<scr article,report,book|>
+>>>
+
+\<configure html5 scrreprt\><<<
+|<scr article,report,book|>
+>>>
+
+\<scr article,report,book\><<<
+|<figcaption|>
+>>>
+
 cellspacing and cellpading attributes are prohibited in html5
 
 \<tabular fixes\><<<
@@ -216,5 +254,41 @@
 \Css{table.tabular{border-collapse: collapse; border-spacing: 0;}}
 >>>
 
+Configure HTML5 figures. Floats are converted as captions too.
 
+\<figcaption\><<<
+\Configure{float}
+   {\ifOption{refcaption}{}{\csname par\endcsname\ShowPar \leavevmode}}
+     {\:xhtml{\IgnorePar\EndP}\HCode{<figure class="float"\Hnewline>}}
+   {\ifvmode \IgnorePar \fi\EndP
+     \HCode{</figure>}\csname par\endcsname\ShowPar}
+
+\ConfigureEnv{figure}
+{\:xhtml{\IgnorePar\EndP}\HCode{<figure class="figure">\Hnewline}%
+    \bgroup \Configure{float}{\ShowPar}{}{}%    
+   }
+   {\egroup
+   \:xhtml{\IgnorePar\EndP}\HCode{</figure>}|<try env inline par|>\par}
+   {}{}
+
+\Css{figure.float, div.figure {margin-left: auto; margin-right: auto;}}
+\Css{figure.float img {text-align:center;}}
+\Css{figure.figure img {text-align:center;}}
+\Css{figure.figure > p {text-align:center;}}
+
+\Configure{caption}{\:xhtml{\IgnorePar\EndP}\HCode{<figcaption class="caption" ><span class="id">}}
+   {:} {\HCode{</span><span \Hnewline class="content">}}
+   {\HCode{</span></figcaption>}\HCode{<!--tex4ht:label?:
+   \cur:th\:currentlabel\space-->}%
+}
+\Css{figcaption.caption {text-indent:-2em; margin-left:3em; margin-right:1em;
+                  text-align:center;}}
+\Css{figcaption.caption span.id{font-weight: bold; white-space: nowrap; }}
+>>>
+
+\section{Utilities}
+\<try env inline par\><<<
+\ShowPar 
+>>>
+
 \endinput



More information about the tex4ht-commits mailing list