MakeIndex, Nomenclature, Glossaries and AcronymsMy journey making "glossaries" work by hardcoding makeindex

Information and discussion about MakeIndex - the tool to generate subject indices for LaTeX documents.
Post Reply
JustA_LaTeXusr
Posts: 42
Joined: Tue Jul 23, 2013 6:48 pm

My journey making "glossaries" work by hardcoding makeindex

Post by JustA_LaTeXusr »

I am using MiKTeX 2.9 64-bit with TeXworks v. 0.4.3 r.857 on Windows 7 Enterprise 64-bit SP1. I just installed the glossaries package and am following http://tex.stackexchange.com/questions/ ... h-texworks to get makeglossaries to work. If I understand correctly (and I'm guessing), I create a new processing "command":

makeindex -s $basename.ist -t $basename.glg -o $basename.gls $basename.glo

This generates the error:

Index style file -t mwe.glg not found.
Usage: C:\Program Files\MiKTeX 2.9\miktex\bin\x64\makeindex.exe
[-ilqrcgLT] [-s sty] [-o ind] [-t log] [-p num] [idx0 idx1 ...]

The presence of "mwe" indicates that the $basename variable is being properly expanded. The "Usage" text indicates that the style file should follow the -s switch and have an ".ist" extenion. I checked that this file exists. The message also seems to indicate that the two words coming after ".ist" is being interpreted as the style file, so obviously it's overlooking $basename.ist. I confirmed that there is no typographical error in "-s $basename.ist".

Is there anything further that I can try to make this work? I am in a locked down environment, so installing anything is just not feasible. I have cygwin Perl, but I want to make the non-Perl solution work because I've run into snafus in the past with invoking cygwin executables from a Windows, with path name issues and carriage-return/linefeed issues.

I've attached a minimum working example. Thanks.

Code: Select all

\documentclass{article}
   \usepackage[toc]{glossaries}
   \newacronym[
      \glsshortpluralkey=MTBFs,
      \glslongpluralkey=mean times between failures
   ]{mtbf}{MTBF}{mean time between failures}
   \makeglossaries
\begin{document}
   \gls{mtbf} \gls{mtbf} 
   \glsresetall
   \glspl{mtbf} \glspl{mtbf} 
   \glsresetall

   \Gls{mtbf} \Gls{mtbf} 
   \glsresetall
   \Glspl{mtbf} \Glspl{mtbf} 
   \glsresetall

   \printglossaries
   \printglossary[type=\acronymtype] 
\end{document}
Last edited by JustA_LaTeXusr on Thu Sep 12, 2013 5:56 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
JustA_LaTeXusr
Posts: 42
Joined: Tue Jul 23, 2013 6:48 pm

My journey making "glossaries" work by hardcoding makeindex

Post by JustA_LaTeXusr »

