从 Objective-C 生成 LaTeX 和 PDF

发布于 2024-12-27 14:22:41 字数 151 浏览 2 评论 0原文

我想从 Objective-C 生成一个 LaTeX 文档并用 pdfLatex 编译它,这样我最终就有了一个 PDF。

是否有一个 SDK 可以做到这一点,或者我是否需要编写一些来自 NSString 的 LaTeX 代码并使用 NSTask 运行 pdflatex ?

I want to generate a LaTeX document from Objective-C and compile it with pdfLatex so that I have an PDF in the end.

Is there a SDK to do this, or do I need to write to file some LaTeX code from a NSString and run pdflatex with a NSTask ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

对你再特殊 2025-01-03 14:22:41

在调用 TeX 方面已经做了一些工作。有 TeX 守护进程,它是 PyTeX,看起来它正在做你需要的事情。我已经看到这个系统在工作,但我自己没有使用过它,我不确定它的当前状态。

另一方面,如果您以编程方式执行此操作以获得方程位图(或类似的东西,您的问题模糊地暗示了这一点),那么您可能会对 dvipng 或 < code>dvi2bitmap 库,完全跳过 postscript/PDF。

一般来说,在过去做这样的事情时,我发现安排我生成的 LaTeX 是相当高级的,并且详细的布局推迟到您自己编写的类或样式是很有用的。这意味着您可以在头脑中处于 LaTeX 模式时调整 LaTeX 布局的细节,最终不会那么混乱。

Some work has been done on calling out to TeX. There's the TeX daemon, which is part of PyTeX, and which looks like it's doing something like what you need. I've seen this system working, but haven't used it myself and I'm not sure of its current status.

If, on the other hand, you're after doing this programmatically in order to get equation bitmaps (or something like that, which your question vaguely suggests), then you might be interested in the dvipng or dvi2bitmap libraries, which skip postscript/PDF entirely.

As a general point, when doing things like this in the past, I've found it useful to arrange that the LaTeX I generate is pretty high-level, and the detailed layout is deferred to a class or style that you write yourself. That means that you can tune the details of the LaTeX layout while mentally in a LaTeX mode, which ends up less confusing in the end.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文