Comments (5)
I agree on all these points. Transferring this to texmath, which actually does the conversion.
from texmath.
One issue should perhaps be addressed in the tex reader:
% texmath -t native
-1
[ ESymbol Bin "\8722" , ENumber "1" ]
Ideally this would not be parsed as a symbol in category Bin (binary operator). But this would require a bit more sophistication than we currently have in the parser.
For the other issue we have
% texmath -t native
2 + (2 + 3)
[ ENumber "2"
, ESymbol Bin "+"
, EDelimited
"("
")"
[ Right (ENumber "2")
, Right (ESymbol Bin "+")
, Right (ENumber "3")
]
]
which is fine, but something is going on in the pandoc writer, which adds the spacing around the binary operator in one context but not the other:
% texmath -t pandoc
2+(2+3)
[ Str "2"
, Str "\8197"
, Str "+"
, Str "\8197"
, Str "("
, Str "2"
, Str "+"
, Str "3"
, Str ")"
]
from texmath.
Pushed a change that fixes the second issue. Not yet the first.
from texmath.
Looks like we already have code in the TeX reader to change some Bins to Ops. This code is too simple; we need to look at the atom before the symbol as well as the one after it.
from texmath.
Texbook says:
If the current item is a Bin atom, and if this was the first atom
in the list, or if the most recent previous atom was Bin, Op, Rel, Open,
or Punct, change the current Bin to Ord and continue with Rule 14.
Otherwise continue with Rule 17.If the current item is a Rel or Close or Punct atom, and if the most
recent previous atom was Bin, change that previous Bin to Ord. Continue with Rule 17.
from texmath.
Related Issues (20)
- latex/markdown to typst overline conversion
- `U_{\frac{1}{n}}` gets converted to `U_1 / n` for LaTeX to typst.
- \tilde{x} from LaTeX to typst should get converted to accent(x,tilde.op) instead
- $\underbrace{x}_{y}$ from LaTeX to typst
- mathml vector - typeset error HOT 1
- texmath converts $s_n$ to $space_n$ from LaTeX to Typst HOT 1
- MathML <mo> created for each adjacent Rel symbol HOT 5
- texmath-0.12.8 testsuite failure in Nightly HOT 3
- Feature request: color
- Installing `texmath` binary as dependency in Nix project HOT 2
- how to run server HOT 2
- Wrong equation conversion from docx HOT 4
- pandoc cannot convert latex formula containing "*{20}{l}" HOT 1
- Recognise `\allowbreak` in TeX input
- texmath converts $\ddot{q}$ to $q^(̈)$ from LaTeX to Typst HOT 3
- Use Unicode in Typst HOT 5
- Do not use extra lr in typst writer HOT 2
- Pandoc cannot recognize some uppercase Greek letters and lowercase omicron HOT 8
- Math not correctly converted to typst: `\mathbf` should be bold and upright but is only bold
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 texmath.