[OS X TeX] TeXShop: platexmkrc for making glossaries (and indexes) with pdflatexmk engine?

Herbert Schulz herbs at wideopenwest.com
Thu Sep 29 11:16:15 CEST 2016


> On Sep 29, 2016, at 3:59 AM, Herbert Schulz <herbs at wideopenwest.com> wrote:
> 
> 
>> On Sep 28, 2016, at 2:43 PM, Murray Eisenberg <murrayeisenberg at gmail.com> wrote:
>> 
>> 
>>> On27 Sep 2016 20:17:46 -0500 mHerbert Schulz <herbs at wideopenwest.com>wrote:
>>> 
>>>> On Sep 27, 2016, at 7:30 PM, Murray Eisenberg <murrayeisenberg at gmail.com> wrote:
>>>> 
>>>> I?d like to be able to make glossaries (via the glossaries.sty package) when I run the pdflatexmk engine from within TeXShop.
>>>> AND still to make multiple indexes.
>>>> 
>>>> Here?s the current platexmkrc file (in the document?s source file folder):
>>>> 
>>>> add_cus_dep('glo', 'gls', 0, 'makeglo2gls');
>>>> 	sub makeglo2gls {
>>>> 			system("makeindex -s basic.gst -t '$_[0]'.glg -o '$_[0]'.gls '$_[0]'.glo");
>>>> 	};
>>>> $makeindex = "makeindex -s %R.ist %O -o %D %S?;
>>>> 
>>>> What changes are needed to that?
>>>> 
>>>> Note that I will likely be using different style files for the indexes, on the one hand, and the glossaries, on the other hand.
>>>> 
>>>> ---
>>>> Murray Eisenberg			murrayeisenberg at gmail.com
>>>> 503 King Farm Blvd #101	Home (240)-246-7240
>>>> Rockville, MD 20850-6667	Mobile (413)-427-5334
>>> 
>>> 
>>> It depends...
>>> 
>>> If you are only using the basic properties of the glossaries package take a look at ~/Library/TeXShop/bin/latexmkrcedit and you'll see an entry for acronyms using the glossaries package that looks like
>>> 
>>> add_cus_dep('acn', 'acr', 0, 'makeacn2acr');
>>> 	sub makeacn2acr 
>>> 	{system("makeindex -s '$_[0]'.ist -t '$_[0]'.alg -o '$_[0]'.acr '$_[0]'.acn");
>>> 	}
>>> 
>>> additional glossaries can be set up like that. If they need special .ist files you'll make separate `sub' files with the ist name set. Note: typesetting the document produces the .acn file and makeindex processes it to produce the .acr file which is then read in when typesetting again. Make sure you get the order right! If the `sub makeacn2acr' does the job you need then you need only duplicate the add_cus_dep line and substitute the extensions you are using leaving the sub call the same.
>>> 
>>> If you intend to use some of that fancy things that the glossaries package can do (that may need processing by xindy, etc.) you may want to go to my download site, <https://herbs.github.io>, and download `TeXShop latexmk and advanced glossaries package use.zip>. It contains the files that need to be changed as well as instructions for making the change, etc.
>> 
>> When you say to “make separate ‘sub’ files with the list name set”, do you mean simply additional add_cus_dep… entries?
> 
> Howdy,
> 
> First there is a `dependency' which defines that a file with extension xxx is converted to a file with extension yyy by a rule zzz. Then you need to define a `rule', i.e., zzz above, that tells latexmk exactly how to process xxx to get yyy. In latexmk the "add_cus_dep{'xxx', 'yyy', 0, 'zzz'};" command creates the `dependency' while the "sub zzz {...};" command creates the rule. The use of '$_[0]' in the rule is a general name for the root file name to be put in the command defined there. Notice that in the rule  you originally gave there is an '$_[0]'.ist for the style file name so there is a single style file that will be used; you could make a rule for each dependency that uses a special .ist file.
> 
>> And is there any reason such items cannot go into platexmkrc (in the source document’s directory)?   (So that I don’t need to edit existing engines or add new engines)?
>> 
> 
> Definitely use a platexmkrc file since what you are trying to do is needed only for this particular project.
> 
>> ---
>> Murray Eisenberg			murrayeisenberg at gmail.com
>> 503 King Farm Blvd #101	Home (240)-246-7240
>> Rockville, MD 20850-6667	Mobile (413)-427-5334
> 
> Good Luck,
> 
> Herb Schulz
> (herbs at wideopenwest dot com)

Howdy,

PS: please send me a copy of your preamble commands for creating the  `glossaries' and I'll see if I can put together a platexmkrc file for them.

I still suggest you download and install the `TeXShop latexmk and advanced glossaries package use.zip' file from <https://herbs.github.io>, unzip it and install it as instructed (it's easy). Those changes change the glossaries rules so they use the `makeglossaries` command, rather than the `makeindex` directly. You lose direct backward compatibility with the old glossary package but a supplied platexmkrc file for use with old projects that still use the glossary package is supplied too.

Good Luck,

Herb Schulz
(herbs at wideopenwest dot com)






----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: https://www.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: http://mactex-wiki.tug.org/
List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex



More information about the macostex-archives mailing list