1

I'm struggling to write |.| in nomenclature in LaTeX. It works for the first item in the nomenclature, but not working for the second item in the following:

\documentclass[10pt,journal]{IEEEtran}
\usepackage{nomencl}
\usepackage{ifthen}
\renewcommand{\nomgroup}[1]{%
    \ifthenelse{\equal{#1}{C}}{\item[\textbf{Constants}]}{%
        \ifthenelse{\equal{#1}{V}}{\item[\textbf{Variables}]}{%
            \ifthenelse{\equal{#1}{K}}{\item[\textbf{Symbols}]}{%
            \ifthenelse{\equal{#1}{S}}{\item[\textbf{sets}]}{}}}}
}
\makenomenclature

\begin{document}
\nomenclature[Km]{$\leftarrow\cdot\rightarrow$}{Number of element in a set.} %
\nomenclature[Km]{$\left|\cdot \right|$}{Number of element in a set.} %
Say something.
\printnomenclature

\end{document}

Can any one help me with it, why it is not showing up?

Fred
  • 67

1 Answers1

2

Been searching a bit and found the following solution:

\documentclass[10pt,journal]{IEEEtran}
\usepackage{nomencl}
\usepackage{amsmath} % <=== don't forget
\usepackage{ifthen}
\renewcommand{\nomgroup}[1]{%
    \ifthenelse{\equal{#1}{C}}{\item[\textbf{Constants}]}{%
        \ifthenelse{\equal{#1}{V}}{\item[\textbf{Variables}]}{%
            \ifthenelse{\equal{#1}{K}}{\item[\textbf{Symbols}]}{%
            \ifthenelse{\equal{#1}{S}}{\item[\textbf{sets}]}{}}}}
}
\makenomenclature

\begin{document}
\nomenclature[Km]{$\leftarrow\cdot\rightarrow$}{Number of element in a set.} %
\nomenclature[Km]{$ \left\lvert \cdot \right\rvert $}{Number of element in a set.} %
%% based on the comment from @NicolaTalbot and the answer from @egreg in https://tex.stackexchange.com/questions/324639/adding-exists-to-the-nomenclature
\nomenclature[Km]{$ \left"| \cdot \right"| $}{Number of element in a set.} %
Say something.
\printnomenclature

\end{document}
albert
  • 1,313