imsky / imsky/PocketEuler

Equations

Open
#44 19 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
118
Forks
11
PR merge metrics
No merged PRs in 30d

Description

While looking for optimal solutions for #3, I noticed most of them are caused by the decision to use `[]` for subscript in equations, along with `^` for superscript.

I am not aware of `[]` being a common approach for subscript in equations, while `^` is a very common approach for superscript.

`_` is the more common syntax for subscript, as in LaTeX, and AsciiMath, etc.

But the only common (and github flavour) markdown solution is `` and ``. Problem 479 is currently using that approach.

We also have problems using `$$` or `$` with Latex : problems 431, 450, 463, 471, and 473.

A quick rundown of the options:
- Use `` and ``. Simple and widely supported. Ugly to read for complex equations. And then do we also use HTML tables for complex equations, etc? That isnt a good path to follow.
- Use Unicode subscript and superscript. `grep -P "[\x80-\xFF]" README.md` already has 603 lines, so we're definitely not plain ascii any more. I was initially quite keen on this approach. It looks very nice in linux text editors, reasonable in linux browsers (but far from perfect), but then I found the glyphs were missing on my slightly old Samsung tablet (https://en.wikipedia.org/wiki/Talk:Unicode_subscripts_and_superscripts#Browser_support) , so we cant expect it to work on cheaper smartphones. My unicode solution for #3 can be seen at https://github.com/jayvdb/PocketEuler/tree/gh-3-unicode (e.g. problem 149, 165, 186, etc)
- Give up on `README.md` rendering equations correctly on Github.com, and switch to GitHub Pages as the intended renderer. Then we can use [maruku](http://haixing-hu.github.io/programming/2013/09/20/how-to-use-mathjax-in-jekyll-generated-github-pages/) or similar. The Github.com view would still degrade to a readable syntax, but it wont always be pretty or easy to understand. I dont see this as a huge problem, as the use of `[]` is not very readible IMO, nor is it common. This is what happens for the problems currently using `$`/`$$` .
- Store each equation in a separate file, or an embedded comment in the MD using `` for pandoc support, and render them to an SVG, PNG, etc. to be stored in the repo and included by the MD. (i.e. a bit like https://hopstat.wordpress.com/2015/07/31/rendering-latex-math-equations-in-github-markdown/ , but I think that can be improved upon)
- Use an online renderer, like http://mathurl.com/ , e.g. `![](http://mathurl.com/render.cgi?%5Czeta%28s%29%20%3D%20%5Csum_%7Bn%3D1%7D%5E%5Cinfty%20%5Cfrac%7B1%7D%7Bn%5Es%7D%5Cnocache)` is ![](http://mathurl.com/render.cgi?%5Czeta%28s%29%20%3D%20%5Csum_%7Bn%3D1%7D%5E%5Cinfty%20%5Cfrac%7B1%7D%7Bn%5Es%7D%5Cnocache) , or http://www.sciweavers.org/free-online-latex-equation-editor also works sometimes, but then doesnt - strange. While those URLs can be decoded, they are not readable, so again a HTML comment would be appropriate for people reading the README.md as-is.

Any other options?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with README.md and compare the equation forms used in problems 3, 431, 450, 463, 471, and 473. Review the listed rendering approaches and their GitHub, GitHub Pages, and device implications. Done means the project has chosen one consistent equation format and documented or applied the decision across the affected problems.

Written by the indexing model from the issue text.

Assessment

Tech stack
latex, markdown
Domain
content, documentation
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.