4

I try to make sections in Nomenclature and sort them as I desire in my paper like the one I added in the picture. I have not had any success. I am close to get mad! I searched a lot but I couldn't find any appropriate answer! Any help?

enter image description here

2 Answers2

6

Here is an attempt with nomencl package.

\documentclass{article}
\usepackage{nomencl}
\usepackage{ifthen}
\renewcommand{\nomgroup}[1]{%
\ifthenelse{\equal{#1}{C}}{\item[\textbf{Constants}]}{%
\ifthenelse{\equal{#1}{V}}{\item[\textbf{Variables}]}{%
\ifthenelse{\equal{#1}{S}}{\item[\textbf{sets}]}{}}}
}
\makenomenclature
\begin{document}
  \nomenclature[Cp]{$p_{Di}$}{Active power demand at bus $i$}
  \nomenclature[Vp]{$p_{Gi}$}{Active power generation at bus $i$}
  \nomenclature[SO]{$\Omega_{G}$}{Set of generator buses}
  Some text
  \printnomenclature
\end{document}

enter image description here

Here C in Cp (\nomenclature[Cp]{$p_{Di}$}{Active power demand at bus $i$}) puts the entry in Constants where Vp would put it in Variables.

You have to compile with

pdflatex yourfilename
makeindex.exe -s nomencl.ist -t "yourfilename.nlg" -o "yourfilename.nls" "yourfilename.nlo"
pdflatex yourfilename

to get things done.

5

Here's an attempt with the glossaries package:

\documentclass{article}

\usepackage[acronym,nonumberlist]{glossaries}

\renewcommand{\acronymname}{Nomenclature}

\newglossarystyle{mystyle}{%
  \setglossarystyle{long}%
  \renewenvironment{theglossary}%
     {\begin{longtable}[l]{@{}p{0.1\hsize}p{0.8\hsize}}}%
     {\end{longtable}}%
  \renewcommand*{\glsgroupheading}[1]{%
     \multicolumn{2}{@{}l}{\bfseries\glsgetgrouptitle{##1}}\\[5pt]}%
}

\newcommand*{\Agroupname}{Constants}
\newcommand*{\Bgroupname}{Variables}
\newcommand*{\Cgroupname}{Sets}

\newacronym[sort=a1]{APD}{$p_{D_{i}}$}{Active power demand at bus $i$}
\newacronym[sort=b1]{APG}{$p_{G_{i}}$}{Active power generation at bus $i$}
\newacronym[sort=b2]{RPG}{$q_{G_{i}}$}{Reactive power generation at bus $i$}
\newacronym[sort=c1]{SGB}{$\Omega_{G}$}{Set of generator buses}

\makeglossaries

\begin{document}

\glsaddall

\printglossary[style=mystyle,type=\acronymtype]

\end{document} 

Output

enter image description here


How it works.

First of all, I've defined a new glossary style mystyle to simulate the output of nomencl

\newglossarystyle{mystyle}{%
  \setglossarystyle{long}%
  \renewenvironment{theglossary}%
     {\begin{longtable}[l]{@{}p{0.1\hsize}p{0.8\hsize}}}%
     {\end{longtable}}%
  \renewcommand*{\glsgroupheading}[1]{%
     \multicolumn{2}{@{}l}{\bfseries\glsgetgrouptitle{##1}}\\[5pt]}%
}

Then I defined three groups (a, b and c) which correspond to your "sections"

\newcommand*{\Agroupname}{Constants}
\newcommand*{\Bgroupname}{Variables}
\newcommand*{\Cgroupname}{Sets}

When you want to define an entry, use something like

\newacronym[sort=b1]{APG}{$p_{G_{i}}$}{Active power generation at bus $i$}

where sort=b1 means: insert the entry in the group b ("Variables") and put it in the list as the first element.

karlkoeller
  • 124,410