1

TeX4ht generates a double footnotes when a footnote is defined inside of a csquotes \blockquote.

Double Footnot

Here is a LaTeX reproducible example:

\documentclass[a4paper]{report}

\usepackage{csquotes}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\begin{document}

\section{About Color Science}

The International Commission on Illumination (CIE) defines perceived color as
the~\blockquote{characteristic of visual perception that can be
described by attributes of hue~\footnote{See sub-section~\ref{subsec:terminology}
for the definitions of hue, brightness, lightness, colorfulness, saturation and
chroma.}, brightness (or lightness) and colourfulness (or saturation or
chroma).}

\end{document}

My TeX4ht stripped config:

\Preamble{3,charset=utf-8,fn-in,html5,sec-filename,sections+,xhtml}

\EndPreamble

And the relevant HTML output:

<div class="footnotes"><!--l. 16--><p class="noindent"><span class="footnote-mark"><a href="#fn1x0-bk" id="fn1x0"><sup class="textsuperscript"><span class="ec-lmr-9">1</span></sup></a></span>See sub-section&nbsp;?? for the definitions of hue, brightness, lightness, colorfulness, saturation and
chroma.</p><!--l. 16--><p class="indent"> <span class="footnote-mark"><a href="#fn1x0-bk"><sup class="textsuperscript"><span class="ec-lmr-9">1</span></sup></a></span>See sub-section&nbsp;?? for the definitions of hue, brightness, lightness, colorfulness, saturation
and chroma.</p>                                                                                                          </div>
2

The \blockqoute command typesets the argument twice, one use is to detect if it contains multiple paragraphs, the second use prints the text. The paragraph detection happens in a \vbox, which is then thrown away. The issue is that tex4ht detects the footnote in this thrown away box and typesets it, which results in duplicate footnote. An easy fix for this is to just skip the paragraph detection. The downside is, that you will get a different result to regular LaTeX if you use multiple paragraphs inside the \blockquote command and only in the case it starts in a middle of a paragraph. I don't know how much often this situation happens, it doesn't seem like a good idea anyway.

Save the following code as csquotes.4ht:

\long\def\csq@bquote@i#1#2#3#4#5#6{%
\csq@bquote@ii{#1}{#2}{#3}{#4}{#5}{#6}}

\Hinput{csquotes}
\endinput

The result:

enter image description here

I will add this file to the tex4ht sources if it works for you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.