[tex4ht] [bug #516] Double counters for mdframed

Nikolaus Correll puszcza-hackers at gnu.org.ua
Sun Aug 1 21:48:17 CEST 2021


URL:
  <http://puszcza.gnu.org.ua/bugs/?516>

                 Summary: Double counters for mdframed
                 Project: tex4ht
            Submitted by: correll
            Submitted on: Sun Aug  1 22:48:17 2021
                Category: None
                Priority: 5 - Normal
                Severity: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

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}
  



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Sun Aug  1 22:48:17 2021  Name: test.html  Size: 1kB   By: correll

<http://puszcza.gnu.org.ua/bugs/download.php?file_id=425>
-------------------------------------------------------
Date: Sun Aug  1 22:48:17 2021  Name: test.tex  Size: 893B   By: correll

<http://puszcza.gnu.org.ua/bugs/download.php?file_id=426>

    _______________________________________________________

Reply to this item at:

  <http://puszcza.gnu.org.ua/bugs/?516>

_______________________________________________
  Message sent via/by Puszcza
  http://puszcza.gnu.org.ua/



More information about the tex4ht mailing list.