Sun Aug 1 19:48:17 2021, original submission:
Hi,
I'm trying to use the mdframed package with tex4htmtl to create numbered "Example" boxes. The result is as expected with PDFLatex, but the resulting HTML code shows the counter twice as so:
<div class='mdframed' id='mdframed-1'>
<!-- l. 37 --><p class='noindent'><span class='cmbx-10x-x-109'>Example 0.0.0 ”test”</span><a id='x1-2r1'></a>
</p><!-- l. 38 --><p class='noindent'>This is a test.
</p><!-- l. 39 --><p class='noindent'><span class='cmbx-10x-x-109'>Example 0.0.1</span></p>
</div>
Here, the second <span> at the end is undesired and unnecessarily increases the counter ("Example 0.0.1"). The Latex code below reproduces the result:
\documentclass[paper=6.14in:9.21in,pagesize=pdftex,11pt,twoside,openright]{scrbook}
\usepackage[framemethod=TikZ]{mdframed}
\mdfsetup{skipbelow=2pt, backgroundcolor=gray!8, linecolor=black!40}
\usepackage{tex4ebook}
\usepackage{pdfpages}
% EXAMPLES
%% set the counter for your environment
\newcounter{example}
\renewcommand{\theexample}{\thesection.\arabic{example}}
%% define the style
\mdfdefinestyle{example}{%
linecolor=blue,
outerlinewidth=2pt,
bottomline=true,
leftline=false,rightline=false,
skipabove=\baselineskip,
skipbelow=\baselineskip,
frametitle=\mbox{},
}
%% setup the environments
%%% with number
\newmdenv[%
style=example,
settings={\global\refstepcounter{example}},
frametitlefont={\bfseries Example~\theexample\quad},
]{example}
\begin{document}
\begin{example}[frametitle="test"]
This is a test.
\end{example}
\end{document}
|