Skip to content

Schema: allow "@component" on metadata elements and "docinfo" - #3079

Merged
rbeezer merged 2 commits into
PreTeXtBook:masterfrom
rbeezer:schema-subtitle-component
Jul 27, 2026
Merged

Schema: allow "@component" on metadata elements and "docinfo"#3079
rbeezer merged 2 commits into
PreTeXtBook:masterfrom
rbeezer:schema-subtitle-component

Conversation

@rbeezer

@rbeezer rbeezer commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Reported on pretext-support (VS complaining about component in subtitle, but all works well): placing component="..." on a subtitle draws a validation complaint, while processing is perfectly happy. The version machinery in assembly acts on any element carrying @component, and the attribute survives into the assembled tree, so the schema is the only gatekeeper — for editor validation (pretext-tools) and for -V alike.

Two commits extend the allowance where a version-conditional variant makes sense:

  1. Title-like metadata elementstitle (both forms), subtitle (both forms, the reported case), shorttitle, plaintitle, creator, caption, attribution. A caption reading "the red curve" needs a variant in a black-and-white version; a title's companions travel with it.
  2. docinfo — the version mechanism's motivating example (per-version latex-image-preamble color palettes) is authored as two docinfo elements, yet @component was not allowed there.

Precedents: idx already carries the allowance, and commentary requires the attribute.

Verified: @component planted on one instance of each of the eight elements in the sample article draws exactly eight complaints from the current schema and zero from the revised schema (the total error count drops by exactly eight, nothing else moves); regenerating .rnc/.rng from unmodified source was checked clean first, so each commit pairs the literate source with its derived files.

Claude Fable 5, acting as a coding assistant for Rob Beezer

rbeezer and others added 2 commits July 27, 2026 10:53
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@rbeezer
rbeezer merged commit 8262d3d into PreTeXtBook:master Jul 27, 2026
@rbeezer
rbeezer deleted the schema-subtitle-component branch July 27, 2026 18:11
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