Revamped version of my answer at https://tex.stackexchange.com/a/71094/4427
The following code allows to reset the long form. The command \resetspecies can be called anywhere; if no optional argument is given, all species will be reset, otherwise only those specified as in the following example.
With \xpreto{\section}{\resetspecies}, all species will be reset at a new section (use \chapter if the resetting is to be done at chapters).
The notable difference with the previous version is that the macro name should be given without the backslash (for ease of implementation).
\documentclass{article}
\usepackage{xspace}
\usepackage{xparse,xpatch}
\ExplSyntaxOn
%% Meta-Command for defining new species macros
\NewDocumentCommand{\species}{mmm}
{
\daniel_species_define:nnn { #1 } { #2 } { #3 }
}
\prop_new:N \g_daniel_species_names_prop
\prop_new:N \g_daniel_species_used_prop
\prop_new:N \l__daniel_species_temp_prop
\cs_new_protected:Nn \daniel_species_define:nnn
{% save the long and short forms in a property list
\prop_gput:Nnn \g_daniel_species_names_prop { long#1 } { #2 }
\prop_gput:Nnn \g_daniel_species_names_prop { short#1 } { #3 }
% the long form is initially chosen
\prop_gput:Nnn \g_daniel_species_used_prop { #1 } { 0 }
\cs_new_protected:cpn { #1 }
{% if the value in the "used" property list is 0 use the long form
\int_compare:nNnTF { \prop_item:Nn \g_daniel_species_used_prop { #1 } } = { 0 }
{
\textit { \prop_item:Nn \g_daniel_species_names_prop { long#1 } }
}
{
\textit { \prop_item:Nn \g_daniel_species_names_prop { short#1 } }
}
% mark the species as used
\prop_gput:Nnn \g_daniel_species_used_prop { #1 } { 1 }
\xspace
}
}
\NewDocumentCommand{\resetspecies}{ o }
{
\IfNoValueTF { #1 }
{% reset all species
\prop_clear:N \l__daniel_species_temp_prop
\prop_map_inline:Nn \g_daniel_species_used_prop
{
\prop_put:Nnn \l__daniel_species_temp_prop { ##1 } { 0 }
}
\prop_gset_eq:NN \g_daniel_species_used_prop \l__daniel_species_temp_prop
}
{% reset only the specified ones
\clist_map_inline:nn { #1 }
{
\prop_gput:Nnn \g_daniel_species_used_prop { ##1 } { 0 }
}
}
}
\ExplSyntaxOff
\xpreto{\section}{\resetspecies}
%% Defining new species
% The first argument is the name of the macro you will call in the document.
% The second argument is what is written the first time the macro is called
% The third argument is what is written every subsequent time the macro is called.
\species{ecoli}{Escherichia coli}{E.~coli}
\species{rsphaeroides}{Rhodobacter sphaeroides}{R.~sphaeroides}
\species{abrasilense}{Azospirillum brasilense}{A.~brasilense}
\species{celegans}{Caenorhabditis elegans}{C.~elegans}
\species{pseudomonads}{Pseudomonads}{Pseudomonads}
%%
\begin{document}
\section{First}
\ecoli is an example of a model species. People study \ecoli because
people have studied \ecoli. Also \abrasilense.
\resetspecies
\ecoli is an example of a model species. People study \ecoli because
people have studied \ecoli. Also \abrasilense and \celegans.
\resetspecies[ecoli,celegans]
\ecoli is an example of a model species. People study \ecoli because
people have studied \ecoli. Also \abrasilense and \celegans.
\section{Second}
\ecoli is an example of a model species. People study \ecoli because
people have studied \ecoli. Also \abrasilense and \celegans.
\end{document}

glossariesinstead of your own macros. – Henri Menke Nov 13 '17 at 21:07glossaries, however I found it very difficult to run in Windows. It wasn't clear how to run\makeglossaries– Daniel Valencia C. Nov 13 '17 at 21:10