Hello all. Trying to customize a PDF for an author and am hitting the limits of my personal CSS knowledge. I’ve been able to restyle most elements as desired, but cannot figure out what determines element placement on a PDF page, particularly for Chapter/Part titles. The author is hoping that by moving these H1s up, we could fix some bad breaks further down in the chapters, but I can’t seem to figure out how which style, let alone which attribute, is defining this placement. Can anyone help? Thanks.
Hey Mike,
Great question–I can look more closely at the book in question if you share a link, and/or you might be able to examine yourself using the new book source link that we’ve added to the ‘diagnostics’ menu for each book. Visit: https://yourbooksurl
/wp-admin/options.php?page=pressbooks_diagnostics and you should see a view source
option with an XHTML source that lets you preview your PDF export (shown below)
I think you can use the inspector to see what the relevant class is for the PDF exports here, but if you provide a book link, I can tell you for sure (I’m a little rusty on this ATM myself).
Thanks Steel. This is interesting because it appears from the debug that the attributes I thought were at the heart of the issue – margins on “title-wrap” elements – do in fact relocate the elements when I inspect and edit them in debug mode, but the desired attributes (margin: 0cm 0cm 0cm 0em;) aren’t showing up organically in either the debug or the export, despite already being defined in my stylesheet. I’ll keep digging around. Perhaps I have conflicts somewhere.
Hmmm–that sounds odd. The rest of the Pressbooks team should be back at work next week after the New Year holiday, maybe they’ll have other, better ideas?