News for hackers. Stuff that matters.
Re:Portable EPUBs by ijhuygft776 on Thursday January 25, 2024 @09:31PM (#39138292)
Portable epubs? All the epubs I ever downloaded are portable... not sure how it could NOT be the case... not reading an article with a title like this.
Re:Portable EPUBs by zwayhowder on Thursday January 25, 2024 @10:49PM (#39138745)
I had the same thought, but wanted to know why the Author thought they were not.

For example, a major issue for self-containment is that EPUB content can embed external assets. A content document can legally include an image or font file whose src is a URL to a hosted server. This is not hypothetical, either; as of the time of writing, Google Doc's EPUB exporter will emit CSS that will @include external Google Fonts files. The problem is that such an EPUB will not render correctly without an internet connection, nor will it render correctly if Google changes the URLs of its font files.

The article raises some interesting ideas. Much like PDF and PDF/A, I would say an EPUB/A standard would be potentially useful.

Re:Portable EPUBs by adamzochowski on Friday January 26, 2024 @12:02AM (#39139118)
But same font problem exists with PDFs. If font is not embedded into PDF, or rendered into a vector shape that embedded, then PDF will display garbage.
Re:Portable EPUBs by BHSPitMonkey on Friday January 26, 2024 @12:27AM (#39139222)
Isn't that solved in PDF/A, which the GP was implying could also be done for EPUB?
Re:Portable EPUBs by jasomill on Friday January 26, 2024 @12:51AM (#39139312)
Yes: among other things, PDF/A requires all fonts to be embedded.
Re:Portable EPUBs by BarbaryCoast on Friday January 26, 2024 @02:33AM (#39139796)
Thanks for that. I can't read the article, probably because I block WASM (and Javascript) for security. None of my ebook readers have Internet access (for security and for privacy), so none of those internet-only epub files would work for me.

This might be "legal", since XHTML was intended for the web, but I assume Google's using it to collect more user interaction data that they can sell to data brokers.

FWIW, PDF is simply Postscript that's been compressed. As far as I can tell, almost all documents these days are created with Microsoft Word, TeX, or Postscript. I'm lumping things like PageMaker and LaTeX in with the base they were derived from.

Re:Portable EPUBs by Symbiote on Friday January 26, 2024 @03:12AM (#39140000)
The article is a WASM EPUB viewer. There's a link shown in the viewer to the EPUB file:

https://willcrichton.net/notes/portable-epubs/epubs/portable...

Re:Portable EPUBs by SilentM68 on Friday January 26, 2024 @12:01AM (#39139114)
One thing I dislike about PDFs is that dark themes usually don't render good, especially the embedded images, whereas the EPUB format seems to render them just fine. If a new EPUB format is created, I would suggest that they support pagination, since post secondary courses usually ask students to site chapters, pages, etc. Most EPUBs that I've come across don't have pages. The last thing I'd suggest is that the new standard, if created, should incorporated accessibility features, so that the file is readable by screen readers. PDFs are rarely designed with accessibility in mind. Making them accessible is also a gigantic pain to do. The technology behind any new EPUB document standard should have native accessibility support by default. People with print disabilities will thank you.
Re:Portable EPUBs by starkparker on Friday January 26, 2024 @12:54AM (#39139326)
> If a new EPUB format is created, I would suggest that they support pagination, since post secondary courses usually ask students to site chapters, pages, etc. Most EPUBs that I've come across don't have pages.

From the post:

> I think we just have to give up on citing content by pages. Instead, we should mandate a consistent numbering scheme for block elements within a document, and have people cite using that scheme.

The point of a citation is to specifically reference an assertion. Any method of specifically referencing an assertion works.

If anything, referencing by section and paragraph is more portable than referencing by page number. It's more consistent across different print formats of the same text (hardcover vs. paperback, and mainstream print editions vs. large-text or braille editions) as well as different digital formats.

Re:Portable EPUBs by jxdxbx on Friday January 26, 2024 @05:13AM (#39140877)
this is an issue in the legal world. court opinions accessed only online are cited according to their “page number” in some reporter or another. it’s better to cite paragraph numbers when possible but most American legal documents are un-numbered.
Re:Portable EPUBs by crabmusket on Friday January 26, 2024 @06:37AM (#39141509)
It sounds like the legal world can continue to use PDFs. That's fine!
Re:Portable EPUBs by dsr_ on Friday January 26, 2024 @09:52AM (#39143240)
Laws already have problems with HTML: numbered lists are specified in a way which is incompatible with many jurisdiction's numbering schemes, including the US Federal standard.
Re:Portable EPUBs by steve1977 on Friday January 26, 2024 @12:59AM (#39139356)
> dark themes usually don't render good

PDFs should not render dark themes at all. PDFs should like exactly like they were produced. So if they were produced with black on white text, that's what they should render, in any circumstance.

Re:Portable EPUBs by o11c on Friday January 26, 2024 @01:31AM (#39139506)
Or it can just invert the L component of all colors in the HSL colorspace at the very last stage of rendering, which only requires a couple subtractions to do in sRGB.

Unlike the unfortunately common "invert directly in sRGB", this preserves the colors changing only the brightness, and honestly it's pretty good. Colorspace nerds will no doubt complain that there are better colorspaces available, but in practice, most consumer devices implement "sRGB" perceptually such that this works better than fancier methods (which only work for carefully calibrated displays in carefully calibrated rooms).

Re:Portable EPUBs by steve1977 on Friday January 26, 2024 @02:52AM (#39139900)
I didn’t say PDF cannot do it, I said it should not. It defeats the purpose of PDF.
Re:Portable EPUBs by Vecr on Friday January 26, 2024 @01:20AM (#39139461)
Zathura[0] has a dark mode[1], it works pretty well.

[0]: https://pwmt.org/projects/zathura/

[1]: ^r Recolor (grayscale and invert colors)

Re:Portable EPUBs by xtracto on Thursday January 25, 2024 @11:50PM (#39139059)
Well... if you actually read the article instead of just the header, you would learn the reason for the need of a portable version.
Re:Portable EPUBs by emmanueloga_ on Friday January 26, 2024 @12:00AM (#39139107)
"portable EPUB: an EPUB with additional requirements and recommendations to improve PDF-like portability."

IMO epub is fine for fiction but not for any sort of technical material. EPUB docs are slow to reflow and the layout is pretty much always broken in some way, specially when there are tables and graphics involved. PDFs are a lot faster to render and navigate, the fixed page size being one of the reasons.

Re:Portable EPUBs by wolverine876 on Friday January 26, 2024 @12:10AM (#39139158)
The OP addresses some of those issues.
Re:Portable EPUBs by lxgr on Friday January 26, 2024 @12:42AM (#39139277)
Having suffered through many PDFs on my phone I’d take slow reflow and sometimes broken layouts over no reflow and guaranteed horizontal scrolling any time.
Re:Portable EPUBs by auggierose on Friday January 26, 2024 @03:48AM (#39140236)
Not sure why anyone would want to read PDFs on their phone.
Re:Portable EPUBs by offices on Friday January 26, 2024 @05:30AM (#39141026)
Imagination error. My phone has hundreds of downloaded PDFs from emails containing things such as tickets, job specs, pseudo-letters, bills, etc.

Anything where one might wish to read a Document in a Portable Format.

Re:Portable EPUBs by auggierose on Friday January 26, 2024 @06:58AM (#39141657)
Yeah, I guess. The thing with these is I don't care about the "quality" of a bill or ticket, it's enough if the tax man / concert venue accept it.

Many people advocating for a "better" PDF don't understand the quality aspect of a PDF. I am not willing to compromise on that when reading a book. It beats all other aspects, including the fact that I cannot read it on my phone. Basically, PDF's are a perfect translation of books into the digital medium. Gimmicks and features on top of what PDF can do are fine, but never a replacement, given that books also don't have these features.

Re:Portable EPUBs by lxgr on Friday January 26, 2024 @11:30AM (#39144499)
I quite often find interesting research papers during the day that I don’t have time to read in the office, and there’s no stable cell signal on my commute, so it’s in a way the perfect reading environment for these for me.

My commute isn’t long enough and often too crowded to warrant pulling out a tablet though. Reading on a single-hand device is ideal, and I prefer physical to physical books for that reason. So why shouldn’t I read research papers the same way? I just want a portable document format for an actually portable device.

Re:Portable EPUBs by auggierose on Saturday January 27, 2024 @02:02AM (#39153324)
I guess that's one use case! I wouldn't be able to read in such an environment, where I cannot even pull my tablet out.