[NEW] Program fragment element

8 views
Skip to first unread message

Andrew Scholer

unread,
Mar 22, 2025, 12:09:02 PM3/22/25
to pretext-...@googlegroups.com
The new element <pf> allows for the inclusion of inline fragments of programs complete with syntax highlighting. When using it instead of the more general inline verbatim text element <c>, the text styling should match the colors used in a <program>.

The language to use for highlighting is determined by the same document level default language used by <program> and can be overridden on a particular <pf> via the @language attribute. See the guide subsection on Program Fragments for authoring details:
https://pretextbook.org/doc/guide/html/topic-program.html#program-fragments

Please raise questions or issues on the pretext-support mailing list.

Note for users of pdflatex: There may be an issue with the preexisting LaTeX setup and the \lstinline macro used by <pf>. If you encounter an issue building a document with program fragments using pdflatex, please report it on this GitHub issue:
Reply all
Reply to author
Forward
0 new messages