Skip to content

Instantly share code, notes, and snippets.

@zr-tex8r
Last active December 31, 2023 03:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zr-tex8r/6d71012ca86ada0a5c8c0efbe9ab8cb2 to your computer and use it in GitHub Desktop.
Save zr-tex8r/6d71012ca86ada0a5c8c0efbe9ab8cb2 to your computer and use it in GitHub Desktop.
Typst: to print TeX and LaTeX logos
#let TeX = {
[T]; "\u{2060}"
box({h(-0.1667em); box(move(dy: 0.2153em)[E]); h(-0.125em)})
"\u{2060}"; [X]
}
#let LaTeX = {
[L]; "\u{2060}"
box(style(styles => {
let size = measure([T], styles)
h(-0.36em)
box(height: size.height, {text(size: 0.7em)[A]})
h(-0.15em)
}))
"\u{2060}"; TeX
}

使い方

texlogo0.typがTypstのモジュールであり、importで読み込む。

import "texlogo0.typ"

モジュールでは以下の値が定義される。

  • TeX: TeXのロゴ(content値)。
  • LaTeX: LaTeXのロゴ(content値)。
#import "texlogo0.typ": *
#set text(font: "Harano Aji Mincho")
#TeX;言語は超絶アレ、#LaTeX;は微アレ。
☃は非アレ。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment