Giter Site home page Giter Site logo

Comments (3)

jgm avatar jgm commented on September 25, 2024

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.

TomiBelan avatar TomiBelan commented on September 25, 2024

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.

TomiBelan avatar TomiBelan commented on September 25, 2024

Thanks! But I think ":" is supposed to be Rel, not Ord.

from texmath.

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.