LaTeX for PDF generation in production [closed]
Asked Answered
C

4

15

I used LaTeX for writing couple of white papers while I was in grad school. From that I have a really good impression about it in terms of what LaTeX allows user to do, especially the fine control it provides over formatting, etc.

Now I am debating whether I should actually use LaTeX for our production apps to generate PDFs. I have tried several commercial and free PDF libraries (PDFSharp/MigraDoc, iTextSharp, Expert PDF, etc) and none of them provide the amount of fine control I need without making the code base extremely difficult to maintain in long run.

If I do decide to go this route it will be done from C#. Since LaTeX already has command line interface, I should be able to do that pretty easily from C# as an external process forked from my program.

But I was looking for some comments from the community.

  1. Has anyone tried it? If so, what were some gotchas?
  2. What do you think about the idea -- pros and cons (I am more interested in gotachas)?

All feedback is welcome.

Cobnut answered 31/7, 2009 at 2:7 Comment(0)
O
7

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.
Oubliette answered 31/7, 2009 at 2:26 Comment(1)
"Official" support might be non-existent, but there are plenty of mailing lists and forms to discuss TeX and LaTeX.Popele
D
0

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.

Dawnedawson answered 31/7, 2009 at 2:15 Comment(2)
Only Cygwin? Was there any trouble with MiKTeX?Aronoff
MiKTeX works well. You can access via the Windows Command Prompt. And through .bat files.Popele
D
0

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.

Desideratum answered 31/7, 2009 at 2:33 Comment(0)
L
0

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.

Lely answered 1/8, 2009 at 7:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.