4

I've got a problem to switch back to the standard glossary style with the starred chapter after using an inline glossary. Here my MWE:

\documentclass{scrbook}

\usepackage[nonumberlist=true]{glossaries}
\usepackage{glossary-inline}
\makenoidxglossaries

\newacronym{LED}{LED}{light emitting diode}
\newglossary*{Footnote}{}
\newacronym[type=Footnote]{FET}{FET}{field effect transistor}
\newacronym[type=Footnote]{OFET}{OFET}{organic field effect transistor}

\setacronymstyle{long-short}
\glsaddall %print all acronyms, whether used in text or not
\renewcommand*{\glossarysection}[2][]{\textbf{#1}: } %as suggested in manual, page 198

\begin{document}
\gls{LED}, \gls{FET}, \gls{OFET}\\
This is a text with a footnote\footnote{\printnoidxglossary[type=Footnote,style=inline,title={Abbreviations used}]}

%\renewcommand*{\glossarysection}{\chapter}
%\renewcommand*{\glossarysection}{\chapter*}
\printnoidxglossary[nopostdot, type=main, style=long]
\end{document}

What I want is that the main glossary is in an unnumbered chapter, after using the Footnote glossary in the footnote.

I've tried \renewcommand*{\glossarysection}{\chapter}, which gives the chapter, but with the number. \renewcommand*{\glossarysection}{\chapter*} is compilable, but gives very strange output.

Trying to define an own inline style and changing glossarysection in there gives an error (Illegal parameter number in definition of \@glsstyle@myinline):

\newglossarystyle{myinline}{%
    \glossarystyle{inline}% 
    \renewcommand*{\glossarysection}[2][]{\textbf{#1}: }%
}
1

You need to double the # parameter character when redefining commands inside \newglossarystyle. Like this:

\newglossarystyle{myinline}{%
  \glossarystyle{inline}% 
  \renewcommand*{\glossarysection}[2][]{\textbf{##1}: }%
}

or using the newer \setglossarystyle:

\newglossarystyle{myinline}{%
  \setglossarystyle{inline}% 
  \renewcommand*{\glossarysection}[2][]{\textbf{##1}: }%
}

(If you get an undefined control sequence error for \setglossarystyle, then your version of glossaries is very old and could do with being updated.) Note that the first parameter of \glossarysection is the title used in the table of contents. That happens to be the same as the actual title for your document, but syntactically I think it would be better to do:

\newglossarystyle{myinline}{%
  \setglossarystyle{inline}% 
  \renewcommand*{\glossarysection}[2][]{\textbf{##2}: }%
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.