astro-typst icon indicating copy to clipboard operation
astro-typst copied to clipboard

Unable to render math formulas

Open yl4070 opened this issue 2 months ago • 1 comments

Hi, this is more of a question. I'm not sure where is the best place to ask. I ran into issue that .typ files can be rendered, but there is no formula.

I used the following code for the content collection in content.config.ts file:

const blog = defineCollection({
    // type: "content",
    loader: glob({
        pattern: "**/*.typ",
        base: "./src/content/BlogPosts",
    }),
    schema: z.object({
        title: z.string(),
        date: z.string(),
        excerpt: z.string(),
        tags: z.array(z.string()).optional(),
    }),
});

Do I need to configure something else to show the formulas? I'm very new to Astro, sorry if this is too vague.

yl4070 avatar Oct 11 '25 11:10 yl4070

you probably need to do show math.equation: html.frame and some css things, see: https://github.com/typst/typst/issues/721#issuecomment-2817289426

pawarherschel avatar Oct 11 '25 17:10 pawarherschel

Yes -- basically you need some template to show anything that is not natively supported in html output as html.frame, including colors, formulae, diagrams, etc.

OverflowCat avatar Dec 25 '25 09:12 OverflowCat