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) ")";
}
to:
.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!