Skip to content

Fix faust2mathdoc to convert all mathdoc SVG diagrams to PDF - #1265

Open
oneilltomhq wants to merge 1 commit into
grame-cncm:master-devfrom
oneilltomhq:fix/faust2mathdoc-convert-all-svgs
Open

Fix faust2mathdoc to convert all mathdoc SVG diagrams to PDF#1265
oneilltomhq wants to merge 1 commit into
grame-cncm:master-devfrom
oneilltomhq:fix/faust2mathdoc-convert-all-svgs

Conversation

@oneilltomhq

@oneilltomhq oneilltomhq commented Jun 17, 2026

Copy link
Copy Markdown

Summary

  • faust2mathdoc only converted process.svg in each mathdoc SVG directory, but --mathdoc can emit named <diagram>expr</diagram> SVGs that the generated .tex references as PDFs.
  • Switch the main loop to use the existing convert_svgdirs2pdf helper (same approach as faust2mathviewer) so every generated .svg is converted before xelatex runs.
  • Add tests/mathdoc/signalFlowPatternsMathdoc.dsp, a small repro with multiple <diagram> tags.

Problem

For DSP files with <diagram>parallel_tank</diagram> (and similar), faust --mathdoc writes SVGs like parallel-*.svg under *-mdoc/svg/svg-*/, and the TeX output references the corresponding PDFs. The script never created those PDFs, so xelatex failed with missing file errors:

! LaTeX Error: File `../svg/svg-01/parallel-0x...' not found.

Repro

faust2mathdoc tests/mathdoc/signalFlowPatternsMathdoc.dsp

Before this fix, only process.svg was converted (1 PDF for 39 generated SVGs); the named diagram PDFs were missing and xelatex aborted. After the fix, all 39 generated SVGs are converted and the PDF builds successfully (46 pages).

Test plan

  • faust2mathdoc tests/mathdoc/signalFlowPatternsMathdoc.dsp completes and writes *-mdoc/pdf/*.pdf
  • Verified 39 .svg files and 39 matching .pdf files under svg/
  • Existing tests/mathdoc/rms.dsp still builds (no regression)

Notes

  • Inkscape CLI flags left unchanged for compatibility.
  • Missing supertabular (or similar LaTeX packages) on some systems is a separate dependency issue, not addressed here.

@oneilltomhq
oneilltomhq force-pushed the fix/faust2mathdoc-convert-all-svgs branch from 9c26d83 to 74c5632 Compare June 17, 2026 10:44
Named <diagram>expr</diagram> blocks emit per-expression SVG files that the
generated TeX references as PDFs, but the script only converted process.svg,
so xelatex aborted with "File not found" on the named diagrams. Use the
existing convert_svgdirs2pdf helper (as faust2mathviewer already does) so
every generated SVG is converted first.

Also add tests/mathdoc/signalFlowPatternsMathdoc.dsp, a small repro with
multiple <diagram> tags.

Co-authored-by: Cursor <cursoragent@cursor.com>
@oneilltomhq
oneilltomhq force-pushed the fix/faust2mathdoc-convert-all-svgs branch from 74c5632 to e0eb42a Compare June 17, 2026 11:03
@sletz

sletz commented Jun 18, 2026

Copy link
Copy Markdown
Member

Is the PR ready now ?

@oneilltomhq

Copy link
Copy Markdown
Author

@sletz I believe so - maybe the test file is a little sloppy in its substance - but the faust2mathdoc change allows multiple SVG diagrams, previously it was only allowing one

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.

2 participants