Skip to content

Instantly share code, notes, and snippets.

@felsenhower
Last active November 2, 2025 09:57
Show Gist options
  • Select an option

  • Save felsenhower/a975c137732e20273f47a117e0da3fd1 to your computer and use it in GitHub Desktop.

Select an option

Save felsenhower/a975c137732e20273f47a117e0da3fd1 to your computer and use it in GitHub Desktop.
LaTeX-Logo in Typst
// © 2023 Ruben Felgenhauer
// Usage of the works is permitted provided that this instrument is retained with the works, so that any entity that uses the works is notified of this instrument.
#let LaTeX = {
let A = (
offset: (
x: -0.33em,
y: -0.3em,
),
size: 0.7em,
)
let T = (
x_offset: -0.12em
)
let E = (
x_offset: -0.2em,
y_offset: 0.23em,
size: 1em
)
let X = (
x_offset: -0.1em
)
[L#h(A.offset.x)#text(size: A.size, baseline: A.offset.y)[A]#h(T.x_offset)T#h(E.x_offset)#text(size: E.size, baseline: E.y_offset)[E]#h(X.x_offset)X]
}

Typesetting the LaTeX logo with Typst

How to use:

In order to typeset the LaTeX logo with a function, save latex-logo.typ in your working directory and write:

#import "latex-logo.typ": LaTeX

#LaTeX

If you simply want to replace all occurences of the string LaTeX in your document with the LaTeX logo, you can additionally use a show rule:

#show "LaTeX": name => LaTeX

LaTeX
@ponte-vecchio
Copy link

lovely work - one issue is that at the end of a line Typst chops it midway whereas it should be non-breaking:
image

@felsenhower
Copy link
Author

lovely work - one issue is that at the end of a line Typst chops it midway whereas it should be non-breaking

Thanks! That should be solved if you wrap it in a #box, right?

However: There is now the metalogo package which does the same and way more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment