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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ Instructions: Add a subsection under `[Unreleased]` for additions, fixes, change

## [Unreleased]

### Added
- Experimental support for beamer format builds (from a `<slideshow>`). Use `<target name="slides" format="beamer"/>` in the manifest to build a beamer PDF.
- Publication variable to use cdn javascript/css for HTML output instead of local copies.

### Fixed
- Better heading levels for HTML output to improve accessibility.

## [2.43.2] - 2026-07-07

Includes updates to core through commit: [ad605bb](https://github.com/PreTeXtBook/pretext/commit/ad605bb27faf9f12c2bcb3b98ea953533f1aacb4)
Expand Down
49 changes: 10 additions & 39 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions pretext/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@

VERSION = get_version("pretext", Path(__file__).parent.parent)


CORE_COMMIT = "ad605bb27faf9f12c2bcb3b98ea953533f1aacb4"
CORE_COMMIT = "07c8b5c9a9a55e95ec27073e88bd5c9c61b9c161"


def activate() -> None:
Expand Down
22 changes: 22 additions & 0 deletions pretext/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"kindle",
"braille",
"revealjs",
"beamer",
"webwork",
"custom",
]
Expand Down Expand Up @@ -123,6 +124,20 @@
"datafile",
"myopenmath",
],
"beamer": [
"webwork",
"sageplot",
"asymptote",
"prefigure",
"youtube",
"codelens",
"datafile",
"interactive",
"qrcode",
"mermaid",
"myopenmath",
"dynamic-subs",
],
"webwork": [
"webwork",
],
Expand Down Expand Up @@ -239,6 +254,13 @@
"sageplot": ["html", "svg"],
"prefigure": ["svg"],
},
"beamer": {
"asymptote": ["pdf"],
"latex-image": [],
"sageplot": ["pdf", "png"],
"prefigure": ["pdf"],
"mermaid": ["png"],
},
"webwork": {
"asymptote": [],
"latex-image": [],
Expand Down
15 changes: 15 additions & 0 deletions pretext/project/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class Format(str, Enum):
KINDLE = "kindle"
BRAILLE = "braille"
REVEALJS = "revealjs"
BEAMER = "beamer"
WEBWORK = "webwork"
CUSTOM = "custom"

Expand All @@ -67,6 +68,7 @@ class Format(str, Enum):
Format.EPUB: ".epub",
Format.KINDLE: ".epub",
Format.BRAILLE: ".brl",
Format.BEAMER: ".pdf",
}


Expand Down Expand Up @@ -874,6 +876,7 @@ def build(
dest_dir=self.output_dir_abspath().as_posix(),
method=self.pdf_method,
outputs="all" if latex else "pdf-only",
format_xsl=None,
)
elif self.format == Format.LATEX:
core.pdf(
Expand All @@ -885,6 +888,7 @@ def build(
dest_dir=self.output_dir_abspath().as_posix(),
method=self.pdf_method,
outputs="prebuild",
format_xsl=None,
)
elif self.format == Format.EPUB:
utils.mjsre_npm_install()
Expand Down Expand Up @@ -930,6 +934,17 @@ def build(
out_file=out_file,
dest_dir=self.output_dir_abspath().as_posix(),
)
elif self.format == Format.BEAMER:
core.beamer(
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(),
method=self.pdf_method,
outputs="all" if latex else "pdf-only",
)
elif self.format == Format.BRAILLE:
log.warning(
"Braille output is still experimental, and requires additional libraries from liblouis (specifically the file2brl software)."
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ plastex = "^3"
jinja2 = "^3"
coloraide = "^4"
pelican = { extras = ["markdown"], version = "^4.10", optional = true }
prefig = { extras = ["text"], version = "^0.6.5", optional = true }
prefig = { extras = ["text"], version = "^0.6.7", optional = true }
citeproc-py = "^0"


Expand Down
11 changes: 9 additions & 2 deletions schema/project-ptx.rnc
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,15 @@ Target = element target {
## Unique identifier for this build target. This is the name you pass on the
## command line when building via the `pretext` CLI.
attribute name { text },
## the required format can be `html`, `pdf`, `latex`, `epub`, `kindle`, `braille`, `revealjs`, `webwork`, or `custom`.
## the required format can be `html`, `pdf`, `latex`, `epub`, `kindle`, `braille`, `revealjs`, `beamer`, `webwork`, or `custom`.
(
HtmlAttributes
| PdfAttributes
| LatexAttributes
| EpubAttributes
| BrailleAttributes
| RevealjsAttributes
| BeamerAttributes
| WebworkAttributes
| CustomAttributes
),
Expand Down Expand Up @@ -81,6 +82,7 @@ HtmlAttributes = (

PdfAttributes = (
attribute format { "pdf" },
attribute pdf-method { "xelatex" | "pdflatex" | "latex" | "pdf-fo"}?,
attribute latex-engine { "xelatex" | "pdflatex" | "latex" }?,
attribute output-filename { text }?
)
Expand All @@ -105,6 +107,11 @@ RevealjsAttributes = (
attribute output-filename { text }?
)

BeamerAttributes = (
attribute format { "beamer" },
attribute output-filename { text }?
)

WebworkAttributes = (
attribute format { "webwork" },
attribute compression { "zip" }?
Expand All @@ -127,4 +134,4 @@ Stringparams = element stringparams {
attribute html.css.extra { text }?
}

}
}
21 changes: 20 additions & 1 deletion schema/project-ptx.rng
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,14 @@
command line when building via the `pretext` CLI.</a:documentation>
</attribute>
<choice>
<a:documentation>the required format can be `html`, `pdf`, `latex`, `epub`, `kindle`, `braille`, `revealjs`, `webwork`, or `custom`.</a:documentation>
<a:documentation>the required format can be `html`, `pdf`, `latex`, `epub`, `kindle`, `braille`, `revealjs`, `beamer`, `webwork`, or `custom`.</a:documentation>
<ref name="HtmlAttributes"/>
<ref name="PdfAttributes"/>
<ref name="LatexAttributes"/>
<ref name="EpubAttributes"/>
<ref name="BrailleAttributes"/>
<ref name="RevealjsAttributes"/>
<ref name="BeamerAttributes"/>
<ref name="WebworkAttributes"/>
<ref name="CustomAttributes"/>
</choice>
Expand Down Expand Up @@ -158,6 +159,16 @@ These parameters are rarely used by content authors.</a:documentation>
<attribute name="format">
<value>pdf</value>
</attribute>
<optional>
<attribute name="pdf-method">
<choice>
<value>xelatex</value>
<value>pdflatex</value>
<value>latex</value>
<value>pdf-fo</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="latex-engine">
<choice>
Expand Down Expand Up @@ -211,6 +222,14 @@ These parameters are rarely used by content authors.</a:documentation>
<attribute name="output-filename"/>
</optional>
</define>
<define name="BeamerAttributes">
<attribute name="format">
<value>beamer</value>
</attribute>
<optional>
<attribute name="output-filename"/>
</optional>
</define>
<define name="WebworkAttributes">
<attribute name="format">
<value>webwork</value>
Expand Down
Binary file not shown.
Loading