用于在生产中生成 PDF 的 LaTeX

发布于 2024-07-29 10:34:47 字数 1540 浏览 5 评论 0原文

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

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

发布评论

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

评论(4

儭儭莪哋寶赑 2024-08-05 10:34:47

我之前构建了一个报告生成平台,它使用 plain TeX(特别是 MiKTeX 实现)来生成 PDF 格式的报告。 该平台用于每月生成大约五十个不同性质的报告(主要包含动态生成的表格和图表)。 该系统非常灵活。 报告通过 XML 定义(基于内部定义的报告描述模式)。 该平台允许用户指定源数据库表、要提取的字段、字段的格式、用于过滤适当数据的迷你查询语言以及各种格式元素(页面方向、大小、标题和分类(“公开”、“内部”、“机密”等)。

主要的“陷阱”是需要大量的工作才能最终得到一个可以灵活更改且维护起来不那么麻烦的代码库。 知识(学术界之外)很少见,因此即使这不是您通常角色的一部分,您最终也可能会这样做

优点:

  1. 完全
  2. 控制格式和外观。
  3. “问题”是, TeX 缺点

  1. 正确实施。
  2. 难以
  3. 支持
  4. 实际上是不存在的。

I have previously built a platform for report generation that uses plain TeX (specifically the MiKTeX implementation) to generate reports in PDF format. The platform is used to generate approximately fifty reports per month of varying nature (containing mostly dynamically generated tables and charts). The system is quite flexible. Reports are defined via XML (on an internally-defined report description schema). The platform allows the user to specify a source database table, which fields to extract, the formatting of the fields, a mini query language to filter the appropriate data as well as various formatting elements (page orientation, size, titles, and classifications ("Public", "Internal", "Confidential", etc.).

The main "gotcha" is that it takes a ton of work to end up with a code base that is flexible to change and not a total pain to maintain. A second "gotcha" is that knowledge of TeX (outside of academics) is rare so you could end up becoming the de facto maintainer even if that is not part of your usual role.

Pros:

  1. Beautifully formatted reports.
  2. Complete control over layout and look.
  3. Free.

Cons:

  1. Difficult to implement properly.
  2. Difficult to maintain.
  3. Knowledge transition could be burdensome.
  4. Support is effectively non-existant.
幼儿园老大 2024-08-05 10:34:47

我已经用 LaTeX 完成了一些内部“生产级”文档。

老实说,在 Windows 中生成 LaTeX 文档总体来说是一种糟糕的体验。 除了 Cygwin 之外我一直找不到任何解决方案。 一旦您启动并运行了 Cygwin 环境,就如同从 Cygwin 的 setup.exe 中选择 LaTeX 和相关库一样简单。

我还没有尝试从非 Cygwin 环境运行 LaTeX,但理论上你应该能够运行 C:\Cygwin\usr\bin\latex.exe ——那么就有可能由于您不在 Bash 中,因此将丢失路径,在这种情况下,您可能需要将包含目录传递给后续程序。

如果您决定使用 Docbook 而不是 LaTeX 来编写文档(我建议您至少看一下,它对于软件相关的技术文档更加结构化),我在运行Cygwin 下的 dblatex。 它不在 Cygwin 存储库中,但从源代码安装是小菜一碟。

I've done a few in-house "production level" documents in LaTeX.

Generating LaTeX documents in Windows is an overall horrible experience, to be honest. I was never able to find any solution besides Cygwin. Once you've got the Cygwin environment up and running, it was as simple as picking out the LaTeX and related libraries from Cygwin's setup.exe.

I haven't tried running LaTeX from a non-Cygwin environment, but in theory you should be able to just run C:\Cygwin\usr\bin\latex.exe -- then there's a chance it will be missing paths since you're not in Bash, in which case you might need to just pass the include directories to subsequent programs.

If you decide to use Docbook instead of LaTeX for your documentation (and I would recommend at least giving it a look, it's much more structured for software-related technical documentaion), I had good experience running dblatex under Cygwin. It's not in the Cygwin repositories, but it's a piece of cake to install from source.

假情假意假温柔 2024-08-05 10:34:47

我使用 TeX 完成了各种 PDF 实现。 我最终放弃了 LaTeX,转而使用 ConTeXt (另请参阅 语境花园)。

有一个非常活跃的邮件列表,它广泛用于文档生成,并且有一个针对各种 Unix、Windows 和 Mac OS X 的很好的最小发行版。Windows 上不需要 Cygwin(尽管您确实需要 Ruby)。

我发现 ConTeXt 的 TeX 方法比 LaTeX 更干净,但这可能只是我个人的看法。

I have done various production PDF implementations using TeX. I ended up abandoning LaTeX, and went with ConTeXt (see also Context Garden).

There is a very active mailing list, it is used extensively for document production, and there is a nice minimal distribution for various Unixes, Windows and Mac OS X. There is no need for Cygwin on Windows (although you do need Ruby).

I find ConTeXt approach to TeX cleaner than LaTeX, but that might just be me.

溺深海 2024-08-05 10:34:47

如果您需要发布数据摘要和图表,那么您可以看看 Sweave 。 Sweave 允许将 R 的所有功能与 TeX 混合。 报告的源代码由一个纯 TeX 文件和一些 R 代码块组成,您需要读取、操作、制表或绘制数据。 然后(从命令行)“编译”Sweave 文件,该文件返回一个纯 TeX 文件。

If you need to publish data summaries and graph, then you can have a look at Sweave. Sweave allows to mix all the functionality of R with TeX. The source code of a report consist of a plain TeX file with some R-code chunk were you need to read, manipulate, tabulate or plot data. Then you 'compile' the Sweave file (from the commandline) which returns a plain TeX file.

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