summaryrefslogtreecommitdiff
path: root/support/TeX4ht
diff options
context:
space:
mode:
Diffstat (limited to 'support/TeX4ht')
-rw-r--r--support/TeX4ht/source/ChangeLog9
-rw-r--r--support/TeX4ht/source/mktex4ht-cnf.tex3
-rw-r--r--support/TeX4ht/source/tex4ht-4ht.tex44
-rw-r--r--support/TeX4ht/source/tex4ht-html4.tex16
-rw-r--r--support/TeX4ht/source/tex4ht-mathjax.tex5
5 files changed, 72 insertions, 5 deletions
diff --git a/support/TeX4ht/source/ChangeLog b/support/TeX4ht/source/ChangeLog
index adb567263a..096e58db31 100644
--- a/support/TeX4ht/source/ChangeLog
+++ b/support/TeX4ht/source/ChangeLog
@@ -1,3 +1,12 @@
+2024-02-13 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-4ht.tex (chemfig.4ht),
+ * tex4ht-html4.tex (html4.4ht): added support for the the \chemname
+ command from Chemfig package.
+
+ * tex4ht-mathjax.tex (mathjax-latex-4ht.4ht): fixed handling of the
+ \ce command used inside pictures.
+
2024-02-07 Michal Hoftich <michal.h21@gmail.com>
* tex4ht-4ht.tex (mhchem.4ht),
diff --git a/support/TeX4ht/source/mktex4ht-cnf.tex b/support/TeX4ht/source/mktex4ht-cnf.tex
index b13850c6c9..13b9e3dee4 100644
--- a/support/TeX4ht/source/mktex4ht-cnf.tex
+++ b/support/TeX4ht/source/mktex4ht-cnf.tex
@@ -1,4 +1,4 @@
-% $Id: mktex4ht-cnf.tex 1448 2024-01-22 11:15:28Z michal_h21 $
+% $Id: mktex4ht-cnf.tex 1461 2024-02-13 15:20:24Z michal_h21 $
% Manually-maintained file, listing *.4ht files created by tex4ht-4ht.tex.
% Read by tex4ht-cond4ht.
%
@@ -404,4 +404,5 @@
\AddFile{9}{embedfile}
\AddFile{9}{fontawesome5}
\AddFile{9}{mhchem}
+\AddFile{9}{chemfig}
% \AddFile{9}{mktex4ht}
diff --git a/support/TeX4ht/source/tex4ht-4ht.tex b/support/TeX4ht/source/tex4ht-4ht.tex
index d18a1123c8..b48cac55f5 100644
--- a/support/TeX4ht/source/tex4ht-4ht.tex
+++ b/support/TeX4ht/source/tex4ht-4ht.tex
@@ -1,4 +1,4 @@
-% $Id: tex4ht-4ht.tex 1459 2024-02-07 13:33:10Z michal_h21 $
+% $Id: tex4ht-4ht.tex 1461 2024-02-13 15:20:24Z michal_h21 $
% tex tex4ht-4ht or ht tex tex4ht-4ht
%
% Copyright 2009-2024 TeX Users Group
@@ -31030,6 +31030,48 @@ it come out as a complete mess.
>>>
+%%%%%%%%%%%%%%%
+\Section{Chemfig}
+%%%%%%%%%%%%%%%
+
+\<chemfig.4ht\><<<
+% chemfig.4ht (|version), generated from |jobname.tex
+% Copyright 2024 TeX Users Group
+|<TeX4ht license text|>
+|<chemfig redefinitions|>
+
+\Hinput{chemfig}
+\endinput
+>>> \AddFile{9}{chemfig}
+
+The chemname command should print label under chemical diagram, so we need to
+envelop both of these elements in hooks, to handle this structure in the configuration
+for output formats.
+
+\<chemfig redefinitions\><<<
+\ExplSyntaxOn
+\NewConfigure{chemname}{3}
+\def\:tempa[#1]#2#3{%
+ \setbox\CF_boxstuff\hbox{#2}%
+ \edef\CF_wdstuffbox{\the\wd\CF_boxstuff}\edef\CF_dpstuffbox{\the\dp\CF_boxstuff}%
+ \leavevmode
+ \ifdim\CF_dpmax<\CF_dpstuffbox
+ \ifboolKV[chemfig]{gchemname}\global{}\let\CF_dpmax\CF_dpstuffbox
+ \fi
+ \a:chemname
+ \vtop{%
+ \box\CF_boxstuff
+ \nointerlineskip
+ \kern\dimexpr#1\ifCF_adjust_name_dp+\CF_dpmax-\CF_dpstuffbox\fi\relax
+ \b:chemname
+ \CF_parsemolname#3\\\_nil
+ }%
+ \c:chemname
+}
+\HLet\CF_chemnameb\:tempa
+\ExplSyntaxOff
+>>>
+
%%%%%%%%%%%%%
\Section{Ushort}
%%%%%%%%%%%%%
diff --git a/support/TeX4ht/source/tex4ht-html4.tex b/support/TeX4ht/source/tex4ht-html4.tex
index b11bd85bd8..e09bb507b2 100644
--- a/support/TeX4ht/source/tex4ht-html4.tex
+++ b/support/TeX4ht/source/tex4ht-html4.tex
@@ -1,4 +1,4 @@
-% $Id: tex4ht-html4.tex 1459 2024-02-07 13:33:10Z michal_h21 $
+% $Id: tex4ht-html4.tex 1461 2024-02-13 15:20:24Z michal_h21 $
% Compile 4 times: latex tex4ht-html4
% Copy html4.4ht into the work directory before all but the last compilation.
%
@@ -21800,6 +21800,20 @@ users redefine the latter macro.
>>>
%%%%%%%%%%%%%%%%%%%%%%
+\section{chemfig}
+%%%%%%%%%%%%%%%%%%%%%%
+
+Display chemname as two inline rows
+
+\<configure html4 chemfig\><<<
+\Configure{chemname}{\ifvmode\IgnorePar\fi\EndP\HCode{<span class="chemname"><span class="chemnametop">}\IgnorePar}
+{\HCode{</span><span class="chemnamebot">}}{\HCode{</span></span>}}
+
+\Css{.chemname {display: inline-grid; text-align:center;}}
+\Css{.chemnamebot{font-size: 0.8rem;}}
+>>>
+
+%%%%%%%%%%%%%%%%%%%%%%
\section{transparent}
%%%%%%%%%%%%%%%%%%%%%%
diff --git a/support/TeX4ht/source/tex4ht-mathjax.tex b/support/TeX4ht/source/tex4ht-mathjax.tex
index a02f8d1c54..24c0ec87ae 100644
--- a/support/TeX4ht/source/tex4ht-mathjax.tex
+++ b/support/TeX4ht/source/tex4ht-mathjax.tex
@@ -1,4 +1,4 @@
-% $Id: tex4ht-mathjax.tex 1382 2023-10-12 12:52:53Z michal_h21 $
+% $Id: tex4ht-mathjax.tex 1460 2024-02-13 13:55:59Z michal_h21 $
% compile: latex tex4ht-mathjax
%
% Copyright 2018-2023 TeX Users Group
@@ -271,7 +271,8 @@ Fixes for tables of contents.
\<mhchem configurations\><<<
\@ifpackageloaded{mhchem}{%
-\def\ce#1{\texttt{\detokenize{\(\ce{#1}\)}}}
+\def\:tempa#1{\texttt{\detokenize{\(\ce{#1}\)}}}
+\HLet\ce\:tempa
}{}
>>>