1

Is there a way to seamlessly integrate xindy with AUCTeX so that if I execute C-c C-c repeatedly (or alternatively if I execute C-c C-a once) the AUCTex engine will know the sequence of commands required to eventually produce a PDF file of my .tex source, including indices?


Consider the following LaTeX document:

\documentclass{amsart}

\usepackage[xindy]{glossaries}
\makeglossaries
\newglossaryentry{x}{name={world},description={the universe}}

\begin{document}

\title{The Title}
\maketitle

Hello, \gls{x}!

\printglossaries

\end{document}

If I run the following sequence, the resulting document doesn't contain a glossary (see below). Why? How can it be fixed?

  1. C-c Latex
  2. C-c Xindy
  3. C-c Latex
  4. C-c View

The resulting pdf file:

Resulting pdf file shows no glossary.

  • 1
    AUCTeX supports xindy, but doesn't know when it has to run it. Ask the author of the package to issue a warning when it's necessary to run xindy, so that AUCTeX will be able to catch the warning and run the program appropriately. – giordano May 15 '17 at 8:59
  • 1
    @giordano Perhaps some local variable to set? – egreg May 15 '17 at 9:24
  • 1
    xindy is supported in the sense that it is in the list of commands that you can manually run with C-c C-c – giordano May 15 '17 at 9:25
  • 1
    Uhm, the command that is executed is texindy filename-without-extension, but probably that's wrong. It can be adjusted, but I don't know how, the manual of xindy isn't particularly illuminating. On which file you should run texindy on? – giordano May 15 '17 at 10:14
  • 1
    Really?!? :-D I was looking to the manual with man texindy, that's why I couldn't find the information. Anyway, you should customize TeX-command-list with customize-variable RET TeX-command-list RET and change the "Xindy" command with xindy -L english -C utf8 -I xindy -M %s -t %s.glg -o %s.gls %s.glo, then click on the "Apply and save button". – giordano May 15 '17 at 10:29
1

AUCTeX has an entry for Xindy in TeX-command-list since 2013, but probably no one ever used it, since it seems it's wrong.

It turned out that the OP wanted to run the command

xindy -L english -C utf8 -I xindy -M myDoc -t myDoc.glg -o myDoc.gls myDoc.glo

being myDoc the base name of the TeX file.

It's possible to customize the entry for Xindy in TeX-command-list. One is by using customize-variable and is described in this comment, the other one, slightly better, is the following: add the following line to your init file:

(eval-after-load "tex"
  '(setf (cadr (assoc "Xindy" TeX-command-list))
         "xindy -L english -C utf8 -I xindy -M %s -t %s.glg -o %s.gls %s.glo"))

AUCTeX offers the possibility to create a custom sequence of command to run. For example, you can bind the sequence LaTeX - Xindy - LaTeX - View to the C-c a with the following code added to your init file:

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

It should be easy to adapt this code to your needs (change the keyboard shortcut or the sequence).

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.