Comments (3)
I found the TeX rules for spacing in formulas in the TeXBook, p. 170. The kind of space is actually a function of the types of the left atom and the right atom. (For the various types of atoms, see p. 158.) According to this table, when the left atom is Punct and the right atom is anything, a thin space should be inserted. That is actually just what pandoc does. Note that the thin space looks like a regular space if you're looking at the output in a monospace font on a terminal. Try viewing the result in a browser (add -s
to your pandoc command to generate a standalone web page).
from texmath.
Thanks for the in-depth comment! However, as the following proof of concept should show, TeX really doesn't add a space after a period. (Compile with pdftex foo.tex
.)
The probability is $p=0.7$
The probability is $p=0,7$
\bye
I investigated further and I found the explanation on pages 132-134 of the TeXBook. The spacing table you used is correct, but only ,
and ;
should be treated as punctuation. (Page 438 confirms this.) .
, /
, @
and ?
are explicitly said to be ordinary symbols. Furthermore, :
is a relation symbol and you need \colon
to use it as punctuation.
I also discovered some related issues, but they might be harder to fix than the above, and they aren't as important for my use case.
- As I mentioned: when rendering
$\sum_{k=0}^n 2k$
, TeXMath/Pandoc adds a space between the sigma and the subscript/superscript, but TeX adds that space just before the 2, not after the sigma. This is because subscripts and superscripts are still part of the same atom. Appendix G has the gory details and rules, but I didn't understand most of it. - Page 134 says that you can put a symbol in braces
{,}
to make it ordinary. Does TeXMath support this? I'm not entirely clear on the rules that govern this, though.
from texmath.
Thanks! But I think ":" is supposed to be Rel, not Ord.
from texmath.
Related Issues (20)
- $\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
- Minus for subtraction and minus for negative numbers not differentiated in default HTML math output HOT 5
- 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
- Regarding issues with converting Markdown using Pandoc.
- Converting left/right math functions to Typst and docx HOT 7
- Writing primes ′ in Typst HOT 4
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.