If I run the makeindex command in my original post from a command line (cygwin's bash), I get the following:

mwe.glg

Code: Select all

This is C:\Program Files\MiKTeX 2.9\miktex\bin\x64\makeindex.exe, version 2.15 [MiKTeX 2.9 64-bit] (kpathsea + Thai support).
Scanning style file C:/path/to/tex/file/mwe.ist.............................done (29 attributes redefined, 0 ignored).
Scanning input file mwe.glo....done (8 entries accepted, 0 rejected).
Sorting entries....done (22 comparisons).
Generating output file mwe.gls....done (6 lines written, 0 warnings).
Output written in mwe.gls.
Transcript written in mwe.glg.
mwe.gls

Code: Select all

\glossarysection[\glossarytoctitle]{\glossarytitle}\glossarypreamble
\begin{theglossary}\glossaryheader
\glsgroupheading{M}\relax \glsresetentrylist %
\glossaryentryfield{mtbf}{\glsnamefont{MTBF}}{mean time between failures}{\relax }{\glossaryentrynumbers{\relax 
		\setentrycounter[]{page}\glsnumberformat{1}}}%
\end{theglossary}\glossarypostamble
I'm just not sure how to integrate this into the TeXworks.
Last edited by JustA_LaTeXusr on Thu Sep 12, 2013 5:59 am, edited 1 time in total.
JustA_LaTeXusr
Posts: 42
Joined: Tue Jul 23, 2013 6:48 pm

My journey making "glossaries" work by hardcoding makeindex

Post by JustA_LaTeXusr »

Here's what I found works for doing the entire tex->PDF compile cycle. Much of this from trial and error, so if anyone has enough experience to streamline it, thanks.

I created a .bat file:

Code: Select all

"C:\Program Files\MiKTeX 2.9\miktex\bin\x64\makeindex.exe" -s "%1.ist" -t "%1.glg" -o "%1.gls" "%1.glo"
"C:\Program Files\MiKTeX 2.9\miktex\bin\x64\texify.exe" --pdf --tex-option=-synctex=1 %1.tex
"C:\Program Files\MiKTeX 2.9\miktex\bin\x64\makeindex.exe" -s "%1.ist" -t "%1.glg" -o "%1.gls" "%1.glo"
"C:\Program Files\MiKTeX 2.9\miktex\bin\x64\texify.exe" --pdf --tex-option=-synctex=1 %1.tex
Everything has to happen twice. I had to give the full path above to avoid my cygwin executables of the same name, but you might be able to avoid this fragility if the other directories in your PATH do not contain files with the above names. The .bat file itsefl should be placed in one of the directories in your PATH. The PATH directories show up in TeXworks's Edit-Preferences->Typesetting->PathsForTeXandRelatedPrograms.

On that same panel, in the Processing Tools section, I created an new entry with an arbitrary name "myProcessingTool" whose "Program" field is specified as the above .bat file (full path not needed since its in a PATH directory). Cygwin users beware that the file specified cannot be a soft link, at least in my experience. For the Arguments field, I simply had $basename.

In the TeXworks editor, I had the following MWE:

Code: Select all

\documentclass{article}
   \usepackage[nonumberlist,nopostdot]{glossaries}
   \newacronym[
      \glsshortpluralkey=MTBFs,
      \glslongpluralkey=mean times between failures
   ]{mtbf}{MTBF}{mean time between failures}
   \newacronym{asdfkajsd}{SDFASDFSAD}{dlkak dl alsd adskf dlkfja}
   \makeglossaries
\begin{document}
   \gls{mtbf} \gls{mtbf} 
   \glsresetall
   \glspl{mtbf} \glspl{mtbf} 
   \glsresetall

   \Gls{mtbf} \Gls{mtbf} 
   \glsresetall
   \Glspl{mtbf} \Glspl{mtbf} 
   \glsresetall

   \gls{asdfkajsd}

   \printglossaries
   \printglossary[type=\acronymtype,style=long,title=DesiredTitle]
\end{document}
Beside the Typeset button, I pulled down the processing tool menu and chose my newly created "myProcessingTool". When I click Typeset, voila, I get the two glossaries requested in the above code. The second being the one I want.

As a new user of the rather sophisticated package, I had limited success with the documentation. But much swimming around in it, combined with trial & error, led to the above (franken?)-"solution", which was starting to look like a dream. The specific details that I found to be elusive were, in order of decreasing elusiveness: (i) How to get an arbitrary title (which the package makes into a chapter heading, at least with my nonexpert usage), (ii) how to get rid of the hyperlinked page numbers on which the acronyms occur or are defined, and (iii) how to get rid of the dots in the acronym table after the acronym expansion. Hopefully, this saves a newbie an evening.
User avatar
nlct
Posts: 276
Joined: Thu Nov 06, 2008 11:15 am

My journey making "glossaries" work by hardcoding makeindex

Post by nlct »

Have you tried any of the following:
The specific details that I found to be elusive were, in order of decreasing elusiveness: (i) How to get an arbitrary title (which the package makes into a chapter heading, at least with my nonexpert usage),
Since you're not using babel, you just need to redefine \glossaryname or \acronymname. (Described in section "1.2.1 Changing the Fixed Names" of the main user guide.)
(ii) how to get rid of the hyperlinked page numbers on which the acronyms occur or are defined,
Use package option "nonumberlist". (See section "2.3 Glossary Appearance Options" of the user guide.)
and (iii) how to get rid of the dots in the acronym table after the acronym expansion.
Use package option "nopostdot". (See section "2.3 Glossary Appearance Options" of the user guide.)

Regards
Nicola Talbot
JustA_LaTeXusr
Posts: 42
Joined: Tue Jul 23, 2013 6:48 pm

Re: My journey making "glossaries" work by hardcoding makein

Post by JustA_LaTeXusr »

Thanks, Nicola. I should have been clearer in my last post. I discovered the solutions you provided with enough web searching and perusing the manual. And I provided the latex code that contains the solutions. I was merely summarizing so that it would show up in a web search if anyone was trying to find a solution to those problems. However, I appreciate your time responding.
Post Reply