# [tex4ht] Getting rid of <span class="cmr-9"> breaks in footnotes

Jürgen Hubert jhubert at gmx.de
Fri Jul 3 20:04:25 CEST 2020

Hello everyone! I'm currently in the process of finalizing my ebook (the Umlaut index issue I asked about some time ago has been solved based on your suggestion, by the way - thanks!), but I've just discovered one more snag.

I'm using a lot of footnotes in my book. They look fine in the epub files, and they look fine in any preview software I use.

However, I plan to publish the book on Amazon, as a Kindle ebook. And the Kindle itself has a special algorithm that will identify footnotes and then display them as popups. However, I discovered that the popups sometimes have line breaks that aren't displayed in other circumstances:

https://drive.google.com/drive/folders/1MmOeXjYgExt0IvmXvaAL1KC_baVu4ZoM?usp=sharing

Digging a bit further, I think I have discovered the problem. Here is an example document:

----------------

\documentclass[oneside]{scrbook}

\begin{document}

The first request was that overnight all fields, meadows, grazing grounds, and hills belonging to the smith\footnote{This indicates that the smith had used his Devil-gotten wealth for more than just drinking and gambling.} should be surrounded by walls 10 foot high and 5 foot thick made out of ashlar-shaped stones. This request was accomplished in full, and as the smith arose in the morning and walked around his property, the wall was as magnificent as could be imagined. Then the smith mounted his gray horse, which was as fast as the wind, and told the Black One to pave the path in front of him and then remove the stones behind him just as quickly. This too was accomplished, even though the smith rode until the horse died from exhaustion. Now the smith had no more ideas and went to the wise woman in the village again. She told him to give the Evil One a lock of his curly hair from his head\footnote{Yes, the German text explicitly says that the curly hair is from his head. This may be a story about the Devil, but it still should be suitable for \textit{children}.} and tell him to hammer out its kinks. Happy to have received such advice, the smith plucked out a lock and gave it to the Godbewithus. The Devil hammered on it for a long time until he recognized the impossibility of this undertaking. Full of anger and frustration he vanished while uttering a multitude of threats. The smith, made blind and brazen by such frequent deliverance from his fate, signed himself over for the third time and now had to go straight to Hell without recourse.

\end{document}

---------------

Alternatively, here is the Google Drive folder with the example file:

https://drive.google.com/drive/folders/1cIahp6ReNrYhOv2g0lNKMYzg2pEsudh3?usp=sharing

When generating the HTML code, the footnotes look like this:

-----

<div class="footnote-text">
<!--l. 5--><p class="indent" >   <span class="footnote-mark"><a
id="fn1x0"><sup class="textsuperscript">1 </sup></a></span><span
class="cmr-9">This indicates that the smith had used his Devil-gotten wealth for more than just drinking and</span>
<span
class="cmr-9">gambling.</span></p></div>

-----

<div class="footnote-text">
<!--l. 5--><p class="indent" >   <span class="footnote-mark"><a
id="fn2x0"><sup class="textsuperscript">2 </sup></a></span><span
class="cmr-9">Yes, the German text explicitly says that the curly hair is from his head. This may be a story about the</span>
<span
class="cmr-9">Devil, but it still should be suitable for </span><span
class="cmti-9">children</span><span
class="cmr-9">.</span></p></div>

-----

And it seems like the footnote pop-up function identifies '</span><span class="cmr-9">' as a line break (although curiously, not "</span><span class="cmti-9">", which designate italics text).

Note that this issue _only_ shows up in the footnote pop-up - once you click on "Go To Footnotes", the text appears normal.

Thus, in order to get rid of this problem I'd have to get rid of that '</span><span class="cmr-9">' in the middle of the text (which serves no useful purpose that I can see anyway). Is there a way of doing that?

A quick reply would be appreciated - I had hoped to launch my book near the end of next week (although I can delay for a bit, if necessary).

Best regards,

- Jürgen



More information about the tex4ht mailing list.