Comments (11)
Seems like the issue is related to our good neighbour "react-katex", closing this issue
from react-latex.
Can confirm this bug, any work arounds ?
from react-latex.
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.
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.
@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.
This problem is still not solved. React component does not recognize BlockMath. Can someone look into the issue? Ex.
from react-latex.
@vic317yeh can you show me the full code you're trying to render with BlockMath?
from react-latex.
@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.
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.
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.
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)
- issue with curly brackets HOT 1
- couldn't convert backslash delimited string
- Suggestion: latexString function as different package.
- Add options prop HOT 2
- Vertical separators not appearing
- Some lines not rendering HOT 5
- Missing @types/react-latex HOT 1
- Problem with hyperlink
- Latex not loading HOT 1
- dangerouslySetInnerHTML vulnerability? HOT 2
- How to align in react-latex
- Question related using cloudflare served stylesheet vs katex npm package's stylesheet
- How do I set the font size? HOT 1
- Bra-Ket notation not rendering HOT 1
- \begin{equation} not working
- Html rendering not working
- Render only latex part
- Half of matrix is hidden HOT 1
- Uncaught (in promise) TypeError: Cannot read property 'replace' of undefined HOT 3
- Responsive design on long formulas
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-latex.