I am currently working on my master thesis and have to use MiKTeX in combination with TeXnicCenter for writing. I ran across a problem with makeindex
.
In my Tex Files I use the glossary
package. With this I create glossary entries and acronyms. TeXnicCenter allows me to insert one makeindex
command. This is currently
"%tm".glo -t "%tm".glg -s "%tm".ist -o "%tm".gls
With this command I do not get what I exactly want. I get this via running the windows commands:
makeindex Masterarbeit.glo -s Masterarbeit.ist -t Masterarbeit.glg -o Masterarbeit.gls
makeindex -s Masterarbeit.ist -t Masterarbeit.alg -o Masterarbeit.acr Masterarbeit.acn
Is it possible to merge this into one and insert it into TeXnicCenter?
I noticed, that makeindex
has to be executed before the pdf generation. How to trigger this? (So that new acronyms and glossary entries will be used then)
Thanks!
EDIT:
This is the message, when I do not run my windows commands before pdf creation:
pdfTex warning (dest): name{glo:ABC} has been referenced but does not
exist, replaces by a fixed one
Best Answer
The right order of runs to get your pdf file including glossary and acronyms is:
pdflatex Masterarbeit.tex
(This first run creates the files you need for the creation of glossary and acronyms)makeindex
(to make the glossary and the secondmakeindex
to create the acronyms (later we use a batch to do both runs with one call))pdflatex
(to include TOC, glossary and acronyms)pdflatex
(to get correct page numbers at last)I think the quickest way is to create a Windows batch file
mwe.bat
with two lines, containing both commands you need to runmakeindex
two times:Put the batch file into the same directory where you have your
tex
code.I could be that you have to add the relevant pathes, you will see when you try it.
In TeXnicCenter you have predefined output profiles, but you can define new ones by your own. Go in TeXnicCenter menu to
Build
-->Define Output profiles
and select the profile you use to compile. ClickCopy
and type in a new name for the new copied profile, for examplemwe-makeindex
.Check
(La)TeX
and click on the last box to uncheck (do not use makeindex in this profile).Now click on
post processor
, click onnew
(find the symbol for a directory) and type a post processor nameglossary
. Add toexecutables
the name of your batch filemwe.bat
(add the path if needed). To close the window click on the OK button.With this construction you can use the new output profile to compile your
tex
code and to use afterwards automaticly by TeXnicCenter the batch filemwe.bat
to run bothmakeindex
commands you need.After compiling first, you get all files you need for
makeindex
. Then the batch is called to run both commands (thats the reason I used the post processor!).The next compile run can work with both results of both
makeindex
commands.I have only the german version of TeXnicCenter, but if you want I can include screenshots if the advice above is not clear.