Yes, you can.
Just load the glossaries
package as
\usepackage[toc]{glossaries}
and then write
\renewcommand*{\acronymtype}{acronym}
\newglossary[alg]{acronym}{acr}{acn}{\acronymname}
Thus, if you rewrite your example as:
% arara: pdflatex: {synctex: yes}
% arara: makeglossaries
% arara: pdflatex: {synctex: yes}
% arara: pdflatex: {synctex: yes}
% arara: pdflatex: {synctex: yes}
% !TEX program = pdflatex
\documentclass[a4paper,11pt, twoside]{memoir}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[italian]{babel}
\DeclareRobustCommand*{\acronimo}[1]{%
\mbox{\sffamily\scshape\MakeLowercase{#1}}}
\usepackage{xcolor}
\colorlet{grigioScuro}{gray!75!black}
\colorlet{grigioChiaro}{gray!95!black}
\colorlet{grigioSfondo}{gray!12!white}
\usepackage{hyperref}
\hypersetup{pdfborder=0 0 0,pdfstartpage=1,pdftitle={Titolo PDF},pdfauthor={Nome Cognome},hidelinks,unicode}
\usepackage{xifthen,xkeyval,xfor,amsgen}
\usepackage[toc]{glossaries}
\usepackage{glossary-mcols} %su più colonne
\renewcommand*{\acronymtype}{acronym}
\newglossary[alg]{acronym}{acr}{acn}{\acronymname}
\makeglossaries
\renewcommand*{\glsnamefont}[1]{\textcolor{gray}{\textsf{\MakeLowercase #1}}}
\renewcommand*{\glsnamefont}[1]{{\color{grigioScuro}\sffamily\scshape\MakeLowercase #1}}
\addto\captionsitalian{%
\renewcommand*{\glossaryname}{Glossario}%
\renewcommand*{\acronymname}{Acronimi}%
\renewcommand*{\entryname}{Nomenclatura}%
\renewcommand*{\descriptionname}{Descrizione}%
\renewcommand*{\symbolname}{Simbolo}%
\renewcommand*{\pagelistname}{Elenco delle pagine}%
\renewcommand*{\glssymbolsgroupname}{Simboli}%
\renewcommand*{\glsnumbersgroupname}{Numeri}
}
\ProvidesDictionary{glossaries-dictionary}{Italian}
\providetranslation{Glossary}{Glossario}
\renewcommand*{\glossaryentrynumbers}[1]{\quad #1}
%su più colonne
\renewcommand*{\glsmcols}{2}
\glossarystyle{mcolindex}
\newacronym{fem}{fem}{Finite Element Method}
\newglossaryentry{nomeVoce}{name={nome voce},description={Descrizione della voce}}
\begin{document}
\printglossary[type=\acronymtype]
\printglossary
\glsaddall
\end{document}
you will have
i.e. the same result as in your example but without the option acronym
.
Anyway I can't figure why you want to do that.
Glossary information is only written to the external files when commands like \gls
are used. Without a minimal working example, it's difficult to say for certain, but if you're using \include
then it may be possible that you're using a command like \includeonly
to only selectively include chapters. If the excluded files contain commands like \gls
they'll be skipped when the file is skipped, which means that they won't be written to the glossary file and no glossary will appear.
Here's an example. The main file test.tex
:
\documentclass{report}
\usepackage{glossaries}
\makeglossaries
\loadglsentries{example-glossaries-brief}
\begin{document}
\include{chapters/test-ch1}
\include{chapters/test-ch2}
\include{chapters/test-ch3}
\printglossaries
\end{document}
In the chapters
directory (folder) the files are:
test-ch1.tex
:
\chapter{Sample}
\gls{lorem}
test-ch2.tex
:
\chapter{Another}
\gls{dolor}
test-ch3.tex
:
\chapter{No Glossary Entries Here}
Now the following document build sequence:
pdflatex test
makeglossaries test
pdflatex test
will correctly generate the glossary. However, suppose I now add
\includeonly{chapters/test-ch3}
to the preamble. This excludes the two chapters that use \gls
and only includes the chapter that doesn't contain any \gls
(or similar) command. This means that nothing is written to the glossary. Now recompile (rebuild) the document:
pdflatex test
makeglossaries test
This produces an error message from makeglossaries
:
makeglossaries version 2.15 (2014-07-30)
added glossary type 'main' (glg,gls,glo)
Warning: File 'test.glo' is empty.
Have you used any entries defined in glossary 'main'?
Remember to use package option 'nomain' if you
don't want to use the main glossary.
This is because nothing has been written to test.glo
because all the commands that perform that write have been skipped.
What should you do? Well, if you're excluding chapters, that means you're still working on the document, in which case it doesn't matter. The document is already an incomplete draft since there are some chapters missing, so just skip the makeglossaries
step until you're ready to check the entire document rather than just the particular chapter you're working on. Once you go back to including the files that contain glossary references, then go back to building the glossary.
Edit: Another possibility is that you may be using an old version of makeglossaries
which didn't pick up \@input
from the .aux
file. This was corrected in makeglossaries
version 1.9 (distributed with glossaries
v2.07 2010/07/10).
Best Answer
Simply add the
acronym
option when loading the package: