Skip to content

Add \dims macro for dimension annotations (#79) - #80

Merged
dem-extra1 merged 4 commits into
mainfrom
79-dim-macro
Aug 24, 2026
Merged

dem-extra1 merged 4 commits into
mainfrom
79-dim-macro

Conversation

@dem-extra1

@dem-extra1 dem-extra1 commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Adds a \dims macro for annotating expressions with their dimensions, per #79.

Usage

\dims{\mX}{n \times p}

renders as

$$\dims{\mX}{n \times p} \eqdef \underbrace{\mX}_{n \times p}$$

so instead of writing the full \underbrace form you write the annotation semantically.

Definition

\providecommand{\dims}[2]{\ub{#1}_{#2}}

placed alongside the existing \ub / \ubf underbrace shorthands.

Notes

  • Using \dims avoids clobbering the standard LaTeX/MathJax \dim math operator (e.g. $\dim(V)$), allowing clean definition via \providecommand.
  • Added the required interpretations.tsv entry (\dims).

Verification

  • Syntax & comment check (macros.qmd has no comments)
  • TSV interpretation mapping check (macros-table.qmd parsing requirements met)
  • CI preview build

Closes #79.

@dem-extra1
dem-extra1 marked this pull request as ready for review August 24, 2026 08:29
@dem-extra1
dem-extra1 requested a review from d-morrison August 24, 2026 08:31
@dem-extra1 dem-extra1 changed the title Add \dim macro for dimension annotations (#79) Add \dims macro for dimension annotations (#79) Aug 24, 2026
@dem-extra1
dem-extra1 merged commit a63f1a0 into main Aug 24, 2026
1 check passed
@dem-extra1
dem-extra1 deleted the 79-dim-macro branch August 24, 2026 17:00
@github-actions

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.

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.

add a macro for annotating a matrix with its dimensions

2 participants