How to add dollar $ sign without space afterwards?

searched the forum and documentation but not finding a solution here…
I have text with $ amounts in it, and I used #sym.dollar to insert the $ symbol correctly, but if I put a number right after it, it throws an error. however, when I put a space after, the symbol shows up correctly, but then there’s an extra space in the rendered text…
example:

#sym.dollar 250

shows as $ 250

#sym.dollar250

gives error “Module sym does not contain dollar250”

1 Like

The default way to stop code mode in that situation, with no extra space, is with a ;

#sym.dollar;250

Note that you can also use a backslash:

\$250

Backslash in general takes something that is special in markup (or not) and turns it directly into a symbol, so the result is the same as when sym.dollar is inserted.

Other alternatives would be to use a function (if you need number formatting anyway, in the style of package zero or similar) or other ways of creating custom shorthands.

7 Likes

Could you mark @bluss answer as solution?