hikerpig / gatsby-project-kb

Developing gatsby-theme-kb, a Gatsby theme for publishing Knowledge Base.
https://gatsby-project-kb.vercel.app/
MIT License
61 stars 13 forks source link

Latex Support #29

Open Adam-Al-Rahman opened 3 years ago

Adam-Al-Rahman commented 3 years ago

Latex Support

How to add the latex support. I tried the following but this isn't working

{
      resolve: 'gatsby-theme-kb',
      options: {
        contentPath: path.resolve(__dirname, 'content'),
        rootNotes : 'readme',
        wikiLinkLabelTemplate: '[[{{ title }}]]',
        getPluginMdx(defaultPluginMdx) {
          defaultPluginMdx.options.gatsbyRemarkPlugins.push({
            resolve: 'gatsby-remark-prismjs',
            options: {
              noInlineHighlight: true,
            },
            resolve: `gatsby-remark-katex`,
            options: {
              // Add any KaTeX options from https://github.com/KaTeX/KaTeX/blob/master/docs/options.md here
              strict: `ignore`
            },
          })
          return defaultPluginMdx
        },
      },
    },

As I'm new to gatsby and gatsby shadowing. Please correct me, where am I wrong. Thanks.

hikerpig commented 3 years ago

@Adam-Al-Rahman I'm on vacation now and have no access to my laptop. I will try to look at it three days later.

Adam-Al-Rahman commented 3 years ago

@Adam-Al-Rahman I'm on vacation now and have no access to my laptop. I will try to look at it three days later.

Ok, enjoy your vacation. Btw Thanks for replying.

hikerpig commented 3 years ago

@Adam-Al-Rahman See this isuse and related commit, it is a working example in foam-template-gatsby-kb.

This requires both remark-math and rehype-katex, I got the solution from this article Adding math support to a Gatsby MDX blog

Adam-Al-Rahman commented 3 years ago

@Adam-Al-Rahman See this isuse and related commit, it is a working example in foam-template-gatsby-kb.

This requires both remark-math and rehype-katex, I got the solution from this article Adding math support to a Gatsby MDX blog

Thanks, I'll check it. and if it solves the problem I'll close this issue.