2

I'm using Nomencl package and is working fine. What I do not know how to do is to have the description part starting from the right margin of the page and the symbol part starting from the left margin. This is what I've got so far:

\documentclass[twoside]{ecsthesis}      % Use the Thesis Style
\graphicspath{{../Figures/}}   % Location of your graphics files
\usepackage[sort &compress]{natbib}  % Use Natbib style for the refs.\part{title}
\usepackage[noprefix]{nomencl}
\usepackage{chemmacros}
\usepackage{mhchem}
\usepackage{wasysym}
\usepackage{hyperref}
\usepackage{cleveref}

 \usepackage{upgreek}
 \usepackage{epigraph}
 \usepackage{tipa}
 \usepackage{array}

   \setlength\epigraphwidth{8cm}
      \setlength\epigraphrule{0pt}
     \renewcommand{\nomname}{List of Symbols}
    \setlength{\nomlabelwidth}{1\hsize}  
 \renewcommand{\nomlabel}[1]{#1 \dotfill}
 \setlength{\nomitemsep}{-\parsep}   
 \makenomenclature
 \begin{document}

 Hello world
 \tableofcontents
\printnomenclature
\chapter{Hello}
Hello
\chapter{World}
 World
    \nomenclature{OECD}{Organisation for Economic Co-operation and Development}
\nomenclature{EIA}{Energy Information Administration}
\nomenclature{GHGs}{Green House Gases}
\nomenclature{BRE}{Building Research Establishment}
\nomenclature{HVAC}{Heating Ventilation Air Conditioning}
\nomenclature[Q]{$ \dot{Q} $}{Heat Transfer Rate}
\nomenclature[k]{$ k $}{Thermal Conductivity }
\nomenclature[A]{$ A $}{Area of Heat Exchange}


  \end{document}

I would like to have something more similar to the TOC(with dot in the middle). Thanks, M.

  • 2
    And what if a description is long enough to span two or more lines? How should such entry be formatted? – Gonzalo Medina Sep 17 '13 at 13:43
  • Luckily none of them should be that long. In that case ,anyway, would be better to put a maximum length for the description after which it start from a new line, always aligned from the right. But honestly I do not know if it possible :) – Michele Carboni Sep 17 '13 at 14:27
1

As long as your descriptions are not too long this will do the job:

  1. Make a copy of the file nomencl.ist; call it mynomencl.ist and save it in your current working directory. At the end of mynomencl.ist add the line

    item_0 ""
    

    save the changes.

  2. In your document:

    \documentclass[twoside]{book}
    \usepackage[noprefix]{nomencl}
    \usepackage{longtable}
    \usepackage{hyperref}
    \usepackage{cleveref}
    
    \makeatletter
    \def\@@@nomenclature[#1]#2#3{%
    \def\@tempa{#2}\def\@tempb{#3}%
    \protected@write\@nomenclaturefile{}%
    {\string\nomenclatureentry{#1\nom@verb\@tempa @{\nom@verb\@tempa}\protect\dotfill%
    \begingroup\nom@verb\@tempb\protect\nomeqref{\theequation}%
    |nompageref}{\thepage}}%
    \endgroup
    \@esphack}
    \def\thenomenclature{%
    \setlength\parindent{0pt}%
    \@ifundefined{chapter}{\section*}{\chapter*}{\nomname}%
    \nompreamble
    }
    \def\endthenomenclature{\nompostamble}
    \renewcommand\nomentryend{\par}
    \makeatother
    
    \renewcommand{\nomname}{List of Symbols}
    
    \makenomenclature
    
    \begin{document}
    
     Hello world
    \printnomenclature
    \chapter{Hello}
    Hello
    \chapter{World}
     World
    \nomenclature{OECD}{Organisation for Economic Co-operation and Development}
    \nomenclature{EIA}{Energy Information Administration}
    \nomenclature{GHGs}{Green House Gases}
    \nomenclature{BRE}{Building Research Establishment}
    \nomenclature{HVAC}{Heating Ventilation Air Conditioning}
    \nomenclature[Q]{$ \dot{Q} $}{Heat Transfer Rate}
    \nomenclature[k]{$ k $}{Thermal Conductivity}
    \nomenclature[A]{$ A $}{Area of Heat Exchange}
    
    \end{document}
    
  3. Process the document using

    pdflatex name
    makeindex name.nlo -s mynomencl.ist -o name.nls
    pdflatex name
    pdflatex name
    

Here's the resulting list with your example code:

enter image description here

  • looks great but I do not know where to find the .ist file. I download the package using Miktex. (I'm a noob, i know :(_ – Michele Carboni Sep 17 '13 at 14:32
  • FOund! I'll give it a go! – Michele Carboni Sep 17 '13 at 14:35
  • @user36829 I don't use Windows, but the file is in your system. You can run in a terminal kpsewhich nomencl.ist to find the location of the file. Let me know if you can't find it. – Gonzalo Medina Sep 17 '13 at 14:35
  • Hi Gonzalo, I tried to run the code as you wrote, an is working. But if I try with a bigger code (my thesis) where the \nomenclature are included in each chapter I have more than one symbols+definition each line. It is the same even if I put the \nomenclature in the same position as the example... I don't know how to add the code in the comment otherwise I'd post it. – Michele Carboni Sep 17 '13 at 15:00
  • 1
    What do you mean as typographical horror? honestly I haven't ask for a style advice, but for a coding advice... – Michele Carboni Sep 18 '13 at 7:44

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.