Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need support for #bold( ) #31

Open
EthanPixar opened this issue Nov 5, 2024 · 5 comments
Open

Need support for #bold( ) #31

EthanPixar opened this issue Nov 5, 2024 · 5 comments

Comments

@EthanPixar
Copy link

I am working on Matrix and Vectors, and the code in typst would look like these:
image
I wonder whether I can add these decrorations myself, so I struggled with the json file and failed.

Hope you can add support for #bold( ) function to make the code more readable!!

@supersurviveur
Copy link
Owner

Hi !
Implementing bold in special cases is probably possible.
My current system to propagate style might be a problem for more complex situation (like bold(sqrt(2))).

We must match on the bold function, and then add a font-weight style on children.

@EthanPixar
Copy link
Author

Yes, I do find cases where the system can not render styles correctly, for example the dash(a) will look like —(a) instead of ā. Currently I just want to add support for bold(), and it would improve readability so much even just by replacing all the bold(a) with just a. I read through the README.md file and tried

{
  "name": "mySymbol",
  "symbol": "|some chars|",
  "category": "operator"
}

but did not work for me. How can I implement this? Great thanks for your reply!

@supersurviveur
Copy link
Owner

supersurviveur commented Nov 10, 2024

You can't add custom func styles, you can just replace a string, so it needs to be hard coded with other functions.
But instead of abs function for example, which just add bars, bold modify the style of its children.
I will try to implement it in the general case, and just in some special cases (with just a string for example) if it doesn't work.

Unfortunately I don't have the time to do something "cleaner".

@supersurviveur
Copy link
Owner

Feels free to open another issues for other functions like dash, if you would like to see them implemented. You can even just list them, since I only added the ones I use for my own documents.

@EthanPixar
Copy link
Author

Great thanks!! You have really solved my confusion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants