TeXSmith Fragment - HEIG-VD Logo
A TeXSmith fragment that drops the HEIG-VD letterhead logo on the first page of a document.
Install
uv add texsmith-fragment-heig-logo
# or
pip install texsmith-fragment-heig-logo
The package registers a heiglogo fragment via the
texsmith.fragments entry-point group, so TeXSmith picks it up
automatically — no path configuration needed.
Usage
In your document's YAML front matter (or in texsmith.yaml), append the
fragment to the rendering pipeline:
press:
template: article
fragments:
append:
- heiglogo
heiglogo:
color: false # set to true for the red HEIG-VD logo
year: auto # auto | 1998 | 2004 | 2009 | 2020
(The legacy top-level fragments: key is still honoured by TeXSmith 0.8.)
The logo is positioned 1 cm from the top-left of the page on every page of the document.
Logo vintages
The bundled package supports the historical HEIG-VD logos (its vintages):
1998, 2004, 2009 and 2020 (the current letterhead). Pick one in two
ways:
-
Explicitly — set
heiglogo.yearto a vintage:heiglogo: year: 2004
-
Automatically from the document date (the default,
year: auto) — the vintage in force when the document was written is selected from the front matterdate. Each vintage applies from its introduction year up to the next one:Document dateLogo vintage before 2004 19982004 – 2008 20042009 – 2019 20092020 and later 2020When no usable date is available, the current logo (
2020) is used.
Attributes
| Attribute | Default | Description |
|---|---|---|
heiglogo.color |
false |
Render the logo in HEIG-VD red (e1251b) instead of black. |
heiglogo.year |
auto |
Logo vintage: auto (from the document date), or one of 1998, 2004, 2009, 2020. |
Demo
demo/demo.sh renders the same document across several dates and explicit
vintages, then compiles a PDF for each so you can compare the logos:
./demo/demo.sh # render + build PDFs with xelatex
NO_BUILD=1 ./demo/demo.sh # LaTeX only, no PDF
Output (one folder per scenario) lands under demo/output/.
Requirements
- TeXSmith ≥ 0.8, < 1.0
- A LaTeX engine with
xelatexorlualatex(the bundledheiglogo.styusesfontspecand refusespdflatex). - The
TeX Gyre Herosfont family (already present in standard TeX Live distributions).
How it works
The package ships these files under
src/texsmith_fragment_heig_logo/fragment/:
heiglogo.sty— the docstrip-generated LaTeX package (now multi-vintage).heiglogo.jinja.tex— a one-line Jinja template that calls\AddToShipoutPictureBG*{\logo[..., year=NNNN]}.fragment.toml— the manifest TeXSmith reads when the fragment is resolved by path; it names the sameentrypointas thetexsmith.fragmentsentry point, so both routes yield the same object.
Choosing the vintage from the document date needs a little Python, so the
fragment is registered as an object rather than a bare directory.
_fragment.py defines HeigLogoFragment, a TeXSmith BaseFragment whose
build_config() reads the date from the render context and resolves the
vintage (the pure logic lives in _vintage.py). The entry point is a lazy
factory:
[project.entry-points."texsmith.fragments"]
heiglogo = "texsmith_fragment_heig_logo:load_fragment"
When TeXSmith starts, its FragmentRegistry._discover_entry_points() scans
the texsmith.fragments group, calls load_fragment(), and registers the
returned fragment as if it were built-in. The factory is lazy (and the
package avoids importing TeXSmith at module load) to sidestep a circular
import: TeXSmith builds its registry while it is itself being imported.
Regenerating heiglogo.sty from upstream
heiglogo.sty is a generated artefact; the canonical sources live at
HEIG-VD/logos as a .dtx file. To
refresh the bundled copy:
git clone https://github.com/HEIG-VD/logos
cd logos/heig-vd/latex
latex heiglogo.ins # docstrip: heiglogo.dtx -> heiglogo.sty
cp heiglogo.sty <this-repo>/src/texsmith_fragment_heig_logo/fragment/heiglogo.sty
Then make the copy self-contained: upstream's \ProvidesPackage line
expands \HeigGitDate / \HeigGitTag, which are CI-generated into
version.tex (only the documentation driver defines fallbacks). Insert
matching \providecommand lines just after \NeedsTeXFormat, using the
vendored commit's date and short hash, e.g.:
\providecommand\HeigGitDate{2026/06/04}
\providecommand\HeigGitTag{34e9c6e}
Bump the package version and commit.
Licence
- The wrapper code (Python module, manifest, Jinja template, build
configuration) is released under the MIT license — see
LICENSE. - The bundled
heiglogo.styfile is distributed under the LaTeX Project Public License (LPPL) 1.3c or later — seeLICENSE-LPPLand the upstream repository.
Metadata
Release files for texsmith-fragment-heig-logo 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| texsmith_fragment_heig_logo-0.2.0.tar.gz | 21.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| texsmith_fragment_heig_logo-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 40.7 kB
Release files / texsmith_fragment_heig_logo-0.2.0.tar.gz
| Download URL | texsmith_fragment_heig_logo-0.2.0.tar.gz |
|---|---|
| Size | 21.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5ae336008fe07f2a5eca1eec689a404bb47e8e1245b225644a43ccac4835ded4
|
|
BLAKE2b-256 checksum How to use checksums |
8fc846a264c65516fad97c89ea5fe228e2b48a20b27f1dfa6a96ce9460eb679d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.
Transparency logRelease files / texsmith_fragment_heig_logo-0.2.0-py3-none-any.whl
| Download URL | texsmith_fragment_heig_logo-0.2.0-py3-none-any.whl |
|---|---|
| Size | 19.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e9d66f05655aa0eb444540d49124c7193d2199088188745a8acbc7efa9dade62
|
|
BLAKE2b-256 checksum How to use checksums |
addec73ba89c274d3fdd2b1029b46565f1069a9677f9394948c393611ea9cf7f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.
Transparency log