3

I am currently writing the glossary for my Master Thesis and I would like to nest the 3 Kepler Laws under a generic "Kepler Laws" entry, but be able to call any independently.

An example of what I want:

entry 1
    blah, blah, blah
...
Kepler's Laws
   Kepler 1st law
       blah, blah, blah
   Kepler 2nd law
       blah, blah, blah
   Kepler 2nd law
       blah, blah, blah       
...
entry last
   blah, blah, blah    

Any idea on how to do this?

I was thinking on something along the lines of:

\documentclass{ThesisClass}
\usepackage{glossaries}

\begin{document}

\newglossaryentry{Kepler1st}{name = Kepler\'{}s 1\textsuperscript{st} Law , description = First law,}
\newglossaryentry{Kepler2nd}{name = Kepler\'{}s 2\textsuperscript{nd} Law , description = second law,}
\newglossaryentry{Kepler3rd}{name = Kepler\'{}s 3\textsuperscript{rd} Law , description = third law,}
\newglossaryentry{KeplerLaws}{name = Kepler Laws of orbital movement , description = \glsentryfull{Kepler1st}\\\\glsentryfull{Kepler2nd}\\\\glsentryfull{Kepler3rd}\\ ,}

\printglossary[style=altlist,title=Nomenclature]

\makeglossaries

\end{document}

but for that does not work, I just get empty brackets under KeplerLaws. Worst case scenario, I will just create the 3 entries and that's it, but would prefer to nest them together.

2
  • 1
    Did you try parent=KeplerLaws for Kepler1st, Kepler2nd and Kepler3rd? Sep 9, 2013 at 10:17
  • @ThorstenDonig: Tried it now, now I get empty brackets and underneath the description of the laws Sep 9, 2013 at 13:03

1 Answer 1

3

You should define a custom style to achieve what you want.

This is an example, based on the index default style. Note that it can be used only if you have one level's children.

\documentclass{article}
\usepackage{glossaries}

\newglossaryentry{KeplerLaws}{name = {Kepler Laws of orbital movement}, description = {Kepler laws}}
\newglossaryentry{Kepler1st}{name = {Kepler\'{}s 1\textsuperscript{st} Law}, description = {First law}, parent = {KeplerLaws}}
\newglossaryentry{Kepler2nd}{name = {Kepler\'{}s 2\textsuperscript{nd} Law}, description = {Second law}, parent = {KeplerLaws}}
\newglossaryentry{Kepler3rd}{name = {Kepler\'{}s 3\textsuperscript{rd} Law}, description = {Third law}, parent = {KeplerLaws}}

\newglossarystyle{mystyle}{%
  \glossarystyle{index}%
  \renewcommand*{\glossaryentryfield}[5]{%
  \item\glsentryitem{##1}\textbf{\glstarget{##1}{##2}}%
    \ifx\relax##4\relax
    \else
      \space(##4)%
    \fi
    \subitem##3\glspostdescription \space ##5}%
    \renewcommand*{\glossarysubentryfield}[6]{%
      \ifcase##1\relax
        % level 0
        \item
      \or
        % level 1
        \subitem
        \glssubentryitem{##2}%
      \else
        % all other levels
        \subsubitem
      \fi
      \textbf{\glstarget{##2}{##3}}%
      \ifx\relax##5\relax
      \else
        \space(##5)%
      \fi
      \subsubitem##4\glspostdescription\space ##6}%
}

\makeglossaries

\begin{document}

\glsaddall
\printglossary[style=mystyle,title=Nomenclature]

\end{document} 

Output

enter image description here

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .