Contents

Symbols of your own

Typesetting

Symbols of your own

If no font has the symbol you need, draw it as a glyph, save it as a font and use it like any other symbol. The example is, from a paper on register automata. It is a single glyph with the stroke weight of, and TEX sets it like a quantifier, with a subscript. The browser draws the same outline.

The segment modalitycuts a word at the positions inand asksto hold on every piece. It nests like any quantifier, so

says that the word splits into pieces, each with a valuethat differs from the one atand comes first among the values of its piece.

The segment modality $\segment_X\, \varphi$ cuts a word at the positions in
$X$ and asks $\varphi$ to hold on every piece. It nests like any
quantifier, so
\[
  \exists p\; \exists X\; \segment_X\; \exists a\;
  \bigl(p \not\sim a \land \forall p'\,(a \le p' \lor p' \sim p)\bigr)
\]
says that the word splits into pieces, each with a value $a$ that differs
from the one at $p$ and comes first among the values of its piece.

How the example is made

Three files: the font, a preamble that declares the symbol, and the text that uses it.

website/                               the Hugo site
├── latex-fonts/
│   └── SegmentSymbol.otf              the glyph, at U+01A7
└── content/docs/typesetting/
    └── custom-symbols.md              this page
examples/symbol/                       --demos-dir: where file="…" is found
├── preamble.tex                       declares \segment
└── segment.tex                        the text above

SegmentSymbol.otf 2 glyph slots, 1000 units per em

  1. 0.notdefno code point
  2. 1segmentSymbolU+01A7

Slot 1, segmentSymbol, drawn large:

baselineadvance 555

How it works

The font. One glyph, in OpenType, with the outline shown above: cubic curves on a 1000-unit em, 555 units wide. It sits at a real character, U+01A7, rather than a private one, so copying the symbol out of the page gives a character that means something elsewhere too.

Found by name. Every .otf in the site’s latex-fonts/ is placed next to each document the build compiles, so the preamble loads it by its file name alone, and the same file is served to the browser.

A math symbol. Declared as a symbol font, the glyph takes its script sizes from the math machinery, so it works in a subscript or a superscript as well.

One file. TEX sets the symbol with the font’s metrics, and the browser draws it from the same file.