在 LaTeX 中排版数学函数以在 Android 应用程序中呈现 [英] Typesetting math functions in LaTeX to render in Android Application

查看:23
本文介绍了在 LaTeX 中排版数学函数以在 Android 应用程序中呈现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道是否可以使用 LaTeX 标记语言来格式化文本以在 Android 应用程序中显示?

例如,可以使用 Html.formHtml("String") 方法将 TextView 的文本格式化为 HTML 以将字体大小更改为小字体和上标等:

TextView aTextView=(TextView) findViewById(R.id.textview1);aTextView.setText(Html.fromHtml("2<small><sup>5</sup></small>"));

将在 TextView 中显示 25.


但是,我想要更高级的东西,并使用 LaTeX 来格式化文本来表示数学函数,并在 TextView(或其他东西)中将其呈现为正确格式的数学函数.

例如,LaTeX 标记Evaluate the sum $displaystylesumlimits_{i=0}^n i^3"应呈现为:


(来源:artofproblemsolving.com)子>


如果有其他方法可以标记数学函数,以便它们在 Android 应用程序中正确显示,而不是使用 LaTeX,我愿意接受建议!

解决方案

Latex 不是用 java 编写的,所以可能很难在 android 上运行 JLaTexMath 是一个您可以使用的 Java 端口,但可能不是直接开箱即用的.

另一种选择可能是在服务器上运行一个接受公式并返回图像的服务,如果你的公式变得非常复杂,这甚至可能比渲染公式更快.<​​/p>

这也将减少您对 android 平台的依赖,因此您更有可能将您的应用程序移植到 iPhone 和 Html5.

Does anyone know if it's possible to use LaTeX markup language to format text for display in an Android application?

For example the text for a TextView can be formatted with HTML to change the font size to small and superscript etc by using the Html.formHtml("String") method:

TextView aTextView=(TextView) findViewById(R.id.textview1);
aTextView.setText(Html.fromHtml("2<small><sup>5</sup></small>"));  

Will display 25 in the TextView.


However what I'd like to something more advanced and format text using perhaps LaTeX to represent Math Function and have that render as a correctly format Math Function in a TextView (or something else).

For example the LaTeX markup "Evaluate the sum $displaystylesumlimits_{i=0}^n i^3" should be rendered to:


(source: artofproblemsolving.com)


If there's some other way to mark up Math Functions so they display correctly in an Android App other than using LaTeX I'm all open to suggestions!

解决方案

Latex is not written in java so may be hard to get running on the android JLaTexMath is a java port which you may be able to use, but probably not straight out of the box.

One other option maybe to run a service on a server that takes a formula and returns an image, if your formulas get really complex this might even be quicker then rendering the formula.

This will also reduce your reliance on the android platform so you are more likely to be able to port your application to IPhone and Html5.

这篇关于在 LaTeX 中排版数学函数以在 Android 应用程序中呈现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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