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

Bug#1080322: latexmk: add -parallel=N option



Package: latexmk
Version: 1:4.85-1
Severity: wishlist

Thanks for maintaining latexmk, which I love! I'm a total convert,
proselytizing all my LaTeX-using friends to abandon crufty Makefiles
with multiple idiosyncratic invocations of pdflatex, mkindex, etc, and
just use latexmk.

The one big fly in the ointment is when we have a big project that has
multiple independent .tex files generating multiple documents. For
that, we really want to go parallel. So we end up with something like:

    $ cat Makefile

    TARGETS=foo.pdf bar.pdf baz.pdf
    all: $(TARGETS)
    %.pdf: %.tex; latexmk $<
    FORCE:
    $(TARGETS): FORCE

and then make -j to get a parallel build.
This seems like a shame when

    $ cat latexmkrc
    # -*- perl -*-
    $pdf_mode = 1;
    $dvi_mode = $postscript_mode = 0;
    $do_cd = 1;
    push @extra_pdflatex_options, "-shell-escape";
    push @extra_pdflatex_options, "-interaction=nonstop";
    @default_files = (
        'anne/abstract.tex',
        'bob/background.tex',
        'charlie/intellectual-property.tex',
        'flaubert/sow.tex',
        'paul/proposal.tex'
        );

knows about all the various targets, so replicating the information in
the Makefile seems icky. And you get additional iciness when you start
adding clean targets and whatnot. And when multiple included graphic
files need their format converted, which could be done in parallel but
is instead serialized.

So I asked Google Gemini:

    🤠 How can I tell latexmk to build multiple targets in parallel?

and it replied:

    🟆 To configure `latexmk` to build multiple targets in parallel, you
        can use the `-parallel` option. This option specifies the number of
        parallel jobs that `latexmk` can run simultaneously.

Of course it was hallucinating. Please make its hallucination a reality!


Reply to: