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

考虑加入数学inline公式支持? #10

Closed
songsuoyuan opened this issue Mar 28, 2015 · 12 comments
Closed

考虑加入数学inline公式支持? #10

songsuoyuan opened this issue Mar 28, 2015 · 12 comments

Comments

@songsuoyuan
Copy link
Contributor

目前数学公式似乎只能由

``math
x ^ 2 + y ^ 2 = z ^ 2
``

给出,是否考虑加入行内公式呢? 例如:

Let $latex S(n)$ be the n-th partial sum of series $latex a_n$. 

另外我很喜欢markdown-plus的LaTeX显示,因为比Mou加载速度更快!

@tylerlong
Copy link
Contributor

inline公式将来肯定会有的。 当时我图省事就实现了一个block的公式。

不过我的todo list很长很长,很多朋友提了bug和反馈了意见。 下一个版本不一定会有这个功能。 但是可以保证的是: 每个新版本都会有明显进步,都增加了大家需要的功能。

感谢支持!

@songsuoyuan
Copy link
Contributor Author

找到了一个比较“粗暴”的方法解决了行内公式问题,那就是在输出到右端显示的时候,用正则匹配去找$latex ...$里的代码并调用katex.renderToString(..., { displayMode: false })返回渲染好的行内公式……

online demo可以看http://xcoffee.me/markdown-plus/index.html
做了一个网页版自娱自乐……

@tylerlong
Copy link
Contributor

👍 赞!

语法方面最好借鉴下同类产品,每个产品搞一套语法,用户会很头疼。 我记得Mou好像是这样

hello $$$e=mc^2$$$

不过更加通用的写法应该研究下这里 http://math.stackexchange.com/

我有空也看下。今天主要在弄 Vim mode。

你的代码有很大的参考价值,多谢!

@tylerlong
Copy link
Contributor

http://math.stackexchange.com/editing-help

这里的更加国际化一些。 Markdown Plus math 语法准备向这个看齐。

@songsuoyuan
Copy link
Contributor Author

恩,$latex ...$是WP LaTeX的语法,使用$...$有一个潜在的副作用是如果你想表达 I pay 100$ to Alice and 200$ to Bob. 就需要将美刀符号转义:I pay 100$ to Alice and 200$ to Bob.

Anyway,是需要固定看齐一个“流行”的语法,我看stackexchange的语法不错!

@tylerlong
Copy link
Contributor

这个调查做得好全面啊: https://github.com/cben/mathdown/wiki/math-in-markdown

全部看了一遍,我目前倾向于采用这种语法:

inline `$E=mc^2$`

今天就动手实现

@songsuoyuan
Copy link
Contributor Author

Cool!

Cannot wait!

gaijin4koma2_peersblog_1200684608

顺便考虑加入载入本地文件 & 保存md到本地吗?

@tylerlong
Copy link
Contributor

载入本地文件 & 保存md到本地, 这个是客户端做的事情。 目前Mac app已经发售了: https://itunes.apple.com/us/app/markdown-plus/id972585766?mt=8

在线版是没有办法读写本地文件的。 只能通过upload和download的方式交互,很蹩脚。 当然也可以朝evernote那样的方向去做,那样的话项目就大了去了。

在线的编辑器只能说同步到网盘,或者evernote,直接读写本地文件技术上不可能。否则就是浏览器的安全漏洞。

欢迎进一步交流 😄

@songsuoyuan
Copy link
Contributor Author

看到即将支持inline公式就已经入手啦 ^u^

BTW 我也考虑了这个问题,解决方法是upload 和 download 的交互…… 在工具栏的后面加了两个图标——上传和下载。。。http://xcoffee.me/markdown-plus/index.html

@tylerlong
Copy link
Contributor

搞定。

v1.3.5 已经支持 inline math 了

screen shot 2015-04-03 at 8 23 18 pm

@tylerlong
Copy link
Contributor

@songsuoyuan http://xcoffee.me/markdown-plus/index.html 你这个还是挺有创意的。挺能折腾。我考虑下是不是直接把你那边的东西融合到 Markdown Plus 主代码中。

或者干脆一步到位,做个动态网站。 静态网站能做到你那个那种程度已经是极限了。

这个可以另外开个issue再讨论。

@tylerlong
Copy link
Contributor

刚才看了您的博客 http://xcoffee.me/ 原来是数学高手啊,佩服佩服! 已订阅RSS,希望坚持更新!

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

No branches or pull requests

2 participants