在 C# 桌面应用程序中漂亮的打印数学 [英] Pretty printing math in C# desktop application

查看:32
本文介绍了在 C# 桌面应用程序中漂亮的打印数学的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 C# (winforms) 桌面应用程序中打印数学方程式的最佳方法是什么?源的格式并不重要;我可以用一点点努力生成几乎任何东西.重要的是它应该是相对较高的性能和较低的开销(我知道,我应该只选择 {performance, size, features} 中的 2 个,但我想要全部 3 个.)

What is the best method of printing math equations in a C# (winforms) desktop application? The format for the source is not important; I can generate almost anything with a little effort. What is important is that it should be relatively high performance and low overhead (I know, I'm only supposed to pick 2 of { performance, size, features } but I want all 3.)

我考虑过的事情:

  • LaTeX 通过 System.Process() -> dvipng.问题:即使是最小的 LaTeX 安装也大约 200 MB.考虑到我的应用目前约为 400k,我认为这有点过分了.
  • 为网络设计的某种基于 JS 的数学渲染库,例如JS数学.问题:创建 HTML 输出,仍然需要在 WebBrowser 中显示.性能低(可能非常低).
  • 自己动手.问题:复制前人的作品需要花费大量时间和精力.难以用 C# 绘制文本.

有什么建议吗?你们中有人过去做过这种事情吗?

Any suggestions? Have any of you done this sort of thing in the past?

推荐答案

一些谷歌搜索把我带到了这个 CodeProject 文章:它使用 MimeTex,这是一个从乳胶公式生成 gif 的库.您必须使用 PInvoke 才能在 C# 中使用它,但一切似乎都在文章中.

Some googling lead me to this CodeProject article: it uses MimeTex, a library that generates gif from latex formulas. You'll have to use PInvoke to have it in C#, but everything seems to be in the article.

这篇关于在 C# 桌面应用程序中漂亮的打印数学的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