0

If I put \censor inside \newglossaryentry, I get this error:

ERROR: Illegal parameter number in definition of \glo@liberty@sortvalue.

--- TeX said ---

What is causing the error, and what would remedy it?

\documentclass{report}
\usepackage[section=section]{glossaries}
\usepackage{censor}
\glsdisablehyper
\makenoidxglossaries
\setglossarystyle{tree}
\newglossary*{secret}{Secret}

\newglossaryentry{liberty}
{
  type=secret,
  name={Liberty},
%  name={\censor{Liberty}},
  description={missile}
}

\begin{document}

%\gls{liberty}
\censor{\gls{liberty}}

\printnoidxglossary[type=secret]

\end{document}

1 Answer 1

0

Here's a workaround, need to compile twice.

\documentclass{report}
\usepackage[section=section]{glossaries}
\usepackage{censor}
\glsdisablehyper
\makenoidxglossaries
\setglossarystyle{tree}
\newglossary*{secret}{Secret}
\usepackage{xparse}

\newglossaryentry{liberty}
{
  type=secret,
%  name={Liberty},
  name={\censor{Liberty}},
  text={Liberty},
  sort={Liberty},
  description={missile \censor{XYZ}}
}

\begin{document}

\tableofcontents

%\StopCensoring
\censor{\gls{liberty}}\glsadd{liberty}

\printnoidxglossary[type=secret]

\end{document}

enter image description here enter image description here

You must log in to answer this question.

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