[OS X TeX] making an index (nomenclature)

John Collins jcc8 at psu.edu
Tue Feb 6 01:39:23 CET 2024


 From the command line, there's only a latexmk command, but no pdflatexmk.  You 
invoke latexmk as 'latexmk -pdf ...' to get it to use pdflatex for compiling 
the document.  (By default, latexmk uses latex.)

To get what you want from the command line:

1. Create a file named latexmkrc in the document directory containing the 
following:

    # Custom dependency and function for nomencl package
    add_cus_dep('nlo', 'nls', 0, 'makenlo2nls');
    sub makenlo2nls {
        system("makeindex -s nomencl.ist -o '$_[0]'.nls '$_[0]'.nlo");
    }
    # Arrange for cleanup operations to remove .nlo and .nls files
    push @generated_exts, 'nlo', 'nls';

    # Use pdflatex to compile .tex documents (unless overridden on CL):
    $pdf_mode = 1;

That configures latexmk to deal with nomenclature and to use pdflatex.

2. Then you can just run

    latexmk sample.tex

(Change the filename to whatever you are using, of course.)

John


On 2/5/24 6:24 PM, Nicolae Garleanu wrote:
> I don’t mean to try to have anyone else waste time on this, but just in case
> it rings a bell with anyone: On my “real” file, 1. If I run makeindex from
> command line all OK. 2. The % !TEX program = pdflatexmk snippet at the top
> of the file does not do anything. It does work on the MWE. The two files are
> in the same directory. All the nomenclature related commands in the MWE are
> also in the real file.Is there a way to run pdflatexmk from the command line
> as a check? Just writing it followed by file name gives me a “command not
> found" error (as it perhaps should).
----------- Please Consult the Following Before Posting -----------
TeX FAQ: https://www.tug.org/mactex/faq/index.html
List Reminders and Etiquette: https://sites.esm.psu.edu/~gray/TeX/
List Archives: http://dir.gmane.org/gmane.comp.tex.macosx
                https://email.esm.psu.edu/pipermail/macosx-tex/
TeX on Mac OS X Website: https://www.tug.org/mactex/index.html
List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex



More information about the macostex-archives mailing list.