0

I am working with the altlist style of the glossaries package and want to produce an output similar to the one here (i.e., using entries and subentries for manual grouping of the symbols). If I try the analogous code for altlist:

\documentclass{report}

\usepackage{setspace}
\usepackage[nopostdot,nonumberlist,acronyms,section]{glossaries}

\newglossarystyle{supergroup}{%
  \setglossarystyle{altlist}%
  \renewcommand*{\glsgroupskip}{}%
  \renewcommand{\glossentry}[2]{%
    \tabularnewline
    \multicolumn{2}{c}{%
     \bfseries\glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}}%
    }% 
    \tabularnewline
    \tabularnewline
  }%
  \renewcommand{\subglossentry}[3]{%
     \glssubentryitem{##2}%
     \glstarget{##2}{\glossentryname{##2}}
     &
     \glossentrydesc{##2}\glspostdescription\space
     ##3\tabularnewline
  }%
}

\newglossary[slg]{symbol}{sot}{stn}{Symbols}
\makenoidxglossaries

\newglossaryentry{alpha}{
  type=symbol,
  name={Alphanumeric},
  description={}}

\newglossaryentry{greek}{
  type=symbol,
  name={Greek letters},
  description={}}

\newglossaryentry{area}{
  type=symbol,
  name={\ensuremath{S}},
  description={reference area},
  sort={S},
  parent=alpha
}
\newglossaryentry{span}{
  type=symbol,
  name={\ensuremath{b}},
  sort={b},
  description={wing span},
  parent=alpha
}
\newglossaryentry{dynp}{
  type=symbol,
  name={\ensuremath{q_\infty}},
  description={dynamic pressure},
  sort={q},
  parent=alpha
}
\newglossaryentry{aoa}{
  type=symbol,
  name={\ensuremath{\alpha}},
  description={angle of attack},
  sort={a},
  parent=greek
}
\newacronym
[sort={a}]
{bcr}{BCR}{Block Compressed Row}
\newacronym
[sort={a}]
{cad}{CAD}{Computer-Aided Design}

\begin{document}
\onehalfspacing

\section*{List of Symbols and Acronyms}
\glsaddall

\printnoidxglossary[type=symbol,style=supergroup]
\printnoidxglossary[type=acronym]

\end{document}

this gives some errors. How can I get this to work?

EDIT:

I have found a partial solution:

\documentclass{article}
\usepackage{amssymb, amsfonts, mathrsfs, amsmath, mathabx}
\usepackage[nopostdot,nonumberlist,acronyms,section]{glossaries}
\newglossary[slg]{symbolslist}{sot}{stn}{Symbols}
\makenoidxglossaries
\newglossaryentry{alpha}{
  type=symbolslist,
  name={\hspace{4cm} Alphanumeric},
  description={},
  sort={A}
  }
\newglossaryentry{greek}{
  type=symbolslist,
  name={Greek letters},
  description={}
  }
\newglossaryentry{area}{
  type=symbolslist,
  name={\ensuremath{S}},
  description={reference area},
  sort={B}
  }
\begin{document}
\glsaddall
\printnoidxglossary[type=symbolslist, style=altlist]
\end{document}

Now the entries with empty description field are boldface and can be shifted (as with the entry alpha) to the right. Is there any possibility to center those entries without manually using \hspace{Xcm}for appropriate X?

Martin
  • 511

1 Answers1

1

Is this more like it?

enter image description here

\documentclass{report}

\usepackage{setspace}
\usepackage[nopostdot,nonumberlist,acronyms,section]{glossaries}

\newglossarystyle{supergroup}{%
  \setglossarystyle{altlist}%
  \renewcommand*{\glsgroupskip}{}%
  \renewcommand{\glossentry}[2]{%
    \item[]%
     \makebox[\linewidth][c]{\bfseries\glsentryitem{##1}\glstarget{##1}\glossentryname{##1}}
  }%
  \renewcommand{\subglossentry}[3]{%
    \item[\glssubentryitem{##2}%
      \glstarget{##2}{\glossentryname{##2}}]%
      \mbox{}\par\nobreak\glossentrydesc{##2}\glspostdescription\space ##3%
   }%
}

\newglossary[slg]{symbol}{sot}{stn}{Symbols}
\makenoidxglossaries

\newglossaryentry{alpha}{
  type=symbol,
  name={Alphanumeric},
  description={}}

\newglossaryentry{greek}{
  type=symbol,
  name={Greek letters},
  description={}}

\newglossaryentry{area}{
  type=symbol,
  name={\ensuremath{S}},
  description={reference area},
  sort={S},
  parent=alpha
}
\newglossaryentry{span}{
  type=symbol,
  name={\ensuremath{b}},
  sort={b},
  description={wing span},
  parent=alpha
}
\newglossaryentry{dynp}{
  type=symbol,
  name={\ensuremath{q_\infty}},
  description={dynamic pressure},
  sort={q},
  parent=alpha
}
\newglossaryentry{aoa}{
  type=symbol,
  name={\ensuremath{\alpha}},
  description={angle of attack},
  sort={a},
  parent=greek
}
\newacronym
[sort={a}]
{bcr}{BCR}{Block Compressed Row}
\newacronym
[sort={a}]
{cad}{CAD}{Computer-Aided Design}

\begin{document}
\onehalfspacing

\section*{List of Symbols and Acronyms}
\glsaddall

\printnoidxglossary[type=symbol,style=supergroup]
\printnoidxglossary[type=acronym]

\end{document}