Skip to content

Expose custom page styles via a <pagestyle> LTML tag #39

@rowland

Description

@rowland

Summary

LTML currently does not provide a markup-level way to define custom page styles. Users can reference built-in page sizes through the style attribute on <page>, but defining a new PageStyle still requires adding it in Go code.

Problem

This makes custom page sizes and reusable page configurations harder to author and share in LTML documents. It also creates an inconsistency with other style concepts in LTML, which are generally exposed through markup.

Proposal

Add a dedicated <pagestyle> tag that exposes PageStyle definitions in LTML.

Example:

<ltml>
  <pagestyle id="statement" width="8.5in" height="11in" margin="0.5in" />
  <page style="statement">
    ...
  </page>
</ltml>

Desired Behavior

  • <pagestyle> defines a named PageStyle in the current scope.
  • Custom page styles can be referenced from <page style="...">.
  • Page-scoped definitions remain page-local; document-scoped definitions remain visible to descendant pages.
  • Built-in page styles continue to work unchanged.
  • This should remove the need to register custom PageStyle values in Go code for common LTML authoring cases.

Notes

The current docs already note that PageStyle is effectively not exposed through normal LTML parsing because <page> is consumed as the concrete page element. A separate <pagestyle> tag would avoid that collision cleanly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions