Giter VIP home page Giter VIP logo

Comments (11)

blaiprat avatar blaiprat commented on July 30, 2024 1

Seems like the issue is related to our good neighbour "react-katex", closing this issue

from react-latex.

martynvandijke avatar martynvandijke commented on July 30, 2024

Can confirm this bug, any work arounds ?

from react-latex.

blaiprat avatar blaiprat commented on July 30, 2024

Hi, this might be because in our projects and for legacy purposes, we use the curly brackets to separate normal text and latex.

I'll try to move this functionality out of the module so expressions like R_{u,i}can work as expected

from react-latex.

blaiprat avatar blaiprat commented on July 30, 2024

Quick update and the current version works fine. Are you wrapping your LaTeX syntax around dollar signs, like this: $R_{u,i}$

from react-latex.

talyssonoc avatar talyssonoc commented on July 30, 2024

@cavaunpeu @martijnvandijke react-katex has a way to solve this problem, you can check it here: talyssonoc/react-katex#6

It happens because React interpret content between curly braces as JavaScript values.

from react-latex.

vicoyeh avatar vicoyeh commented on July 30, 2024

This problem is still not solved. React component does not recognize BlockMath. Can someone look into the issue? Ex. $P_{'{data}'}$ is not working, even though the curly braces are escaped. Thank you!

from react-latex.

talyssonoc avatar talyssonoc commented on July 30, 2024

@vic317yeh can you show me the full code you're trying to render with BlockMath?

from react-latex.

perkss avatar perkss commented on July 30, 2024

@talyssonoc is this BlockMath available in react-latex or react-katex only? When importing I have been doing this: import Latex from 'react-latex'; but when trying block math getting issues. Can you share example of the import? What i want to render is this: $a^m \times a^n = a^{m+n}$

from react-latex.

talyssonoc avatar talyssonoc commented on July 30, 2024

I'm not sure how to do that in react-latex, but in react-katex you can do that:

import { BlockMath } from 'react-katex';

// ...

<BlockMath math="a^m \\times a^n = a^{m+n}" /> // don't forget to escape the `\` :)

from react-latex.

perkss avatar perkss commented on July 30, 2024

Thanks @talyssonoc I have tried that and get the error Uncaught TypeError: Cannot read property 'string' of undefined at Object.<anonymous> (bundle.js:65414) at __webpack_require__ (bundle.js:65334) at Object.<anonymous> (bundle.js:65367) at __webpack_require__ (bundle.js:65334) at bundle.js:65354 at bundle.js:65357 at webpackUniversalModuleDefinition (bundle.js:65307) at Object.<anonymous> (bundle.js:65314) at __webpack_require__ (bundle.js:20) at Object.defineProperty.value

Along with warnings when building:

npm install --save react-katex npm WARN [email protected] requires a peer of katex@^0.7.0 but none is installed. You must install peer dependencies yourself. npm WARN [email protected] requires a peer of react@^15.3.2 but none is installed. You must install peer dependencies yourself. npm WARN [email protected] requires a peer of react@^15.3.0 but none is installed. You must install peer dependencies yourself.

In package.json I do have
"katex": "^0.9.0-beta","react": "^16.2.0", "react-katex": "^1.2.0",

So it seems a bit odd this maybe is the newer version of React supported?

I did try this which maybe related by installing prop types but didnt seem to make a difference installing that.

from react-latex.

perkss avatar perkss commented on July 30, 2024

So removing the warnings has worked so setting the values to:
"react-katex": "1.2.0",
"katex": "^0.7.0",
"react": "15.3.2",

So seems like the library does not currently work with newer versions of REACT. I will raise on react-katex

from react-latex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.