NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Latex: Producing multiple pdfs


On Wed, Apr 01, 2020 at 08:38:42AM +0530, Mayuresh wrote:
> This is slightly OT, though I think there is a sizable latex user base
> here, so thought of seeking suggestion.
> I have a requirement of producing a few hundred pdf documents, such as
> invoices.
> Currently I produce 1 .tex file with all pages together. Compiling it
> takes a second or two and then I split it into 1 pagers using ghostscript,
> which takes a few seconds.
> Above approach is fast, but it has to assume that each invoice contained
> in the bigger pdf is a one pager. I want to relax this constraint.
> If I produce separate .tex files (1 per invoice) the total time to compile
> them into pdf runs into a few minutes. The io required to load the common
> packages etc just repeats a few hundred times.
> Have been looking for _efficient_ ways to produce multiple pdf files from
> 1 .tex source - say section-wise where each section doesn't have to have
> fixed no of pages.
> Even a combination of tools is ok - e.g. can I leave some markers in the
> pdf and let some tools sense them and break the pdf on them, including
> deriving the name of the pdf to produce.
> Any suggestions?

I had a report about the runtime comparison between TeXLive based and
kerTeX and since kerTeX is pure C, with the strict minimum of code
added, producing dvi and depending on nothing but the C library and 
being statically linked, the comparison was drastically in favor of

So may I suggest that you try with kerTeX? but splitting the TeX files
(kerTeX produces dvi; then using kerTeX dvips and after that gs' ps2pdf).

It supposes that the LaTeX file is not using packages that rely directly
on tex producing pdf natively but give, if used, whatsit PS hints so that the conversion
dvi -> ps -> pdf will give you the desired result.

Of course, kerTeX compiles on NetBSD whatever machine but also almost
on any other OS and even on special ARM based or even Android devices.

It can be installed without messing up a TeXLive
installation (it's orthogonal; so you can also remove it completely by deleting two
directories and the which_kertex(1) script generally in /usr/pkg/bin for
a NetBSD installation).

I'd be curious to hear about the result.

To install get and run:

After that, you can add packages:

sh install

the available packages are on:

and it includes, amongst the packages, LaTeX and a bunch of LaTeX related packages (the AMS
fonts are included in the core kerTeX along with the CMR).

Getting, compiling and installing is a matter of a couple of minutes
(it's only 11MB downloaded by the script). For the packages, it depends on the
packages (but it's generally only a matter of minutes too).

        Thierry Laronde <tlaronde +AT+ polynum +dot+ com>
Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C

Home | Main Index | Thread Index | Old Index