Comments (4)
Btw this formula "\frac{\sqrt{35x^{15-b^{{{{3}^{a^{b^{c^{d^{e^{f^{g^{h^{i^{j}}}}}}}}}}}}}}}}{2}" albeit very stupid crashes the program. It is valid LaTeX, I checked it several times. This is what it should look like:
Instead I get this error after running ./main:
This is TeX, Version 3.141592653 (INITEX)
**(output.tex
(TeXinputs:plain.tex Preloading the plain format: codes, registers,
parameters, fonts, more fonts, macros, math definitions, output routines,
hyphenation (TeXinputs:hyphen.tex)) [1] )
Output written on output.dvi (1 page, 564 bytes).
Transcript written on output.log.
<nil>
panic: bad command: stack is empty at position 361
goroutine 1 [running, locked to thread]:
main.drawLatex({0x1030595bc?, 0x10304b268?}, 0x14000529e00)
/Users/24ayden.zinter/GOSTUDY-Shared/gui-playground/fyne/main.go:24 +0x130
main.main()
/Users/24ayden.zinter/GOSTUDY-Shared/gui-playground/fyne/main.go:42 +0x200
I just checked what would happen if I removed an exponent ("\frac{\sqrt{35x^{15-b^{{{{3}^{a^{b^{c^{d^{e^{f^{g^{h^{i}}}}}}}}}}}}}}}{2}") and it ran. It looks like this tho:
I'm actually so confused, if you remove another exponent you get a similar error. For some reason rendering this exact amount of exponents doesn't crash. It doesn't start working again until the formula "\frac{\sqrt{35x^{15-b^{3^{a}}}}}{2}" it still fails to render the higher exponents:
This stuff may be related to the scaling issues, idk.
from canvas.
Yes, I've noticed similar issues as reported by #231. The problem is with the star-tex.org/x/tex
library however, and I've actively looked for an improvement but there is no other library it seems. Improving the library is also difficult, it seems to be a non-trivial amount of work and the author(s) and I don't have a lot of time to fix it.
There are two options: implement font parsers for the LaTeX font formats (quite some work), or port the same library for XeTex which has unicode support (quite some work too). Rewriting a formula parser and parsing the GSUB etc tables for fonts would be even more work.
I'm happy if you can find a good alternative, but unfortunately I don't have time for such a large project right now.
from canvas.
No worries, appreciate the fast reply tho. Building with -latex is annoying but I'm willing to deal with it for the time being. I figured star-tex would be the problem.
Works fine with -tags latex. Somewhat annoying, but better than the original solution I came up with of running a KaTeX or Mathjax server locally and integrating it into my application. Maybe once I am a better programmer I can work on a parser or something. For now I will just pretend like the problem doesn't exist. Thanks for all of your help anyway :D
from canvas.
Yes, using the system's LaTeX binary will work if you control the target machine. Great to hear you have that option, and you're always welcome to try and submit PRs if you wish! Thank a lot for all the feedback and I hope this library can help you build something useful ;-)
from canvas.
Related Issues (20)
- Preview failing in Mac OS X HOT 7
- [question] Drawing parsed SVG file HOT 6
- Font fallback handling HOT 2
- SVG Rendering Issues HOT 3
- Different output after upgrading to db7265801182 HOT 4
- Intersection panics HOT 1
- Bug found in path intersection code HOT 2
- Image is rasterised off-centre/rearranged HOT 3
- Can I export to buffer or base64 instead saving local file? HOT 7
- Consider using twpayne/go-svg for SVG XML generation HOT 2
- Using one canvas in another HOT 2
- Font Issue HOT 1
- Issue with the getting started template HOT 1
- Make AVIF and WEBP optional, even if CGO is enabled HOT 1
- Bug found in path intersection code
- Trying to render go-charts into SVG with EmbedFonts=false generates empty file. HOT 2
- Path rendering issues when "arcTo" command is used
- [Feature request] Supporting Raylib HOT 5
- Calling ToText will cause a panic when writing \uFFFC HOT 1
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 canvas.