From 263eb74afee76ef6df67e7c693d5fcd301baf83e Mon Sep 17 00:00:00 2001 From: Cedric Date: Mon, 20 Jan 2025 20:47:59 +0000 Subject: [PATCH] Fix the chemical equation. All credits due to @michal-h21 https://github.com/michal-h21/tex4ebook/issues/137 --- book/tex4ebook.cfg | 14 ++++++++++++++ book/website.cfg | 12 ++++++++++++ 2 files changed, 26 insertions(+) diff --git a/book/tex4ebook.cfg b/book/tex4ebook.cfg index dffea80..35066f6 100644 --- a/book/tex4ebook.cfg +++ b/book/tex4ebook.cfg @@ -19,4 +19,18 @@ font-family: 'Open Sans'; } }} + +% Deal with chemical equations in a single svg +\ExplSyntaxOn +\def\standaloneenv#1{} +\pend:def\schemestart{\Picture+{}} +\append:def\CF_schemestop{\EndPicture} +\ExplSyntaxOff +\makeatletter +\def\texfourht@tikz@begin{ + \protect\csname nested:math\endcsname% support display math + \Picture+[\csname a:Picture-alt\endcsname]{}% +} +\makeatother + \EndPreamble diff --git a/book/website.cfg b/book/website.cfg index f236b6e..b87e680 100644 --- a/book/website.cfg +++ b/book/website.cfg @@ -47,5 +47,17 @@ } \ConfigureToc{loc}{\HCode{}}{\ }{}{\HCode{
}} +\ExplSyntaxOn +\def\standaloneenv#1{} +\pend:def\schemestart{\Picture+{}} +\append:def\CF_schemestop{\EndPicture} +\ExplSyntaxOff +\makeatletter +\def\texfourht@tikz@begin{ + \protect\csname nested:math\endcsname% support display math + \Picture+[\csname a:Picture-alt\endcsname]{}% +} +\makeatother + \begin{document} \EndPreamble