From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.215.179 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795942638; b=sUyYyQRcdNbBlwwS27FjSoWqfKgTC6g1bkYCpeLdsRqQ84aqLCrHeGR5Fs27cOlRkRcE Not50rEhd3YZUCQg+tHFcVEdXKLpRkM7XaHImx+PdLES6jhvEeoa5YsguHoF51RLRF+QT rI/wwKAtem8bo0zyLkpELPaKp7xVBULF5qUnbdIZO0waXUOhkUeLQKUA+aIHz9lfyzrQd 8wFs3tq7FfTwVXPbATnZtb10UcbDEiZYhjUkGj97nDCRvVxezeXVryvKPn6fnVW2cElpG JJgmzPA+wAmEO7hcERh0r/P46S2NwKFyaRVh7jLE2H/mQKLBQdycSs6lH+5kPf2Gx4w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795942638; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Message-ID:Date:MIME-Version:User-Agent:From:Subject:To:Cc:References: Content-Language:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=4i4Zgn0I6kSzMul6c2xy7RgciD7B3MtE02EmgNcDSaY=; b=nRUie/wmDrA5oVJ8BdRWr/JzvmLDXnLwMsOaMHYd3lnr0CD1z8KHVdyq5Wh4NVaFBjkZ gxvDQazOaWbM9W5Zekno7fueOnj5LPFD5aLls/NBLaKdS5h+6/PmYS3Od3vThtMKj0Za7 ygAqAoLzWVp6OAL2eHTxcAGri5pKnfmX4gzWsDQ+HO/8lojixRpA34EdX3te2VDsIxVA3 sJmQXBrjWULRmKKZTa96z6hbpmOZ4nLA0S+azczGrJR2Ade77lr4Gk4+9rIsGrHQu+nd1 IHWdkgHdkXy4BWDiD67gVcitNxGTyNISPFLO/UjxwZuREabWmOuNBvLCwJ89szWP6ng== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=Ow0E6qbm; arc=none smtp.remote-ip=209.85.215.179 Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E61CF606A31C for ; Sun, 29 Nov 2026 08:57:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E61CF606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=Ow0E6qbm Received: by mail-pg1-f179.google.com with SMTP id 41be03b00d2f7-cddac941ed1so4205524a12.2 for ; Sun, 29 Nov 2026 00:57:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1795942637; x=1796547437; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:content-language :references:cc:to:subject:from:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to:content-type; bh=4i4Zgn0I6kSzMul6c2xy7RgciD7B3MtE02EmgNcDSaY=; b=Ow0E6qbmbK31yor3oxoqZbkXX6ojd8safAhDBjEmS3DonwqPrAU7SEDQwCcaaSl9oj z0aJ9UHfMGsGl4mo+valiSDgcx0fPkh3BxzJeeRoXOEWZ5zjQ+YIcTpRTCrd53Skt6M3 wcs6NB1vpPttw7ysWB612NHXcLJnrHzOCdvtwWKnhCNtfr9vuP3qiWhdiZC2UEMUKqXx s161emT0KlQuAY2m9yFaqojsZoS6l/91jCkWI+7k4Z0NBP2PbKN2OdoIzr5w7h2Yfx9w UVP3bbYGAWzeuTogd6gcm87bP6mYefQkFGIUEJlpbD1742JSd5BbJqj4vOD8M2r9jvn4 V4SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795942637; x=1796547437; h=content-transfer-encoding:content-type:in-reply-to:content-language :references:cc:to:subject:from:user-agent:mime-version:date :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=4i4Zgn0I6kSzMul6c2xy7RgciD7B3MtE02EmgNcDSaY=; b=wbU2BSDk3MEL5MrowP5fY7zzOecF/3CTrfsIdR71ZwPa3otKJM43ls4ywgxgI1D2lT IDYmeElERyzWyYoayqJD9d+IpIh1UfM8hfiU9k5l9IKqOTd8M3PeTFUrmcuCre9G7GOs ZQaV2BdjXwW4MWCAShJybdCN9Hc1ROGh25K+HQk+UWB87cERGYwU0RxxGhaQg5YfNy+M tLl54ikgU82UNOLZYZELJSy4kwL5AuPXOh6MaTqZQpvb4xhtziUin5tgGfC9puk0DgV+ C22VWzg8rxDYtGsHRzdPZ3KvwA6KVvy8DHlyHz3qXb1o7Kg87W7CpxLVyHUuPh8D0fZZ Xd8g== X-Forwarded-Encrypted: i=1; AL+hErFfSU/zJfUQz7RdI0Fdrg0+PH25LzLAG+LQ4DmSsQaRDTfMGMwpYlcCi3hNifXcOjMg2B1E0GRVVA==@vger.kernel.org X-Gm-Message-State: APuU4Z/5dzwFW8h48AHR39k9fyPFXkwrLd2k2YxNq4dYVH7YXMXX4PfY EmWsJfqMx8QZww+iZO+j8SWBM1u0S3hdx2Ljaf88+72LIcQy2pRtoumKgvSYaA== X-Gm-Gg: AZFdTZcl1hLTRYua2RNhhadCeQbetYZr7EpvVONvvZKlCExmXUGzDJ33lMvvgY7CgCr EICnIR1tx0nQvcNVwMmP500xvT8RO1v4b+TexWjD+R3Iu5Fv4uk+kidxVScaGgtw7wvqoOJTlZP QAXzTvxUUo5qrPvY5SOjAIyK9gDb3WSH1s+tcTuJ055+YVZSVw/aIOQB/UVqWesogPatFDBEilL yVvUHwVrbnT2DumFv6SNKQItQVOTAeXe3Qa1s4Et0JmoTvrXHvrtBHG7Gsn2bil0r9bRldmSV7C PQLGwAsehr7wYVsnAkON5SDrSC2Jx+DqJ7wz8yhgUviykSlR85Z9pyWiYJ8nxbgr3ZpeolkyMk5 jjG9Vy08klVMgyBK5ejml0OtaEEaY521WzjSE2oyY9jvhdv+ZCaLR4ac3Lo7qaPL06svt6cuXE5 YGGBjUTVk/6Y5vpZ1EandayhlC5328Rzly3mbCu3s3jfAY+DEi8434+gExCrbGfdwpoMyFy34E+ L4/mp0n9hE7OgrvhM8xGxj9rxf0fGwN+6bQpQ09gkVl6AkA/uloTuFg+JLxgWQQeNh+bwh6dvya mYKfgmdsgls6PiIXGqSSnmDgQx6a15qVjlalHc8FqnpWKbwbB+9Dymrkjz0SWcx9FCmGzSDRuVV jUpF1qAuAVogiCrgAIMw= X-Received: by 2002:a17:90b:1801:b0:3b0:9984:18c9 with SMTP id 98e67ed59e1d1-3b41c8e16efmr28467011a91.11.1795942637028; Sun, 29 Nov 2026 00:57:17 -0800 (PST) Received: from [10.0.2.15] (KD106167137155.ppp-bb.dion.ne.jp. [106.167.137.155]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b41ad48786sm46457635a91.9.2026.11.29.00.57.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 29 Nov 2026 00:57:16 -0800 (PST) Message-ID: Date: Sun, 29 Nov 2026 17:57:08 +0900 X-Mailing-List: perfbook@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Akira Yokosawa Subject: Re: [RFC PATCH 0/7] Add reflowable HTML and EPUB3 build target To: Ferenc Fejes , perfbook@vger.kernel.org Cc: "Paul E . McKenney" , Leonardo Bras References: <20261115210138.229034-1-ferenc@fejes.dev> Content-Language: en-US In-Reply-To: <20261115210138.229034-1-ferenc@fejes.dev> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi, On Sun, 15 Nov 2026 22:01:31 +0100, Ferenc Fejes wrote: > Hi! > > This RFC series adds experimental reflowable EPUB3 and HTML build targets > ("make epub", "make epub-endnotes", and "make html") derived from the > ebook-size variant via TeX Live's lwarp package and Pandoc, without > modifying any of the book's existing .tex or .sty files. > > Overview of the pipeline: > > - reflow.ltx hooks into the generated perfbook-epub.tex wrapper to adapt > print-oriented macros, listings, tables, figures, equations, footnotes, > Quick Quizzes, and cross-references for HTML/EPUB output. > - Makefile stages SVG figures in parallel under epub-figs/ and invokes > utilities/runlwarp.sh to run lwarp, render math SVGs via lwarpmk, > package the chapter-split EPUB3 with Pandoc, and run structural > validation checks (plus epubcheck when installed). > - utilities/epub-fixhtml.pl and utilities/epub.css perform post-Pandoc > XHTML/SVG/CSS adjustments tested in KOReader and Foliate, including > EPUB3 popup footnotes and Quick Quiz answers (and a plain endnote > variant in perfbook-endnotes.epub for readers without popup support). > > This is an RFC so I would be happy to hear ideas how I can improve this > experiment. Few things: > > 1. Does this non-invasive lwarp + Pandoc approach look acceptable for > maintaining experimental EPUB support alongside the PDF builds? > 2. Is it worth keeping both perfbook.epub (popup footnotes/quizzes) and > perfbook-endnotes.epub (linked chapter endnotes), or would a single > target be preferable? > 3. Are the Dockerfile package additions and non-blocking GitLab CI job > (allow_failure: true) aligned with how you would like this tested? > > AI: This RFC generated by language models and I verified the result on > my physical epub reader and on Linux in Foliate and KOReader epub > readers. I used several models and refined the set for months, and with > the latest and greatest frontier I was unable to trim ot further. The downside > of this work is that I cannot tell with full confidence this is the > simplest form. With more knowledge it might be improved further. > > I tried three approach to get to a working epub target: > - tex4ht: it required heavy modifications of the already existing LaTeX > source so I abandoned this approach. After aroung 2k LoC change it was > able to produce a reasonable HTML and ePUB, but it was too intrusive > for my taste > - lwrap (this one): this felt the best and required the least change > compared to the upstream. It hooks into the build flow in the right > spot so no changes required in the upstream LaTeX code > - LateXML: this is what arXiv uses to compile the paper sources to HTML > and they improve it in quite a fast pace. This target was intrusive > and a reasonable looking output required many small changes in the > upstream source and what worse, in the LateXML toolchain. I abandoned > this approach as well > These trials executed 2-3 months ago, and lwrap was the winner, but > models might improved since making LateXML feasible. In the past months > I only improved the lwrap based approach, resulting this RFC. > So, I have tried EPUB output for a while with the Books app on iPad and iPhone. With the screen size of iPad, most (> 90%) of (virtual) pages look reasonably good. As you said elsewhere, code snippets with long lines and large/wide tables are hard to read. I like the way footnotes and Quick Quiz Answers are popped up. :-) A couple of concerns: 1. "fvextra" and "cleveref". perfbook has experienced occasional regressions caused by these packages' incompatibility with LaTeX releases since 2024. We have replaced cleveref with zref-clever. See commit 1bc3abddbf59 ("Stop using "cleveref" with LaTeX2e <2024-11-01> and later"). With regard to fvextra, I have a patch set ready to be merged for getting rid of it and its local hotfix (fixfvextra.ltx). No auto-wrapping in code snippets any more. It looks like your reflow.ltx assumes both of them. What is your prospect of their stability going forward? 2. Future changes in the preamble. There are rooms for improvements in PDF. Such improvements may accompany changes in package usage and macro definition and can break HTML/EPUB builds without prior notice. Can we rely on you in resolving such issues? Thanks, Akira > Thanks, > Ferenc > > Ferenc Fejes (7): > reflow.ltx: Add LaTeX-to-HTML shims for lwarp builds > utilities: Add EPUB3 post-processor and stylesheet > utilities/runlwarp.sh: Add lwarp and Pandoc build driver > Makefile, .gitignore: Add epub and html build targets > epub: Add endnote variant for readers without popup footnotes > FAQ-BUILD.txt: Document HTML and EPUB build targets > docker, gitlab-ci: Add EPUB build dependencies and CI job > > .gitignore | 14 ++ > FAQ-BUILD.txt | 45 ++++++ > Makefile | 68 ++++++++- > docker/Dockerfile | 2 +- > reflow.ltx | 255 ++++++++++++++++++++++++++++++++ > utilities/epub-fixhtml.pl | 93 ++++++++++++ > utilities/epub.css | 63 ++++++++ > utilities/gitlab-ci.yml | 17 +++ > utilities/runlwarp.sh | 299 ++++++++++++++++++++++++++++++++++++++ > 9 files changed, 852 insertions(+), 4 deletions(-) > create mode 100644 reflow.ltx > create mode 100755 utilities/epub-fixhtml.pl > create mode 100644 utilities/epub.css > create mode 100644 utilities/runlwarp.sh > > > base-commit: 94d572e236ab8e26fa79ff0776a3bba221647315 > -- > 2.55.0