% This file is embedded in glossaries-user.pdf 
% Example 38 The tree* style: aligning names and symbols for each level
% Label: "ex:tree*alignnames"
% arara: pdflatex
% arara: pdflatex
% arara: pdfcrop
\documentclass[12pt]{article}
\pagestyle{empty}
\usepackage[T1]{fontenc}
\usepackage[nopostdot,style=tree*]{glossaries}
\makenoidxglossaries
\loadglsentries{example-glossaries-user.tex}
\loadglsentries{example-glossaries-symbols.tex}
\loadglsentries{example-glossaries-constants.tex}
\glsadd{sample-i}
\glsadd{sample-i-0}
\glsadd{sample-i-1}
\glsadd{sample-i-2}
\glsadd{sample-p}
\glsadd{sample-w}
\glsadd{sample-w-0}
\glsadd{sample-w-1}
\glsadd{sample-w-2}
\glsadd{i-constant}
\glsadd{pi-constant}
\glsadd{psi}
\glsadd{Gauss-constant}
\glsadd{Gieseking-constant} 

\setupglossaries{
style-options={
 tree*={
  name-width=widest,
  symbol-width=widest,
  sub-name-width=widest,
  sub-symbol-width=widest,
 }
}
} 

\renewcommand{\glsnoidxitemhook}[2]{% 
 \GlsTreeUpdateWidestNameOrSymbol[#1]{#2}% 
} 
\begin{document}
 \printnoidxglossary 
\end{document}
