Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ Instructions: Add a subsection under `[Unreleased]` for additions, fixes, change

## [Unreleased]

### Added

- PDF targets built with `--latex` flag will include the latex source in the output directory.

## [2.31.0] - 2025-11-20

Includes updates to core through commit: [65231d1](https://github.com/PreTeXtBook/pretext/commit/65231d1891e6a60f9e9d4873520e5d3e849e59b3)
Expand Down
13 changes: 0 additions & 13 deletions new-pretext-project1/logs/.fuse_hidden0006e26600000258

This file was deleted.

13 changes: 0 additions & 13 deletions new-pretext-project1/logs/.fuse_hidden0006e27000000230

This file was deleted.

2 changes: 1 addition & 1 deletion pretext/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
VERSION = get_version("pretext", Path(__file__).parent.parent)


CORE_COMMIT = "65231d1891e6a60f9e9d4873520e5d3e849e59b3"
CORE_COMMIT = "ce20f15d525f2d1e7a3c3fb8da3bb5fa9d16d3ee"


def activate() -> None:
Expand Down
13 changes: 12 additions & 1 deletion pretext/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,12 @@ def init(refresh: bool, files: List[str], system: bool) -> None:
is_flag=True,
help="Only build the theme for the target, without performing any other build or generate steps. (Themes are automatically built when building a target.)",
)
@click.option(
"-l",
"--latex",
is_flag=True,
help="When building a PDF, also place LaTeX source files in the output directory for inspection or manual compilation.",
)
@click.option(
"-x",
"--xmlid",
Expand Down Expand Up @@ -514,6 +520,7 @@ def build(
generate: bool,
no_generate: bool,
theme: bool,
latex: bool,
xmlid: Optional[str],
no_knowls: bool,
deploys: bool,
Expand Down Expand Up @@ -627,7 +634,11 @@ def build(
if xmlid is not None:
log.info(f"with root of tree below {xmlid}")
t.build(
clean=clean, generate=not no_generate, xmlid=xmlid, no_knowls=no_knowls
clean=clean,
generate=not no_generate,
xmlid=xmlid,
no_knowls=no_knowls,
latex=latex,
)
if t.format == "html" and t.compression is None:
log.info(
Expand Down
11 changes: 5 additions & 6 deletions pretext/project/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,7 @@ def build(
generate: bool = True,
xmlid: t.Optional[str] = None,
no_knowls: bool = False,
latex: bool = False,
) -> None:
# Add cli.version to stringparams. Use only the major and minor version numbers.
self.stringparams["cli.version"] = VERSION[: VERSION.rfind(".")]
Expand Down Expand Up @@ -776,20 +777,18 @@ def build(
out_file=out_file,
dest_dir=self.output_dir_abspath().as_posix(),
method=self.latex_engine,
outputs="all" if latex else "pdf",
)
elif self.format == Format.LATEX:
core.latex(
core.pdf(
xml=self.source_abspath(),
pub_file=self.publication_abspath().as_posix(),
stringparams=stringparams_copy,
extra_xsl=custom_xsl,
out_file=out_file,
dest_dir=self.output_dir_abspath().as_posix(),
)
utils.manage_directories(
self.output_dir_abspath(),
external_abs=self.external_dir_abspath(),
generated_abs=self.generated_dir_abspath(),
method=self.latex_engine,
outputs="prebuild",
)
elif self.format == Format.EPUB:
utils.mjsre_npm_install()
Expand Down