Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Math needs to be around spacing #120

Closed
mildsunrise opened this issue Sep 4, 2014 · 7 comments
Closed

Math needs to be around spacing #120

mildsunrise opened this issue Sep 4, 2014 · 7 comments

Comments

@mildsunrise
Copy link
Member

On #114 we imposed that math spans be surrounded by spacing (or nothing). This was made to avoid it being interpreted inside words, like so:

go$$rem$$d

But then @gankro observed that cases like:

We know how to solve $$ax + b = 0$$.

wouldn't work because of the dot at the end. So I think that restriction should be left.

@Gankra
Copy link

Gankra commented Sep 4, 2014

Other similar constructs that become awkward with this rule:

"At the $i$th index..." and "We give each of the $x$'s a..."

The leading space rule doesn't immediately conflict with much I've seen, though. Although maybe if you're going something like "$i$" or ($i$) it could be frustrating.

@uranusjr
Copy link

uranusjr commented Sep 5, 2014

Maybe it is better to remove the constraints altogether to avoid any future problems. It would be pretty frustrating for a user if there’s a case we didn’t consider and is impossible to get around, and we obviously can’t fix it quick enough to help them. And you can always write \$, which would be pretty familiar to users who know LaTeX anyway.

@mildsunrise
Copy link
Member Author

So, we remove the whitespace-around restriction. Any other change needed?

@Gankra
Copy link

Gankra commented Sep 5, 2014

Only other issue I had was an apparent lack of documentation :P

@mildsunrise
Copy link
Member Author

Heh. Minimal documentation was planned for v3, but for extensions you can always look at hoedown --help and the pertinent PR. ;)

@mildsunrise
Copy link
Member Author

I've hit a minor problem with the current implementation. It's not actually a problem, but it can be unintuitive sometimes. If you write:

\\\\( math \\\\)

This won't produce

<p>\\\( math \\\)</p>

because escapes are not interpreted inside math spans.
Instead, you have to write:

\\\\( math \\\)

@uranusjr
Copy link

For the record, there’s another (probably more intuitive) way to get the same output:

\\\\\\( math \\\\\\)

Six backslashes produce \\\. Seven backslashes will also do (the last one escapes the parenthesis after it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants