Skip to content

mathjax / katex / latex rendering for the markdown #22

Open
@eleijonmarck

Description

@eleijonmarck

I have been looking for plugins / components to use to be able to use latex expressions in blog posts.

this markdown

### Naive approach to guess until we get a good fit
guessing the beta parameters linear equation

$ y = m \times \mathbf{x} + b

becomes:
image

I get the following Error for the timeToRead property and the content property

shared.js?37f0:18 An error occurred while executing page-query for src/templates/Post.vue

Error: Cannot read property 'prototype' of undefined

GraphQL request (12:5)
11:     description
12:     content
        ^
13:     coverImage(width: 860, blur: 10)

Do we need to handle the content in some way for the rendering to take place for the places of latex expressions?

Found the issue solved on vuepress: vuejs/vuepress#113

Could we do something similar maybe? I cannot see how we can use it:

path: 'content/posts/*.md',

Found the issue of the remark/prism plugin we are using:
gridsome/gridsome#238

Steps to reproduce

  1. $ gridsome create test-remark-math https://github.com/gridsome/gridsome-starter-blog.git
  2. $ npm install remark-math remark-html-katex remark-html
  3. Then you will get same error for timeToRead in DevTool console. Removing those for the graphql query yields the error on the content part for any markdown where $ is used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions