Ethics [ed: George Matthews]

Hi Christina, we’ve made some progress on the internal links issue. The Pressbooks team has made what’s called the data-url attribute available, which ensures the display of complete URLs (even for internal links in the book) in the print PDF file. I’ve modified our existing custom CSS for the PDF as follows from:

.print a:not(.reference)::after {
  content: " (" attr(href) ")";


.print a:not(.reference)::after {
  content: " (" attr(data-url) ")";

The internal links in the book are showing up as expected, with the full URL instead of an internal bookmark! You can confirm the same in a new PDF export.

However, it looks like all other links in the book are also now being surfaced with a slight hiccup in links contained in figure captions. Some, like the “Buddha statue in Phuket” in Chapter 2 appear in the print PDF with all their relevant URLs, while others, like the “An Hindoo Woman throwing herself on the funeral pyre of her Husband” in Chapter 1 display with empty parentheticals where the URL should appear. I’m not sure why some captions contain the links while others don’t, but for the sake of expediency with this book, will suggest a quick solution:

  • Add the class="reference" to all the links in image captions (in the Text Editor)
  • Save your changes
  • Repeat for all image captions in each chapter

There’s nothing else to modify in the Custom CSS. This will ensure that the print PDF file isn’t inundated with URLs that students may not necessarily need — image source, creator’s website, and license. This text will still be displayed in the print PDF, it just won’t be hyperlinked or have the URL corresponding printed out.

Apologies for this extra step — I tried to find a way to automate/isolate this work in the CSS, but it proved a bit more complex than I had imagined, and I know we’re in a rush on this book.

Let me know if you have any questions. Once this is done, we should be ready to get the book in print!

@clhendricksbc — following up my long-winded email with much better news. We’ve figured out a custom CSS option to eliminate the empty parenthetical after links in captions. So to summarize:

  • URLs will be printed in the print PDF, with the exception of:
    • Links tagged with the class reference
    • Links contained inside image captions

All that’s left before we move into POD is for you to do a final look through of the print PDF.

Thank you, @apurva! This is good news.

I just did a new export of the print PDF, and found some more empty sets of parentheses. I’m not sure if there was something I needed to do to avoid these! They are all external links.

There’s one on the license page (p. 4), where the CC BY license is linked in the digital PDF last line, below):

And in the Acknowledgements, p. 16:

In “About the Contributors,” p. 109 (last line):

Also the iframes for google forms on pp. 110 & 111.

And all throughout pp. 112 & 113 (licensing information), p. 115 (accessibility information), p. 117 (version history).

I’m wondering if I missed something I needed to do to avoid these issues?

Thanks for catching these, Christina. I’ve tweaked the CSS code slightly to ensure that there are no empty parenthesis in these sections:

  1. Copyright page (p. 4) - the CC BY URL is printed elsewhere in the book, so this didn’t seem as pressing to have printed out. Please let me know if I’m mistaken.
  2. Iframes on Google forms (p. 110 & 111) - the URLs to the iframe elements is still displayed in the print PDF, so with this rule, we avoid empty parentheses or alternatively, repeated URLs.

The Pressbooks team is investigating the other issues, which we’ve categorized as follows:

  1. URLs not printed in back matter sections (about the contributors, licensing information, review statement, version history, accessibility information)
  2. Outlier in Acknowledgements front matter section - Philosophy of Mind URL is not displayed

I’ll keep you posted when we have news on a fix on these 2 issues.

Lastly, I wanted to note that I’ve cleaned up some stray code in some chapters while I’ve been troubleshooting - mainly empty classes associated with paragraph tags. You can see this activity in the revision history on some chapters. If time permits, I can go through the book and quickly clean up other chapters as well.

Thank you so much, @Apurva! I’ll wait on the two items still outstanding. And thank you for cleaning up stray code. It has been on my to-do list to do that, but further down than all the other items related to the books that are still outstanding, so I haven’t gotten to it.

1 Like

Hi Christina, the 2 outstanding issues have now been resolved! I’ve confirmed this by looking at a new print PDF of the book, and will request you to do the same. I did note that for images that are linked to a URL in the book, the URL might display (as was with the case of the CC BY logo in the Licensing & Attributions information back matter). Unlinking the image ensured that the URL was not printed in the PDF.

Fingers crossed that all looks good enough to proceed with setting up the book in print-on-demand.

As for the stray code: it doesn’t seem to be affecting the layout or formatting, so getting to it whenever you can should be okay. Slow and steady with this task. :slight_smile:

Yikes…I let this one go for awhile! I just took a look at a new print PDF export and all looks good with the two earlier issues. I did a quick scan through the whole book in print PDF format and it mostly looks good. There is just one small thing on both the print and digital PDFs–Box C in chapter 2 (p. 21) has quite wide bottom padding. It looks fine on the web version, but in both PDFs it looks too wide. I thought it might be the custom textbox in the custom CSS for the PDF version, but that is for .textbox.custom, and Box C is styled as <div class="textbox__content">. So I’m thinking it might be related to something else?

Ultimately this is not a big deal, just cosmetic, though! Otherwise, everything looks good.

I just took a look at one more thing–I looked at the epub version and noticed that the boxes and image break between pages sometimes. Clearly this depends on the size of the font and the window in one’s reader, but I wonder if there is some custom CSS for the epub version we could use to address this? I think we did so for the PDF versions, if I remember correctly.

Here is a screen shot from my epub reader of part of Chapter 6, for example.

This isn’t needed for print on demand, but it would be useful to address if we can!

I’ve adjusted the padding-bottom for the textboxes from 7em to 3em, and this has significantly improved the layout of Box C in Chapter 2. The other textboxes are mostly unaffected by this change. Let me know what you think.

Images and content in the EPUB format is reflowable — so that they can conform to the shape of the ereader software/device that the reader is using. Images in the ebook are already set to avoid breaking across pages:

img {
display: inline-block;
height: auto;
margin: 0;
max-width: 100%;
padding: 0;
page-break-inside: avoid !important; }

Perhaps you were viewing an older version of the file? I’ve taken a look on iBooks and Adobe Digital Editions and found that images in general (including the one you’ve specified) do not break across pages. I’d suggest deleting any ebook files from your ereader library and device and downloading a new file to confirm.

Hi Apurva, thank you for checking! I did delete all older versions and downloaded the latest one of the Ethics book, and looking on the ibooks app on my Macbook laptop mostly it’s fine…there is one size for the window on my laptop where it still happens with that one image of Schopenhauer. If I resize the window to be smaller or larger than that it’s fine, but that for one size it still happens.

That doesn’t happen on Adobe Digital Editions…resizing the window doesn’t change the text at all…it just cuts it off if I make the window too small!

So it may just be an issue with iBooks and only with one image. I think it’s not worth trying to track down at this point!

This looks great! Thanks so much, Apurva.

1 Like

I’ve been able to replicate it at a single size on iBooks, as well. It’s an odd occurrence, so I will pass along a report to the Pressbooks team to help identify the error. As you noted, this isn’t a major issue to halt production on the book, but will be good to notify the team about!

No problem! Let me know whether we’re ready to update the PDF files for print-on-demand. :slight_smile:

Hi Apurva, yes, I think we’re ready to go with the PDF files for POD!

Excellent, thanks! I’ll update the files in that case.

@christina.hendricks — Pressbooks has resolved the print PDF issue about displaying URLs in the footnote (this will also be fixed in the Logic book, where the problem also surfaced). I’ve updated the book’s version history accordingly and pulled a new set of exports. I’ll also update our print-on-demand page in Lulu with the new print PDF file. :slight_smile:

Wonderful–thank you!

Recently someone filled out the feedback form for the series and reported an issue with the ODT file for the Ethics book:

The “OpenDocument” download at reports “Read Error. Format error discovered in the file in sub-document content.xml at 1,393857(row,col)” when trying to open it in LibreOffice 6.4 in Xubuntu 20.04 LTS.

I just downloaded Libre Office for Mac (ver. and tested it out, and ran into the same problem. Here is the error message I get (just slightly different from above).

Read Error. Format error discovered in the file in sub-document content.xml at 1,398652(row,col)

I don’t know if this is anything that can be addressed? I can open the .odt file in Open Office (though the formatting is wonky, but at least the content is there), but not in Libre Office.


Hi Christina, thanks for passing this report along. I’ve been able to replicate it on my end too, and have submitted a report to the Pressbooks team so they can investigate further.

I have been able to open the ODT file with MS Word and Open Office, so I suspect that there may be something very specific to how the file is created that is triggered in Libre Office. I’ll keep you posted when I hear more from the Pressbooks team.

@christina.hendricks sorry for the delay! I’ve reported the issue to the Pressbooks team on GitHub. They note that the ODT exporter has not been updated in a few years, since it is not a very commonly used format, and that looking into the error and improving the exporter will be a heavy lift for them. Since the file opens in MS Word and Open Office, I’d suggest the user try those softwares instead of Libre Office. I hope the Pressbooks team will eventually be able to troubleshoot and fix the error with Libre Office, but the timeline is uncertain I’m afraid.

1 Like