style(template): enforce no first-line indent for table styles; default PDF indent 2em
- Set first-line-indent: 0 on all TABLE styles in default/review docx templates to prevent table cells from inheriting Normal paragraph indentation. - Set default PDF template body first-line-indent to 2em (all: true). - Change default PDF bookmark depth from 1 to 2 in CLI and build_pdf. - Extend docx post-processing to copy Normal style typography from reference-doc, format headings/references, and handle BodyText paragraphs.
This commit is contained in:
@@ -33,7 +33,7 @@ from bin.utils import handle_errors, run_command
|
|||||||
@click.option(
|
@click.option(
|
||||||
"--bookmark-depth",
|
"--bookmark-depth",
|
||||||
type=int,
|
type=int,
|
||||||
default=1,
|
default=2,
|
||||||
help="PDF bookmark expansion depth (md→pdf only). 1=top-level only, 2=expand to second level, etc.",
|
help="PDF bookmark expansion depth (md→pdf only). 1=top-level only, 2=expand to second level, etc.",
|
||||||
)
|
)
|
||||||
@click.option("--dry-run", "-n", is_flag=True, help="Show what would be done")
|
@click.option("--dry-run", "-n", is_flag=True, help="Show what would be done")
|
||||||
|
|||||||
+2
-2
@@ -222,12 +222,12 @@ def build_pdf(
|
|||||||
template: str,
|
template: str,
|
||||||
inputs: list[Path],
|
inputs: list[Path],
|
||||||
output: Path,
|
output: Path,
|
||||||
bookmark_depth: int = 1,
|
bookmark_depth: int = 2,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Build PDF from Markdown using Typst.
|
"""Build PDF from Markdown using Typst.
|
||||||
|
|
||||||
``bookmark_depth`` controls outline expansion: ``1`` keeps only top-level
|
``bookmark_depth`` controls outline expansion: ``1`` keeps only top-level
|
||||||
bookmarks visible (default), ``2`` expands to second level, and so on.
|
bookmarks visible, ``2`` expands to second level (default), and so on.
|
||||||
"""
|
"""
|
||||||
templates_dir = templates_registry.get_md_to_pdf_root()
|
templates_dir = templates_registry.get_md_to_pdf_root()
|
||||||
template_file = templates_dir / template / "template.typ"
|
template_file = templates_dir / template / "template.typ"
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -83,8 +83,8 @@
|
|||||||
lang: "zh",
|
lang: "zh",
|
||||||
)
|
)
|
||||||
|
|
||||||
// Body rhythm: spacing > leading; first-line indent = Typst default (none)
|
// Body rhythm: spacing > leading; first-line indent = 2em for Chinese paragraphs
|
||||||
set par(justify: true, leading: 0.78em, spacing: 1.12em)
|
set par(justify: true, leading: 0.78em, spacing: 1.12em, first-line-indent: (amount: 2em, all: true))
|
||||||
|
|
||||||
// List rhythm: spacing ≥ leading (0.78em), looser than line height for readability
|
// List rhythm: spacing ≥ leading (0.78em), looser than line height for readability
|
||||||
set list(indent: 1.2em, body-indent: 0.45em, spacing: 0.90em)
|
set list(indent: 1.2em, body-indent: 0.45em, spacing: 0.90em)
|
||||||
|
|||||||
Reference in New Issue
Block a user