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

Why can't I render this inside nextjs? #83

Open
jamesdiplomat opened this issue Jan 1, 2024 · 3 comments
Open

Why can't I render this inside nextjs? #83

jamesdiplomat opened this issue Jan 1, 2024 · 3 comments

Comments

@jamesdiplomat
Copy link

I am using NextJS.

I have written code like this, but I am not getting mathematical output. The mathematical equation is still same as before.
image

import 'katex/dist/katex.min.css';
import dynamic from 'next/dynamic';
import { InlineMath, BlockMath } from 'react-katex';

// Initialize markdown-it with the Katex plugin for LaTeX rendering
export default function TestPage() {
    return (
    <div>
        <InlineMath math="\\int_0^\\infty x^2 dx"/>,
    </div>)
}
@Sahillather002
Copy link

import 'katex/dist/katex.min.css';
import dynamic from 'next/dynamic';
import { InlineMath, BlockMath } from 'react-katex';
export default function TestPage() {
    return (
        <div>
            <InlineMath math="\\int_0^\\infty x^2 dx" />
        </div>
    );
}

can you try this

@jamesdiplomat
Copy link
Author

I did and it still did not render as a mathematical formula

@sh3l6orrr
Copy link

sh3l6orrr commented Jan 3, 2024

In nextjs, a single backslash is enough

<InlineMath math="\int_0^\infty x^2 dx"/>

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

3 participants