ScryEngineering / scrygroup.com

The Scry Engineering website
https://www.scrygroup.com
0 stars 0 forks source link

Fix existing posts that are now incorrectly rendering text as LaTeX #176

Closed shuttle1987 closed 4 years ago

shuttle1987 commented 4 years ago

Since we have introduced the ability to render LaTeX we have some posts that are incorrectly rendering text as LaTeX.

For example in https://github.com/ScryEngineering/scrygroup.com/blob/ea8ef68b0e94a68746301343d276451bdea0ab3f/content/blog-posts/2019-12-26/Is-your-business-a-defacto-tech-company.md

We have this text:

One of the most clear-cut examples of a non-tech entity trying to call itself a tech company is WeWork, which operates a series of coworking spaces around the world. Its owner the We Company recently shelved its initial public offering amid concerns from investors and the media about its finances, path to profitability and leadership. Following that, WeWork hit rocky waters as its co-founder and CEO Adam Neumann stepped down, thousands of employees were laid off and WeWork's valuation tumbled from $47 billion to about $10 billion. News website Vice recapped a comparison between WeWork and Uber:

Where the text between the dollar amounts is being rendered as LaTeX

aapeliv commented 4 years ago

So the right way to do this would be to have \( and \) for inline math and \[ and \] for display math, like what the recommendation is for LaTeX these days.

However, the problem is that we're getting KaTeX support from this stale "package": https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-katex

And the way remark works is that it has some idiotic plugins that transform the markdown eventually into HTML... And in that code there are hardcoded values for '$' and so on.

Their official answer is here: https://github.com/remarkjs/remark-math/issues/21, which just says "fu".

Not that we could modify how we're calling that anyway since this idiotic plugin doesn't let us pass options to that library.

In other words we better go and escape old posts with \$.

shuttle1987 commented 4 years ago

Their official answer is here: remarkjs/remark-math#21, which just says "fu".

This is very annoying

shuttle1987 commented 4 years ago

I did this quick fix, closing for now.