mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-05-06 17:49:07 -05:00
Build PDF version #9
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @profvjreddi on GitHub (Oct 8, 2023).
We have never tested or built the PDF version of the eBook.
@Mjrovai commented on GitHub (Nov 7, 2023):
The PDF version can be tricky, depending on the images. A good solution is to generate it offline from the ePub quarto version using Calibre.
@profvjreddi commented on GitHub (Nov 8, 2023):
Are there any pointers you can share that will help us understand this
build process you are recommending?
On Tue, Nov 7, 2023 at 3:07 PM Marcelo Rovai @.***>
wrote:
--
Vijay Janapa Reddi, Ph. D. |
John L. Loeb Associate Professor of Engineering and Applied Sciences |
John A. Paulson School of Engineering and Applied Sciences |
Science and Engineering Complex (SEC) | 150 Western Ave, Room #5.305 |
Boston, MA 02134 |
Harvard University | Email @.***> | Website
http://scholar.harvard.edu/vijay-janapa-reddi | Google Scholar
https://scholar.google.com/citations?hl=en&user=gy4UVGcAAAAJ&view_op=list_works&sortby=pubdate
| Edge Computing Lab https://edge.seas.harvard.edu | Schedule a Meeting
https://scholar.harvard.edu/vijay-janapa-reddi/schedule | Admin
https://scholar.harvard.edu/vijay-janapa-reddi/contact |
@Mjrovai commented on GitHub (Nov 8, 2023):
The issue was that the HTML render works correctly, with all figures rendered between text sections, as written in the .qmd files, but the pdf render, by default, puts the figures in different places in the text. I found a simpler solution, adding fig-pos: "H" on the format/pdf section of _quarto.yml:
Having the nunito font files on the root is also essential in pdf format (the HTML looks for the fonts online, but not the pdf).
@Mjrovai commented on GitHub (Nov 9, 2023):
Another issue that prevents rendering PDFs is online images (or gifs) with, for example, spaces on link names. I could render an ePub version of the book and using Calibre, convert it to PDF. I uploaded the book to TinyMLedu drive:
https://drive.google.com/file/d/18Yx4xIWAILFRbb213o4bI9aMe6TKf_55/view?usp=sharing
@Mjrovai commented on GitHub (Nov 9, 2023):
As additional comments,
@profvjreddi commented on GitHub (Nov 9, 2023):
Thanks Marcelo, this is very helpful.
Looks like the font size etc. are really big. Perhaps this is something we
can make a pass on at the end of the semester (~1 month) to make it render
more tightly.
On Thu, Nov 9, 2023 at 7:11 AM Marcelo Rovai @.***>
wrote:
--
Vijay Janapa Reddi, Ph. D. |
John L. Loeb Associate Professor of Engineering and Applied Sciences |
John A. Paulson School of Engineering and Applied Sciences |
Science and Engineering Complex (SEC) | 150 Western Ave, Room #5.305 |
Boston, MA 02134 |
Harvard University | Email @.***> | Website
http://scholar.harvard.edu/vijay-janapa-reddi | Google Scholar
https://scholar.google.com/citations?hl=en&user=gy4UVGcAAAAJ&view_op=list_works&sortby=pubdate
| Edge Computing Lab https://edge.seas.harvard.edu | Schedule a Meeting
https://scholar.harvard.edu/vijay-janapa-reddi/schedule | Admin
https://scholar.harvard.edu/vijay-janapa-reddi/contact |
@profvjreddi commented on GitHub (Dec 5, 2023):
Duplicate https://github.com/harvard-edge/cs249r_book/issues/83 so I am closing this issue and we can resolve it in the one that @V0XNIHILI is working on.
@Mjrovai commented on GitHub (Dec 20, 2023):
To generate the EPUB version, the
_quart.ymlfile should be modified, including a section epub inside format and after html:The toc (Table of Contents) is disabled because the numbers were duplicated on the epub version.
The file
epub_style-light.cssis thestyle-light.scssmodified to include at the end of the file, the offline font reference:In the root we should have the folder
fonts(unzip the attachedfonts.zipand upload it to the main directory)fonts.zip
The PDF generated by Quarto did not work (maybe is the setup in my Mac). I got this error:
Alternatively, I used CALIBRE (https://calibre-ebook.com/) to convert the e-book (epub to PDF). Calibre can add page numbers and include a TOC at the end. If the 'toc:true', for epub version generation, a TOC is included at the beginning of the book, with automatic link to the pages.
@V0XNIHILI commented on GitHub (Dec 21, 2023):
@Mjrovai also see my PR #83! The svg file missing is due the fact that Inkscape is probably not on your PATH: https://github.com/mrpiggi/svg/issues/6