#Ampersand Symbol Text Insertion

50 messages · Page 1 of 1 (latest)

fallen jasper
#

Currently my ampersands are rendered as shown in the picture above.

I've tried changing fonts to no avail so after looking up the docs I found that I can reference the symbol using #sym.amp

So how would I insert this into the middle of my description/string?

#block-entry{
  description: "'&' is an Ampersand",
}

^For example how would I insert an ampersand symbol into this description?

dapper ermine
#

afaik you need to use content instead of string, like: ['#sym.amp' is an Ampersand]

fallen jasper
fierce marlin
#

?r t=l

A & B or #sym.amp

#set text(font: "New Computer Modern")
A & B or #sym.amp
fallen jasper
#

damn

just tried it and it's still rendering as that other typeset

fierce marlin
#

& and sym.amp will give the same symbol in a given font, you need to change the font to change how it is rendered

fallen jasper
#

looking in lib.typ

I tried changing everywhere where font is declared/specified:

font: {"Roboto"}
font: {"Open Sans Pro"}

Changing either of these doesn't produce any noticeable effect, still not sure what I'm doing wrong unfortunately

fierce marlin
#

what is lib.typ? is it an external template? are those fonts being set inside a set text(...)?

fallen jasper
fallen jasper
#

are those fonts being set inside a set text(...)?

yes that is correct

dapper ermine
#

If you want to change the font, you may need to use set text(font: "the font you want")

fallen jasper
dapper ermine
#

Could you post a reproducable example here? Maybe that can help to diagnose the issue.

fallen jasper
#

Initialize new project from modern-cv v0.3.0 template:

typst init @preview/modern-cv:0.3.0

Open resume.typ and modify section description to:

#resume-entry(
  description: ['#sym.app' is an Ampersand]
)
#

.

Under section: Experience

it should look like this:

dapper ermine
#

And you want to change its font, right?

fallen jasper
#

yup

#

also; not sure if this is relevant but selecting "John Smith" in the Typst preview window will open up lib.typ in a new tab

dapper ermine
#

What font do you want in this description

fallen jasper
#

preferably Open Sans or anything Sans-Serif but at this point anything works,

  • just need ampersand to look like the typical symbol
dapper ermine
#

You could try to find them via typst fonts | grep "Latin Modern Sans" and typst fonts | grep "Inria Sans", if you are using *nix system

#

My fault, I post a wrong link

fallen jasper
fallen jasper
dapper ermine
#

this is the true lib

#

and you could try to find these two fonts "Source Sans Pro", "Source Sans 3"

fallen jasper
#

unfortunately still doesn't work,

I've been restarting the preview and reopening VSCodium after each attempt just in case

I have to wonder if there might be an issue with the Flatpak version of VSCodium or if...ah shit

dapper ermine
#

I think it is because modern-cv render your description in smallcaps

fallen jasper
#

I think fonts might not have been properly installed in the Arch Linux VM I'm currently working in

my main host is NixOS

#

I think that might be the blunder

dapper ermine
fallen jasper
#

AHHHH IT WORKS

#

pain

#

thank you

#

confirmed L232 changing:

smallcaps[#it.body]

to:

it.body

Fixes the ampersand issue

dapper ermine
#

Or you could just change the font for &, then other characters could still be smallcaps

fallen jasper
#

I can't express in words just how much I appreciate the time that you took to help me figure this out

again thank you!!❤️

dapper ermine
#

like show "&": text(font: "the font you want", "&")

#

some fonts with smcp features could show characters in different styles from normal mode

fallen jasper
dapper ermine
#

yup

#

Struggling with styling makes everyone headache 😹

fallen jasper
#

yup

#

still beats msword tho👌

dapper ermine
#

I hope I shall never need msword 🙀