From a35f04cb78eb1110428ef8118590128199ad0538 Mon Sep 17 00:00:00 2001 From: Jason Siefken Date: Sun, 26 Nov 2023 12:27:23 -0500 Subject: [PATCH 1/3] Update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9cfa34a1..dfb7e155 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # unified-latex Changelog +### v1.6.0 +- Embellishment tokens are now supported in macro `signature`s. E.g., a `xxx: {signature: "e{^_}"}` will allow `\xxx_{foo}^{bar}` and `\xxx^{foo}_{bar}` to parse correctly. +- Stop tokens can now be regular string characters. For example `xxx: {signature: "ua"}` will allow `\xxx YYYaBBB` to consume `YYY` leaving `BBB` unconsumed. + ### v1.5.0 - HTML conversion: `vspace` and `hspace` now give the amount in a `data-amount` attribute. - HTML conversion: unknown macros now have their arguments wrapped in spans instead of appearing as formatted LaTeX code. From e0ae17de9c66f53d75ecb74af81381fb7dbf3a93 Mon Sep 17 00:00:00 2001 From: Jason Siefken Date: Sun, 26 Nov 2023 13:33:12 -0500 Subject: [PATCH 2/3] Added tsconfig files to each test folder --- packages/unified-latex-builder/tests/tsconfig.json | 3 +++ packages/unified-latex-cli/tests/tsconfig.json | 3 +++ packages/unified-latex-ctan/tests/tsconfig.json | 3 +++ packages/unified-latex-lint/tests/tsconfig.json | 3 +++ .../unified-latex-prettier/tests/tsconfig.json | 3 +++ .../tests/convert-to-html.test.ts | 4 ++-- packages/unified-latex-to-hast/tests/tsconfig.json | 3 +++ .../unified-latex-to-mdast/tests/tsconfig.json | 3 +++ .../unified-latex-util-align/tests/tsconfig.json | 3 +++ .../unified-latex-util-argspec/tests/tsconfig.json | 3 +++ .../tests/tsconfig.json | 3 +++ .../unified-latex-util-catcode/tests/tsconfig.json | 3 +++ .../tests/tsconfig.json | 3 +++ .../tests/tsconfig.json | 3 +++ .../unified-latex-util-glue/tests/tsconfig.json | 3 +++ .../tests/tsconfig.json | 3 +++ .../tests/tsconfig.json | 3 +++ .../unified-latex-util-macros/tests/tsconfig.json | 3 +++ .../tests/tsconfig.json | 3 +++ .../unified-latex-util-parse/tests/tsconfig.json | 3 +++ .../unified-latex-util-pgfkeys/tests/tsconfig.json | 3 +++ .../unified-latex-util-replace/tests/tsconfig.json | 3 +++ .../unified-latex-util-scan/tests/tsconfig.json | 3 +++ .../unified-latex-util-split/tests/tsconfig.json | 3 +++ .../tests/tsconfig.json | 3 +++ .../unified-latex-util-trim/tests/tsconfig.json | 3 +++ .../unified-latex-util-visit/tests/tsconfig.json | 3 +++ packages/unified-latex/tests/parse.test.ts | 2 +- packages/unified-latex/tests/tsconfig.json | 3 +++ tsconfig.build.json | 1 - tsconfig.test.json | 14 ++++++++++++++ 31 files changed, 98 insertions(+), 4 deletions(-) create mode 100644 packages/unified-latex-builder/tests/tsconfig.json create mode 100644 packages/unified-latex-cli/tests/tsconfig.json create mode 100644 packages/unified-latex-ctan/tests/tsconfig.json create mode 100644 packages/unified-latex-lint/tests/tsconfig.json create mode 100644 packages/unified-latex-prettier/tests/tsconfig.json create mode 100644 packages/unified-latex-to-hast/tests/tsconfig.json create mode 100644 packages/unified-latex-to-mdast/tests/tsconfig.json create mode 100644 packages/unified-latex-util-align/tests/tsconfig.json create mode 100644 packages/unified-latex-util-argspec/tests/tsconfig.json create mode 100644 packages/unified-latex-util-arguments/tests/tsconfig.json create mode 100644 packages/unified-latex-util-catcode/tests/tsconfig.json create mode 100644 packages/unified-latex-util-comments/tests/tsconfig.json create mode 100644 packages/unified-latex-util-environments/tests/tsconfig.json create mode 100644 packages/unified-latex-util-glue/tests/tsconfig.json create mode 100644 packages/unified-latex-util-html-like/tests/tsconfig.json create mode 100644 packages/unified-latex-util-ligatures/tests/tsconfig.json create mode 100644 packages/unified-latex-util-macros/tests/tsconfig.json create mode 100644 packages/unified-latex-util-packages/tests/tsconfig.json create mode 100644 packages/unified-latex-util-parse/tests/tsconfig.json create mode 100644 packages/unified-latex-util-pgfkeys/tests/tsconfig.json create mode 100644 packages/unified-latex-util-replace/tests/tsconfig.json create mode 100644 packages/unified-latex-util-scan/tests/tsconfig.json create mode 100644 packages/unified-latex-util-split/tests/tsconfig.json create mode 100644 packages/unified-latex-util-to-string/tests/tsconfig.json create mode 100644 packages/unified-latex-util-trim/tests/tsconfig.json create mode 100644 packages/unified-latex-util-visit/tests/tsconfig.json create mode 100644 packages/unified-latex/tests/tsconfig.json create mode 100644 tsconfig.test.json diff --git a/packages/unified-latex-builder/tests/tsconfig.json b/packages/unified-latex-builder/tests/tsconfig.json new file mode 100644 index 00000000..ecae1701 --- /dev/null +++ b/packages/unified-latex-builder/tests/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.test.json" +} diff --git a/packages/unified-latex-cli/tests/tsconfig.json b/packages/unified-latex-cli/tests/tsconfig.json new file mode 100644 index 00000000..ecae1701 --- /dev/null +++ b/packages/unified-latex-cli/tests/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.test.json" +} diff --git a/packages/unified-latex-ctan/tests/tsconfig.json b/packages/unified-latex-ctan/tests/tsconfig.json new file mode 100644 index 00000000..ecae1701 --- /dev/null +++ b/packages/unified-latex-ctan/tests/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.test.json" +} diff --git a/packages/unified-latex-lint/tests/tsconfig.json b/packages/unified-latex-lint/tests/tsconfig.json new file mode 100644 index 00000000..ecae1701 --- /dev/null +++ b/packages/unified-latex-lint/tests/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.test.json" +} diff --git a/packages/unified-latex-prettier/tests/tsconfig.json b/packages/unified-latex-prettier/tests/tsconfig.json new file mode 100644 index 00000000..ecae1701 --- /dev/null +++ b/packages/unified-latex-prettier/tests/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.test.json" +} diff --git a/packages/unified-latex-to-hast/tests/convert-to-html.test.ts b/packages/unified-latex-to-hast/tests/convert-to-html.test.ts index d1dc267f..b01d96fa 100644 --- a/packages/unified-latex-to-hast/tests/convert-to-html.test.ts +++ b/packages/unified-latex-to-hast/tests/convert-to-html.test.ts @@ -90,9 +90,9 @@ describe("unified-latex-to-hast:convert-to-html", () => { }, }) .use(rehypeStringify) - .processSync(value).value; + .processSync(value).value as string; - let ast; + let ast: string; ast = convert(`\\includegraphics{myfile.pdf}`); expect(normalizeHtml(ast)).toEqual( diff --git a/packages/unified-latex-to-hast/tests/tsconfig.json b/packages/unified-latex-to-hast/tests/tsconfig.json new file mode 100644 index 00000000..ecae1701 --- /dev/null +++ b/packages/unified-latex-to-hast/tests/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.test.json" +} diff --git a/packages/unified-latex-to-mdast/tests/tsconfig.json b/packages/unified-latex-to-mdast/tests/tsconfig.json new file mode 100644 index 00000000..ecae1701 --- /dev/null +++ b/packages/unified-latex-to-mdast/tests/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.test.json" +} diff --git a/packages/unified-latex-util-align/tests/tsconfig.json b/packages/unified-latex-util-align/tests/tsconfig.json new file mode 100644 index 00000000..ecae1701 --- /dev/null +++ b/packages/unified-latex-util-align/tests/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.test.json" +} diff --git a/packages/unified-latex-util-argspec/tests/tsconfig.json b/packages/unified-latex-util-argspec/tests/tsconfig.json new file mode 100644 index 00000000..ecae1701 --- /dev/null +++ b/packages/unified-latex-util-argspec/tests/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.test.json" +} diff --git a/packages/unified-latex-util-arguments/tests/tsconfig.json b/packages/unified-latex-util-arguments/tests/tsconfig.json new file mode 100644 index 00000000..ecae1701 --- /dev/null +++ b/packages/unified-latex-util-arguments/tests/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.test.json" +} diff --git a/packages/unified-latex-util-catcode/tests/tsconfig.json b/packages/unified-latex-util-catcode/tests/tsconfig.json new file mode 100644 index 00000000..ecae1701 --- /dev/null +++ b/packages/unified-latex-util-catcode/tests/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.test.json" +} diff --git a/packages/unified-latex-util-comments/tests/tsconfig.json b/packages/unified-latex-util-comments/tests/tsconfig.json new file mode 100644 index 00000000..ecae1701 --- /dev/null +++ b/packages/unified-latex-util-comments/tests/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.test.json" +} diff --git a/packages/unified-latex-util-environments/tests/tsconfig.json b/packages/unified-latex-util-environments/tests/tsconfig.json new file mode 100644 index 00000000..ecae1701 --- /dev/null +++ b/packages/unified-latex-util-environments/tests/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.test.json" +} diff --git a/packages/unified-latex-util-glue/tests/tsconfig.json b/packages/unified-latex-util-glue/tests/tsconfig.json new file mode 100644 index 00000000..ecae1701 --- /dev/null +++ b/packages/unified-latex-util-glue/tests/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.test.json" +} diff --git a/packages/unified-latex-util-html-like/tests/tsconfig.json b/packages/unified-latex-util-html-like/tests/tsconfig.json new file mode 100644 index 00000000..ecae1701 --- /dev/null +++ b/packages/unified-latex-util-html-like/tests/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.test.json" +} diff --git a/packages/unified-latex-util-ligatures/tests/tsconfig.json b/packages/unified-latex-util-ligatures/tests/tsconfig.json new file mode 100644 index 00000000..ecae1701 --- /dev/null +++ b/packages/unified-latex-util-ligatures/tests/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.test.json" +} diff --git a/packages/unified-latex-util-macros/tests/tsconfig.json b/packages/unified-latex-util-macros/tests/tsconfig.json new file mode 100644 index 00000000..ecae1701 --- /dev/null +++ b/packages/unified-latex-util-macros/tests/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.test.json" +} diff --git a/packages/unified-latex-util-packages/tests/tsconfig.json b/packages/unified-latex-util-packages/tests/tsconfig.json new file mode 100644 index 00000000..ecae1701 --- /dev/null +++ b/packages/unified-latex-util-packages/tests/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.test.json" +} diff --git a/packages/unified-latex-util-parse/tests/tsconfig.json b/packages/unified-latex-util-parse/tests/tsconfig.json new file mode 100644 index 00000000..ecae1701 --- /dev/null +++ b/packages/unified-latex-util-parse/tests/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.test.json" +} diff --git a/packages/unified-latex-util-pgfkeys/tests/tsconfig.json b/packages/unified-latex-util-pgfkeys/tests/tsconfig.json new file mode 100644 index 00000000..ecae1701 --- /dev/null +++ b/packages/unified-latex-util-pgfkeys/tests/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.test.json" +} diff --git a/packages/unified-latex-util-replace/tests/tsconfig.json b/packages/unified-latex-util-replace/tests/tsconfig.json new file mode 100644 index 00000000..ecae1701 --- /dev/null +++ b/packages/unified-latex-util-replace/tests/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.test.json" +} diff --git a/packages/unified-latex-util-scan/tests/tsconfig.json b/packages/unified-latex-util-scan/tests/tsconfig.json new file mode 100644 index 00000000..ecae1701 --- /dev/null +++ b/packages/unified-latex-util-scan/tests/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.test.json" +} diff --git a/packages/unified-latex-util-split/tests/tsconfig.json b/packages/unified-latex-util-split/tests/tsconfig.json new file mode 100644 index 00000000..ecae1701 --- /dev/null +++ b/packages/unified-latex-util-split/tests/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.test.json" +} diff --git a/packages/unified-latex-util-to-string/tests/tsconfig.json b/packages/unified-latex-util-to-string/tests/tsconfig.json new file mode 100644 index 00000000..ecae1701 --- /dev/null +++ b/packages/unified-latex-util-to-string/tests/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.test.json" +} diff --git a/packages/unified-latex-util-trim/tests/tsconfig.json b/packages/unified-latex-util-trim/tests/tsconfig.json new file mode 100644 index 00000000..ecae1701 --- /dev/null +++ b/packages/unified-latex-util-trim/tests/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.test.json" +} diff --git a/packages/unified-latex-util-visit/tests/tsconfig.json b/packages/unified-latex-util-visit/tests/tsconfig.json new file mode 100644 index 00000000..ecae1701 --- /dev/null +++ b/packages/unified-latex-util-visit/tests/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.test.json" +} diff --git a/packages/unified-latex/tests/parse.test.ts b/packages/unified-latex/tests/parse.test.ts index 66065c26..4126a9d7 100644 --- a/packages/unified-latex/tests/parse.test.ts +++ b/packages/unified-latex/tests/parse.test.ts @@ -1,8 +1,8 @@ import { trimRenderInfo } from "@unified-latex/unified-latex-util-render-info"; import { VFile } from "unified-lint-rule/lib"; import util from "util"; -import { processLatexToAstViaUnified } from ".."; import "../../test-common"; +import { processLatexToAstViaUnified } from "../libs/unified-latex"; /* eslint-env jest */ diff --git a/packages/unified-latex/tests/tsconfig.json b/packages/unified-latex/tests/tsconfig.json new file mode 100644 index 00000000..ecae1701 --- /dev/null +++ b/packages/unified-latex/tests/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.test.json" +} diff --git a/tsconfig.build.json b/tsconfig.build.json index 8090c793..1515ae6c 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -29,7 +29,6 @@ "declarationMap": true, "moduleResolution": "node", "resolveJsonModule": true, - "types": ["vitest/globals"], "paths": { "@unified-latex/*": ["./packages/*"] } diff --git a/tsconfig.test.json b/tsconfig.test.json new file mode 100644 index 00000000..c3e640e2 --- /dev/null +++ b/tsconfig.test.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.build.json", + "include": [ + "**/*.ts" + ], + "exclude": ["**/*.d.ts", "node_modules", "scripts", "*.config.ts"], + "compilerOptions": { + "rootDir": "./packages", + "paths": { + "@unified-latex/*": ["./packages/dist/*"] + }, + "types": ["vitest/globals"] + } +} From f53a507c9b0919dc19d44871e6d4791e60ed6f90 Mon Sep 17 00:00:00 2001 From: Jason Siefken Date: Sun, 26 Nov 2023 22:12:55 -0500 Subject: [PATCH 3/3] Break after \\ macro --- CHANGELOG.md | 2 ++ package-lock.json | 7 +++++-- packages/test-common/index.ts | 8 +------- .../package/latex2e/provides.ts | 2 +- packages/unified-latex-ctan/tsconfig.json | 1 + .../tests/formatting-tikz.test.ts | 12 ++++++++++-- .../tests/formatting.test.ts | 10 +++++++++- packages/unified-latex-types/libs/info-specs.ts | 15 ++++++++++++++- .../libs/gobble-arguments.ts | 1 - 9 files changed, 43 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dfb7e155..09be9919 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ ### v1.6.0 - Embellishment tokens are now supported in macro `signature`s. E.g., a `xxx: {signature: "e{^_}"}` will allow `\xxx_{foo}^{bar}` and `\xxx^{foo}_{bar}` to parse correctly. - Stop tokens can now be regular string characters. For example `xxx: {signature: "ua"}` will allow `\xxx YYYaBBB` to consume `YYY` leaving `BBB` unconsumed. +- Break after `\\` macro when pretty printing (Issue #59) +- [DEVELOPMENT] Added `tsconfig.json` files to each `test/` folder for more granular control of the typescript settings. ### v1.5.0 - HTML conversion: `vspace` and `hspace` now give the amount in a `data-amount` attribute. diff --git a/package-lock.json b/package-lock.json index 786ff92b..086660c0 100755 --- a/package-lock.json +++ b/package-lock.json @@ -6,9 +6,12 @@ "": { "name": "unified-latex", "workspaces": [ + "./packages/structured-clone", + "./packages/support-tables", "./packages/unified-latex-util-pegjs", - "./packages/*", - "./packages/unified-latex-cli" + "./packages/unified-latex-util-*", + "./packages/unified-latex-to-*", + "./packages/*" ], "dependencies": { "@types/color": "^3.0.4", diff --git a/packages/test-common/index.ts b/packages/test-common/index.ts index 5043a53a..6676fcb1 100644 --- a/packages/test-common/index.ts +++ b/packages/test-common/index.ts @@ -30,13 +30,7 @@ expect.extend({ inStr )}\n\nthe output did ${ pass ? "" : "not" - } format correctly\n\n${this.utils.printDiffOrStringify( - outStr, - formatted, - "Expected", - "Received", - false - )}`, + } format correctly\n\n${this.utils.diff(outStr, formatted)}`, }; }, }); diff --git a/packages/unified-latex-ctan/package/latex2e/provides.ts b/packages/unified-latex-ctan/package/latex2e/provides.ts index 14381b0c..a82482d4 100644 --- a/packages/unified-latex-ctan/package/latex2e/provides.ts +++ b/packages/unified-latex-ctan/package/latex2e/provides.ts @@ -7,7 +7,7 @@ import { cleanEnumerateBody } from "../../utils/enumerate"; export const macros: MacroInfoRecord = { // Special - "\\": { signature: "!s !o" }, + "\\": { signature: "!s !o", renderInfo: { breakAfter: true } }, _: { signature: "m", escapeToken: "" }, "^": { signature: "m", escapeToken: "" }, // \newcommand arg signature from https://www.texdev.net/2020/08/19/the-good-the-bad-and-the-ugly-creating-document-commands diff --git a/packages/unified-latex-ctan/tsconfig.json b/packages/unified-latex-ctan/tsconfig.json index 8a21068e..7ed18c6d 100644 --- a/packages/unified-latex-ctan/tsconfig.json +++ b/packages/unified-latex-ctan/tsconfig.json @@ -6,6 +6,7 @@ }, "include": ["./**/*.ts", "./package/**/*.ts"], "references": [ + { "path": "../structured-clone" }, { "path": "../unified-latex-types" }, { "path": "../unified-latex-builder" }, { "path": "../unified-latex-util-argspec" }, diff --git a/packages/unified-latex-prettier/tests/formatting-tikz.test.ts b/packages/unified-latex-prettier/tests/formatting-tikz.test.ts index 13c2dab8..164d3c5e 100644 --- a/packages/unified-latex-prettier/tests/formatting-tikz.test.ts +++ b/packages/unified-latex-prettier/tests/formatting-tikz.test.ts @@ -3,6 +3,14 @@ import { prettierPluginLatex } from "../libs/prettier-plugin-latex"; import "../../test-common"; import * as fs from "node:fs/promises"; import path from "node:path"; +import { createRequire } from "module"; +const require = createRequire(import.meta.url); + +const PACKAGE_ROOT = path.join( + require.resolve("@unified-latex/unified-latex-prettier"), + "..", + ".." +); /* eslint-env jest */ const formatter = async (x: string) => @@ -84,13 +92,13 @@ describe("unified-latex-prettier", () => { it("prints tikz samples", async () => { // ts-ignore const inStr = await fs.readFile( - "./packages/unified-latex-prettier/tests/samples/tikz/unformatted.tex", + path.join(PACKAGE_ROOT, "./tests/samples/tikz/unformatted.tex"), { encoding: "utf-8", } ); const outStr = await fs.readFile( - "./packages/unified-latex-prettier/tests/samples/tikz/formatted-wide.tex", + path.join(PACKAGE_ROOT, "./tests/samples/tikz/formatted-wide.tex"), { encoding: "utf-8", } diff --git a/packages/unified-latex-prettier/tests/formatting.test.ts b/packages/unified-latex-prettier/tests/formatting.test.ts index 829be7de..64ba7364 100644 --- a/packages/unified-latex-prettier/tests/formatting.test.ts +++ b/packages/unified-latex-prettier/tests/formatting.test.ts @@ -713,7 +713,15 @@ c }); it("Double backslash macro doesn't absorb optional argument if there's a space in front (issue #40)", async () => { - const STRINGS = [{ inStr: "\\\\ [2pt]", outStr: "\\\\ [2pt]" }]; + const STRINGS = [{ inStr: "\\\\ [2pt]", outStr: "\\\\\n[2pt]" }]; + + for (const { inStr, outStr } of STRINGS) { + await expect(inStr).toFormatAs(outStr, formatter); + } + }); + + it("Double backslash forces a newline in text mode (issue #12)", async () => { + const STRINGS = [{ inStr: "a\\\\b", outStr: "a\\\\\nb" }]; for (const { inStr, outStr } of STRINGS) { await expect(inStr).toFormatAs(outStr, formatter); diff --git a/packages/unified-latex-types/libs/info-specs.ts b/packages/unified-latex-types/libs/info-specs.ts index 238e89d9..6957f313 100644 --- a/packages/unified-latex-types/libs/info-specs.ts +++ b/packages/unified-latex-types/libs/info-specs.ts @@ -73,13 +73,26 @@ export type MacroInfo = { * @type {boolean} */ pgfkeysArgs?: boolean; + /** + * Whether there should be line breaks after the macro + * (e.g., like the `\\` command.) + * + * @type {boolean} + */ + breakAfter?: boolean; /** * Whether there should be line breaks before and after the macro - * (e.g., like the \section{...} command.) + * (e.g., like the `\section{...}` command.) * * @type {boolean} */ breakAround?: boolean; + /** + * Whether there should be line breaks before the macro. + * + * @type {boolean} + */ + breakBefore?: boolean; /** * Whether the contents of the macro should be assumed to be in math mode. * diff --git a/packages/unified-latex-util-arguments/libs/gobble-arguments.ts b/packages/unified-latex-util-arguments/libs/gobble-arguments.ts index 004ac706..a68a2655 100644 --- a/packages/unified-latex-util-arguments/libs/gobble-arguments.ts +++ b/packages/unified-latex-util-arguments/libs/gobble-arguments.ts @@ -1,4 +1,3 @@ -import { structuredClone } from "@unified-latex/structured-clone"; import { arg } from "@unified-latex/unified-latex-builder"; import * as Ast from "@unified-latex/unified-latex-types"; import { ArgumentParser } from "@unified-latex/unified-latex-types";