[Tex/LaTex] How to make glossaries in output

acronymsglossaries

This is my sample script. I want to print glosssaries. I am trying to do that but nothing gets printed. I am using

\documentclass[oneside,12pt]{report}
    \usepackage{fancyheadings}
   \usepackage[acronym]{glossaries}
    \makeglossaries
  \newglossaryentry{electrolyte}{name=electrolyte,%
    description={solution able to conduct electric current}}

\newacronym{svm}{SVM}{support vector machine} 

\begin{document}

\printglossary[type=acronym]
\printglossary


\chapter{\textbf{Background}}

Some text about \gls{svm}.

Some more text about \gls{svm}.

Some text about \gls{electrolyte}.

Some more text about \gls{electrolyte}.


\end{document}

Now I hope that this script works. I minimized the whole script to the point of problem. I compiled this..no glossaries are printing to my document..fortunately i can see them in .glo file..My command to execute the file is latexmk -pdf filename.tex..I included the following code in .latexmk file..

add_cus_dep('glo', 'gls', 0, 'makeglossaries');
add_cus_dep('acn', 'acr', 0, 'makeglossaries');

sub makeglossaries {
    system "makeglossaries $_[0]";
    if ( -z "$_[0].glo" ) {
        open GLS, ">$_[0].gls";
        close GLS;
    }
    return 0;
}

My .glo file contents:

\glossaryentry{electrolyte?\glossaryentryfield{electrolyte}{\glsnamefont{electrolyte}}{solution able to conduct electric current}{\relax }|setentrycounter[]{page}\glsnumberformat}{2}
\glossaryentry{electrolyte?\glossaryentryfield{electrolyte}{\glsnamefont{electrolyte}}{solution able to conduct electric current}{\relax }|setentrycounter[]{page}\glsnumberformat}{2}

My .acn file contents:

\glossaryentry{SVM?\glossaryentryfield{svm}{\glsnamefont{SVM}}{support vector machine}{\relax }|setentrycounter[]{page}\glsnumberformat}{2}
\glossaryentry{SVM?\glossaryentryfield{svm}{\glsnamefont{SVM}}{support vector machine}{\relax }|setentrycounter[]{page}\glsnumberformat}{2}

Now, I hope i get some response..tack..

Best Answer

Your revised MWE examples works fine. For me it produces on the first page:

enter image description here

and on the following page:

enter image description here

So the problem is in how you process the file. I personally use TeXShop and a script similar to that recently posted at: makeglossaries hangs waiting for input on mac. For adapting latekmk you should refer to How to make Latexmk use makeglossaries?