These are TypeScript APIs compiled into SnapTeX; a .tex project cannot load them at runtime.
function name(...) is a helper that your rule imports and calls.
apply(...), render(...), extract(...), and collect(...) are callbacks that your rule implements and SnapTeX calls.
renderer.name(...), context.name(...), input.name(...), and deps.name(...) are methods SnapTeX supplies to callbacks; do not import or construct them.
service.name(...) is an instance method called after your host or test constructs PreviewUpdateService.
Register extension declarations through SNAP_TEX_RULES in src/rules.ts. See Source API Scope for imports, value ownership, output safety, rebuilds, and testing.
Removes or masks unescaped LaTeX line comments. Use remove for rendered text and mask when source line/offset relationships must remain meaningful.
stripLatexCommentsHow to read this API
These are TypeScript APIs compiled into SnapTeX; a
.texproject cannot load them at runtime.function name(...)is a helper that your rule imports and calls.apply(...),render(...),extract(...), andcollect(...)are callbacks that your rule implements and SnapTeX calls.renderer.name(...),context.name(...),input.name(...), anddeps.name(...)are methods SnapTeX supplies to callbacks; do not import or construct them.service.name(...)is an instance method called after your host or test constructsPreviewUpdateService.Register extension declarations through
SNAP_TEX_RULESinsrc/rules.ts. See Source API Scope for imports, value ownership, output safety, rebuilds, and testing.Removes or masks unescaped LaTeX line comments. Use
removefor rendered text andmaskwhen source line/offset relationships must remain meaningful.Signature
Modes
remove(default)mask%, preserving line count and TeX comment semanticsReturns
A new source string. Escaped
\\%sequences are preserved.Call relationships
skipLatexWhitespace, which advances an index without rewriting text.Choose
maskwhen offsets or line mappings must remain meaningful.See also
skipLatexWhitespace