Repository navigation
compiler: \includegraphics in running text and graphicx box transforms as structured inline nodes - #169
Merged
Conversation
…s as structured inline nodes
New module `graphics` and two inline variants, parsed outside the macro
pass and never measured by the parser:
- `Inline::Graphic(Graphic { starred, options, path, span, space_before })`
for `\includegraphics[*][keys]{file}` in running text. Keys and file
keep their exact source text (`width=0.5\textwidth, trim={1 2 3 4}`).
graphics.sty's two-bracket bounding-box form `[llx,lly][urx,ury]` is
recorded as `viewport=llx lly urx ury` (pdftex.def `\Gin@iii@vp`).
Replaces the old "\includegraphics is unsupported" parser warning.
- `Inline::Transform(TransformBox { kind, content, span, space_before })`
for `\scalebox{x}[y]`, `\resizebox*{w}{h}` (`!` kept verbatim),
`\rotatebox[keys]{angle}` and `\reflectbox`. The content is parsed with
the ordinary dispatch in the current style (math, nested transforms,
images), sharing `argument_inlines` with footnote text.
- `\graphicspath{..}` is consumed without a diagnostic (preamble or
body); `graphics::graphics_path_entries` splits its groups for a
consumer that reads image files.
Parser helpers: `bracket_argument` (exact source text, splits a `[a][b]`
word), `take_star_prefix` (`\includegraphics*[..]` lexes as one word),
`argument_text` (exact source text of a braced argument, token
reconstruction for macro expansions).
The Core 14 layout (runtime-v1) reports both nodes with an
`unsupported_feature` warning and sets transform content untransformed;
incremental span shifting covers both (`TransformBox::try_map_spans`).
Inventory: `includegraphics` leaves TEXT_DIAGNOSTIC_ONLY; `scalebox`,
`resizebox`, `rotatebox`, `reflectbox`, `graphicspath` are text
dispatch arms. Regenerated with scripts/render_supported_latex.sh.
Tests: new tests/graphics_nodes.rs (keys/path/span, starred and bbox
forms, transform parameters and nested content, edit span shifting);
references_and_figures' includegraphics test now checks the layout
warning. `cargo test --release`: all suites pass (lib 253).
Debug-only note: supported_latex's canonical-names test trips the
existing `debug_assert!(!BUILT_INS.contains(..))` on `\and`/`\today`
(TEXT_CONTEXT_ONLY), independent of this change; release passes.
Implementation-Agent: Claude Opus 5 (subagent kabir-claude inline graphics, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
GoKubar
added a commit
that referenced
this pull request
Sep 13, 2026
…ession handoff) Stage 1 partly done: #131, #137, #153 (incl. #142), #144, #147, #149, #150, #155, #159, #163, #164 merged with conflicts and post-expansion fixes recorded in docs/evidence/integration-2026-09-13b/merge-log.md. Remaining: #166, #169, #148, #161, then the inventory regeneration and stages 2-4. The helper scripts under tools/ hard-code the original worktree path. Implementation-Agent: Claude Opus 5 (subagent kabir-claude integration, mac-m5pro-kabir) Commit-Executor: Claude Code direct Git Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
GoKubar
added a commit
that referenced
this pull request
Sep 13, 2026
Conflicts: lib.rs module order; incremental.rs span arms (ColorBox brace restored); layout.rs reference/emit arms; parser.rs Inline enum (variants reordered around a shared brace), \graphicspath dispatch and the siunitx_group_at/bracket_inner shared tail (duplicated). Implementation-Agent: Claude Opus 5 (subagent kabir-claude integration, nixos-pc-kabir) Commit-Executor: Claude Code direct Git Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
GoKubar
added a commit
that referenced
this pull request
Sep 13, 2026
…merges Every stage 1 merge took main's side of the generated inventory and deferred the regeneration to the end of the stage. Running crates/compiler/scripts/render_supported_latex.sh picks up #131, #137, #144, #147, #149, #150, #153, #155, #159, #163, #164, #166 and #169, so supported_latex::generated_artifacts_are_current passes again. The TeX Live-derived canonical denominator is deliberately untouched: this machine has TeX Live 2025, not the MacTeX the committed file was pinned from. Implementation-Agent: Claude Opus 5 (subagent kabir-claude integration, nixos-pc-kabir) Commit-Executor: Claude Code direct Git Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Structured inline nodes for graphicx outside floats (parser only; no macro-pass change). Base: main.
Inline::Graphic(Graphic { starred, options, path, span, space_before }):\includegraphics[*][keys]{file}in running text, keys and file as exact source text; graphics.sty[llx,lly][urx,ury]recorded asviewport=…(pdftex.def\Gin@iii@vp). Replaces the "\includegraphics is unsupported" parser warning.Inline::Transform(TransformBox { kind, content, span, space_before }):\scalebox{x}[y],\resizebox*{w}{h},\rotatebox[keys]{angle},\reflectbox; the content is parsed with the ordinary dispatch (math, nested boxes, images).\graphicspathconsumed without a diagnostic;graphics::graphics_path_entries.unsupported_feature) and sets transform content untransformed; incremental span shifting covers both.includegraphicsleaves TEXT_DIAGNOSTIC_ONLY; 5 new text arms).Tests: new
tests/graphics_nodes.rs;cargo test --releaseall suites pass (lib 253). Note: in debug buildssupported_latex::canonical_names_outside_the_inventory_are_diagnosedtrips the existingdebug_assert!on\and/\today, independent of this change.Consumer: the render-pipeline PR
agent/kabir-claude/inline-graphics(needs this re-pinned intovendor/compiler).🤖 Generated with Claude Code
https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu