Chapters in all italics showing up in all exports


We’ve been using PB for years for our university press. But, in one of my current books, there are entire chapters and back matter that are exporting as italics. No idea how or why. I’ve done all the normal things—used the text input, used a text file with no formatting, etc—to absolutely no avail. I’ve send an email re: the bug and filed a report. Wondering if anyone else has had this happen? And had a solution.

  • What theme are you using?
  • Do you have any custom CSS?

Hi Brad – we saw something similar in another book recently – the issue had to do with an unclosed <em> tag inside of a footnote, or a footnote shortcode which had been wrapped in italics. Easiest way to troubleshoot may be to look at the chapter just before the one where the content all starts exporting as italics and check to see whether one or more of your footnote shortcodes was wrapped in an <em> or <i> tag or has an em or i tag that isn’t properly closed. You may have to switch to the HTML view to see malformed tags.

1 Like

I’ve switched to several themes to see if it was an issue with that. But it replicated in all the themes.

Nope. We never use custom CSS!!

One weird thing: If I deleted the chapter and then added it by hand as the first chapter instead of the fifth, the italics in the main body section of the book were fixed.

The issue was that it was the WHOLE chapter. I removed ALL the formatting and pasted just a text file using the text section of the template (I was going to hand code using the WYSIWYG) and the italics were still there.

Right – the behaviour you’re describing sounds very much like the issue we saw recently with another book. When we produce PDF exports, we first have to create a single XHTML document for the whole book and then apply styling. If there’s an unclosed <em> tag, ALL of the text which follows will be treated as though it’s inside of an italic element. If you’re willing to share a link to the book in question, and the chapter where the italics starts appearing in your PDF exports, I suspect I could find the problem very quickly and show you via screenshot what I mean …

Yes, I know all the text that follows will be italicized, but ALL of the text in the chapter was italicized and there were no italics at the top. (So, either that formatting is just being replicated through the WHOLE chapter or something weird is happening.

So, you’ll see here: (although in the mobile version it appears okay.)

When I deleted the file and moved the italic chapter from Chapter 5 to Chapter 1…the issue was fixed. I literally did nothing but re-import in the first position.

But the original chapter (the last chapter in the main body) still exports as italics.

So, with no change, it appears properly in the first position and as all italics in the last position.

It’s the weirdest thing I’ve ever seen.

Right. What I’m trying to tell you is that I think the error with the unclosed <em> tag is occurring in the chapter before the one where you’re seeing the problems. In this case, that would be “Characters in Fire Emblem Three Houses”.

Here’s an example of a footnote from that chapter that I think will be causing problems:
<em lang="en-GB" xml:lang="en-GB">otaku[footnote]Otaku </em>are men, usually between 18 and 40 years old, who obsessively consume popular cultural products, such as anime, manga, or games.<em lang="en-GB" xml:lang="en-GB">[/footnote]</em>
If you were to rewrite this footnote as
<em lang="en-GB" xml:lang="en-GB">otaku</em>[footnote]<em>Otaku</em> are men, usually between 18 and 40 years old, who obsessively consume popular cultural products, such as anime, manga, or games.[/footnote]
that would fix this particular footnote. There may be a few more in the chapter which have similar problems with <em> tags and [footnote] shortcodes.


Let me look when I get out of this meeting!

That did it. It’s strange because that chapter where that error was didn’t have the italics problem. It was only the following one.

But that did it! Thanks for the help. I was about ready to throw my computer out the window.

1 Like

So glad it fixed things for you Brad. The reason why the problems don’t appear until the following chapter is that when the footnote shortcode is processed, the footnote content is moved to the END of the chapter. If there’s an unclosed <em> tag in a footnote, you typically won’t notice that the italics haven’t been closed until whatever comes next, which would be the text in the following chapter. It makes it very difficult/frustrating to find and fix the bug, though, since it looks like the problem must be in the chapter where the unwanted italics are appearing. We’ll see if we can add something helpful in the documentation to help others troubleshoot this problem. It’s pretty rare, but pretty hard to detect and resolve when it does show up!

We’ve been using PB for…I don’t even know…awhile. You know how technology is: ghost in the machine sometimes.

(I worked at Wired back in 1999-2003… So I’m used to weird things happening…)

Thanks again!

1 Like