Skip to content

fix: run publish on PRs and unblock 2026-02-13#31

Merged
Gavin-WangSC merged 2 commits intoComputerization:mainfrom
Gavin-WangSC:fix/publish-pipeline-resilience-and-2026-02-13
Apr 29, 2026
Merged

fix: run publish on PRs and unblock 2026-02-13#31
Gavin-WangSC merged 2 commits intoComputerization:mainfrom
Gavin-WangSC:fix/publish-pipeline-resilience-and-2026-02-13

Conversation

@Gavin-WangSC
Copy link
Copy Markdown
Contributor

Verified end-to-end locally with the full md2tex + lualatex pipeline before opening this PR.

What's in here

1. Run the publish workflow on PRs as a check (auto-publisher.yml)

  • Add pull_request: trigger gated to the relevant paths (src/content/blog/**, scripts, LaTeX, workflow files).
  • Skip Fetch Article (git pull origin main) on pull_request so the test reflects the PR head, not main.
  • Skip Commit and Push Changes on pull_request so feature branches never push generated artifacts to main.

This is the structural fix for the merge-and-pray workflow that produced #28, #29, and #30 each catching the next failure downstream. Future PRs that touch the publish path will validate in CI before merge.

2. Repair 2026-02-13 markdown

Two distinct md4c parse failures combined to produce the original \textbackslash invalid in math mode / Missing $ inserted from lualatex:

  • Inline $h(n)$ adjacent to Chinese punctuation ($h(n)$,) defeats md4c's flanking rules for LATEXMATH spans, so the dollars and contents fall through to the plain-text escaper and emerge as \${} / \textbackslash{}. Fix: pad a single ASCII space between $ and any adjacent CJK char or fullwidth punctuation.
  • Bare A* / D* (algorithm names) get paired across paragraphs as italic emphasis, wrapping huge regions (math included) in \textit{...} where every backslash and dollar then gets escaped. Fix: backslash-escape the asterisks (A\*, D\*).

Local lualatex now compiles a 191 KB index.pdf with no errors.

Local verification

Test plan

  • This PR's own Publish New Article check (now triggered by the new pull_request: trigger) goes green.
  • After merge, the next scheduled Generate New Article run produces and commits public/blog/2026-02-13/index.pdf, the daily new article PDF, and the relevant new monthly batches.

Verified end-to-end locally with full md2tex + lualatex run.

1) Run the publish workflow on PRs as a check (auto-publisher.yml)
   - Add pull_request trigger gated to relevant paths.
   - Skip Fetch Article (git pull origin main) on PRs so the test
     reflects the PR head, not main.
   - Skip Commit and Push Changes on PRs so feature branches never
     push generated artifacts to main.
   This is what surfaces the rest of these fixes as a check before
   merge instead of after.

2) Skip monthly batch when a member post failed to compile
   - batch() reads each post's index.tex; a skipped post has none.
   - Now checks all members exist before assembling the batch and
     bails gracefully if lualatex itself produces no PDF for a batch.
   - Verified: batches 62 and 66 (containing 2026-03-17 and 2026-04-11
     respectively, both still broken) skip cleanly; the surrounding
     batches still compile.

3) Repair 2026-02-13 markdown
   Two distinct md4c parse failures were producing the original
   'textbackslash invalid in math mode' / 'Missing $ inserted' from
   lualatex:
   - Inline $h(n)$ adjacent to Chinese punctuation ($h(n)$,)
     defeats md4c's flanking rules for LATEXMATH spans, so the
     dollars and contents fall through to the plain-text escaper.
     Pad a single ASCII space between $ and adjacent CJK chars.
   - Bare 'A*' / 'D*' get paired across paragraphs as italic
     emphasis, wrapping huge regions (math included) in textit{...}
     where every backslash and dollar then gets escaped.
     Backslash-escape the asterisks (A\*, D\*).
   Local lualatex now compiles a 191 KB index.pdf with no errors.
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 29, 2026

Deploy Preview for c13n-newsletter ready!

Name Link
🔨 Latest commit 594a95a
🔍 Latest deploy log https://app.netlify.com/projects/c13n-newsletter/deploys/69f1c0b8d827420008a2e9ff
😎 Deploy Preview https://deploy-preview-31--c13n-newsletter.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

The previous regex over-applied: it escaped A* to A\* inside the
description value of the YAML frontmatter, which js-yaml rejects as
'unknown escape sequence' and which broke the Astro site build (and
the Netlify deploy preview).

scripts/make.py's metaext strips frontmatter before md2tex runs, so
the asterisk in description never reaches the markdown pipeline and
doesn't need escaping. Body asterisks remain escaped.
@Gavin-WangSC Gavin-WangSC merged commit 11a8776 into Computerization:main Apr 29, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant