Display of titles with HTML tags in EPUB export

Hi!
I have a part title with a <span> tag:

Part V. Agent-based models <span>vs</span> ODE models

I do this to be able to control the format of the word “vs”:

/* This is a trick so you can force anything you put into  
to be lower case. It is done for the "vs" in
"PART V. AGENT-BASED MODELS vs ODE MODELS" */
.part-title span { 
  text-transform:lowercase;
}

This dirty trick (constructive criticism and suggestions are most welcome) works like a charm except for the table of contents in the EPUB export. There, the part title appears as:

Part V. Agent-based models <span>vs</span> ODE models

The reason, presumably, is how the above line is coded in the file “table-of-contents.xhtml” inside the EPUB:

<span class="toc-chapter-title">Part V. Agent-based models &lt;span&gt;vs&lt;/span&gt; ODE models</span>

As you can see, < has been transformed into &lt; and > into &gt;
Any ideas on how to fix this?
(Either the general problem I pose here, or my specific problem, by modifying my dirty trick)
Thanks!

How about having custom CSS that stops the tex-transform to upper case in titles and write the title in capitals where it is wanted?

text-transform: none !important;

1 Like

Thanks again, Thomas. The issue is that I actually like how it is done in my (McLuhan) theme. You write the part title (once) in lower case (and it appears like that in most cases), but Pressbooks capitalize it in certain places, such as in the part-title in each chapter (see “PART V. AGENT-BASED MODELS vs ODE MODELS” below):


My problem is that I never want “vs” to be upper case. The rest is fine.
Thanks a lot for trying

Well then… I do not think tags are „officially“ supported in post titles. The fact that they work online and in the PDF export might be „luck“. You could file a feature request for tag support also in EPUB export.

1 Like

That is very useful information, thanks a lot, Thomas