2

How do I need to set up Emacs/AucTeX, so that when I type C-c, C-a, the following sequence of commands will be run? (Note: the LaTeX file name is test.tex.)

lualatex test  
makeglossaries test
makeindex test
biber test
lualatex test
lualatex test

Ideally, if one of the generated auxiliary files is already up-to-date, the corresponding line will be automatically skipped.

  • 1
    If TeX-command-run-all is still sufficiently close to (my) original implementation the next command to run is determined through TeX-command-default (which see). If you need you can just advice TeX-command-default. – Tobias Mar 12 '19 at 14:37
  • @Tobias: I have rewritten my question from scratch. Could you please take another look at it? If you write a detailed answer I will be very grateful. – Evan Aad Mar 18 '19 at 8:20
  • 1
    A per document specification of determined build steps looks very much a job for arara. – gusbrs Mar 18 '19 at 17:30
  • 1
    @EvanAad Could it be that the only difference to the current execution order is the makeglossaries entry? Note also the following comment from TeX-command-default: "makeindex should be run when final document is almost complete" with reference to tex.blogoverflow.com/2012/09/dont-forget-to-run-makeindex – Tobias Mar 19 '19 at 0:12
  • @Tobias: I don't mind the order. Wait. So you're telling me that by simply entering C-c C-a AucTex will know to process a document containing a glossary, an index and a bibliography, without my having to set it up in any special way? – Evan Aad Mar 19 '19 at 5:05
1

Step 1

At the top of the .tex file insert the following.

% arara: lualatex
% arara: biber
% arara: makeglossaries
% arara: makeindex
% arara: lualatex
% arara: lualatex

Step 2

In your ~/.emacs file insert the following.

(with-eval-after-load "tex"
  (add-to-list 'TeX-command-list
        `("Arara" "arara --verbose %s" TeX-run-TeX nil t :help "Run Arara") t))

(with-eval-after-load "latex"
  (define-key LaTeX-mode-map (kbd "C-c C-a")
     (lambda ()
       (interactive)
       (TeX-command-sequence '("Arara" "View") t))))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.