Skip to content

Failed to resolve component MjxContainer with mathjax #417

@toniengelhardt

Description

@toniengelhardt

The following plugin setup for mathjax:

mdc: {
    remarkPlugins: {
      'remark-math': {},
    },
    rehypePlugins: {
      'rehype-mathjax': {},
    },
}

results in this warning:

Image

A workaround to solve it is to define the following MjxContainer component in components/mdc:

<template>
  <!--
    We need this component to prevent the MjxContainer component unknown error (likely a bug).
    If "display" is true, we render block math with a div, otherwise inline math with a span.
  -->
  <component :is="$attrs.display ? 'div' : 'span'" v-bind="$attrs">
    <slot />
  </component>
</template>

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