mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-05-06 09:38:33 -05:00
[PR #1395] [MERGED] fix(epub): stop sidenote filter from injecting LaTeX into EPUB output #5170
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?
📋 Pull Request Information
Original PR: https://github.com/harvard-edge/cs249r_book/pull/1395
Author: @octo-patch
Created: 4/18/2026
Status: ✅ Merged
Merged: 4/19/2026
Merged by: @profvjreddi
Base:
dev← Head:fix/issue-1333-sidenote-epub-inline-rendering📝 Commits (1)
6b7a194fix(epub): stop sidenote filter from injecting LaTeX into EPUB output📊 Changes
1 file changed (+7 additions, -3 deletions)
View changed files
📝
book/quarto/filters/sidenote.lua(+7 -3)📄 Description
Fixes #1333
Problem
The
sidenote.luafilter matched onepubalongsidelatex/pdf:Because ePub uses HTML internally, the
pandoc.RawInline('latex', ...)nodes that wrap\sidenote{…}are silently dropped by the EPUB renderer. The footnote body (between the delimiters) is emitted inline, causing sidenote/footnote text to appear embedded in the running prose rather than as proper footnotes.Example from the issue report:
"1 milliwatt**The 1 mW Threshold**"— whereThe 1 mW Thresholdis sidenote content that leaked into the main paragraph.Solution
Remove
epubfrom the format guard. For EPUB output,return nillets Pandoc's default footnote renderer take over, placing footnote content correctly at the end of the chapter.Testing
The fix can be verified by building the EPUB output and checking that footnotes no longer appear inline in the body text. The PDF/LaTeX sidenote behavior is unchanged.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.