#Creating symbols

46 messages · Page 1 of 1 (latest)

worthy relic
#

Does typst currently have a way of creating symbols? My field of research uses a lot of.. custom symbols.
One example would be this "arrow star"
It is created in latex using the \equiv and \ast symbols, and then resizing and kerning to make them match.
Is anything similar possible in Typst?

shadow marsh
#

?render

#let identast = $ident #place(dy: -0.85em, dx: -0.65em)[#text(size: 2em, $ast$)]$
$ident ast "vs" identast$
shadow marsh
#

theres gotta be a better way hm

sly trout
#

Svg would work too if necessary

shadow marsh
#

yea the part where not all lines of the ident symbol are equal in length/disappear into the asterisk is kinda hard to recreate

worthy relic
shadow marsh
#

ah lol

worthy relic
#

Ok so place is the thing to use

shadow marsh
#

yea id try that first

worthy relic
#

Thank youuuu

keen atlas
#

?render theme=light ```
#let astar = style((s) => {
set text(font: "New Computer Modern Math")
let ast = text(top-edge: "x-height", sym.ast)
let (w, h) = measure(ast, s).values()

box(width: 1.5 * w, height: h, {
place(left + horizon, dy: -0.03em, line(length: 75%, stroke: 0.03em))
place(left + horizon, dy: -0.11em, line(length: 50%, stroke: 0.03em))
place(left + horizon, dy: +0.05em, line(length: 50%, stroke: 0.03em))
place(right, ast)
})
})

$ a astar b = c ast d $

keen atlas
#

(yes at this point I might as well go with an svg)

shadow marsh
#

yea i wanted to use h first too but the baseline is kinda fucky with the increased text size

supple quest
#

yeah, scrap that idea

keen atlas
#

yeah baseline's weird af

supple quest
#

but h should work better because of auto spacing

keen atlas
#

I wasn't able to get an ast in a box to look like a regular ast

#

?render $ ast#box(text(top-edge: "x-height", sym.ast))ast $

keen atlas
#

old man yells at pixels

worthy relic
# carmine lynx

impressive, ok
And so much more readable than the latex counterpart hahahahaha

supple quest
#

how bad does the latex look?

worthy relic
#
{\displaystyle\equiv\kern-1.6ex-\kern-1.5ex\smash{\scalerel*{\vphantom-\ast}{\sum}}\kern-0.2ex}
exotic lake
#

?render $\u{273b}$

carmine lynxBOT
worthy relic
exotic lake
shadow marsh
#

?render

#let identast = $ident #h(-0.5em) - #h(-0.5em) #box(baseline: 2.75pt, text(size: 2em, $ast$))$
$a identast b$
exotic lake
#

oh you mean latex

#

nm

shadow marsh
#

the extra minus

worthy relic
shadow marsh
#

no place

supple quest
#

the - doesnt match sadly

shadow marsh
#

yea

#

dunno, could prolly just replace it with a line

supple quest
#

but write something after the identast to show that it doesnt clip

keen atlas
#

this would honestly be a good use of custom fonts and private area codepoints

dry elk
#
#let eqstar = box(image(width: 1em, "weird-symbol.svg"))

$ x eqstar a $
#

here would be a solution using svg

exotic lake
#

if you're willing to change font

#

that character inexplicably is off center vertically in new computer modern math