% \iffalse meta-comment
%
% Copyright (C) 2006 Brian Elmegaard <be@mek.dtu.dk>
% -------------------------------------------------------
% 
% This file may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.2
% of this license or (at your option) any later version.
% The latest version of this license is in:
%
%    http://www.latex-project.org/lppl.txt
%
% and version 1.2 or later is part of all distributions of LaTeX 
% version 1999/12/01 or later.
%
% \fi
%
% \iffalse
%<*dtx>
\ProvidesFile{nomentbl.dtx}
%</dtx>
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{nomentbl}
%<driver>\ProvidesFile{nomentbl.drv} 
%<*driver|package>
[2006/04/14 v0.4 Nomenclature in a longtable environment]
%</driver|package>
%<*driver>
\documentclass{ltxdoc}
\usepackage{nomentbl}
\makenomenclature
\EnableCrossrefs         
\CodelineIndex
\RecordChanges
\begin{document}
  \DocInput{nomentbl.dtx}
\end{document}
%</driver>
% \fi
%
% \CheckSum{475}
%
% \CharacterTable
%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%   Digits        \0\1\2\3\4\5\6\7\8\9
%   Exclamation   \!     Double quote  \"     Hash (number) \#
%   Dollar        \$     Percent       \%     Ampersand     \&
%   Acute accent  \'     Left paren    \(     Right paren   \)
%   Asterisk      \*     Plus          \+     Comma         \,
%   Minus         \-     Point         \.     Solidus       \/
%   Colon         \:     Semicolon     \;     Less than     \<
%   Equals        \=     Greater than  \>     Question mark \?
%   Commercial at \@     Left bracket  \[     Backslash     \\
%   Right bracket \]     Circumflex    \^     Underscore    \_
%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%   Right brace   \}     Tilde         \~}
%
%
% \changes{v0.3}{2004/02/17}{Initial version more or less}
% \changes{v0.4}{2006/04/14}{Version updated for nomencl 4.2 with a
% few additions to functionality}
%
% \GetFileInfo{nomentbl.dtx}
%
% \newcommand{\MakeIndex}{\textsl{MakeIndex}}
% 
%
% \DoNotIndex{\newcommand,\newenvironment}
% 
%  
%
% \title{The \textsf{nomentbl} package\thanks{This document
%   corresponds to \textsf{nomentbl}~\fileversion, dated \filedate.}}
% \author{Brian Elmegaard \\ \texttt{be@mek.dtu.dk}\\Updated by Patrick Egan, March 2006.}
%
% \maketitle
%
% \section{Introduction}
%
% Often it is desirable to include the units of nomenclature in a
% tabular environment. \textsf{Nomentbl} is a customization of the
% \texttt{nomencl} package that presents the nomenclature in a table
% of the \textsf{longtable}-type.  
%
% With the most recent update\footnote{September 22, 2005.} to the
% \textsf{nomencl} package to version 4.2, the \textsf{nomentbl}
% package version 0.3 is not compatible with the \verb+\makenomenclature+
% and \verb+\printnomenclature+ commands. This document describes
% version 0.4 of the \textsf{nomentbl} package. It is compatible with the most
% recent \textsf{nomencl} version.
% 
% This document gives a very limited yet sufficient introduction to
% the use of \textsf{longtable} together with the \textsf{nomencl}
% package for writing nomenclatures.
%
% \section{Prerequisite}
%
% The \textsf{nomentbl} package requires both \textsf{nomencl} and
% \textsf{longtable} to be present on your system.
%
% \section{Usage}
%
% \begin{itemize}
%
% \item
% Install \texttt{nomentbl.sty} where latex can find it, and
% \texttt{nomentbl.ist} where \emph{MakeIndex} can find that.
%
% \item
% Put \verb+\usepackage[<options>]{nomentbl}+ in the preamble of the
% document. For further information on \verb+<options>+ see the
% \textsf{nomencl} user guide.
%
% \item
% Put \verb+\makenomenclature+ in the preamble of the document.
%
% \item
% Put \verb+\printnomenclature+ where the nomenclature section/chapter
% is desired.
%
% \item
% Issue the \verb+\nomenclature+ command for each symbol desired to be
% in the nomenclature list (see Section
% \ref{sect:nomenclature_command}).
%
% \item
% Run \LaTeX. This generates the nomenclature input file
% \verb+<filename>.nlo+.
%
% \item
% Run \emph{MakeIndex} with
% \begin{center}
% \verb+makeindex -s nomentbl.ist -o <filename>.nls <filename>.nlo+%
% \end{center}
%
% \item
% Run \LaTeX\ again.
%
% \end{itemize}
%
% \section{Examples}
% \label{sect:examples}%
%
% An equation is needed for the current setup:
% \begin{equation}
%   \label{eq:1}
%   \mathbf{J}_i\cdot\Delta\underline{x}_{i+1}=-\underline{f}_i
% \end{equation}
% 
% \iffalse
% Here follows the nomenclature entries.
% \fi
% \nomenclature[aJ]{$J$}{Jacobian Matrix}{}{}%
% \nomenclature[Zi]{$i$}{Variable number}{}{}%
% \nomenclature[ax]{$\Delta x$}{Variable displacement vector}{}{}%
% \nomenclature[af]{$f$}{Residual value vector}{}{}%
% \nomenclature[ax]{$x$}{Variable value vector}{}{}%
% The nomenclature is a result of the following:
% \begin{verbatim}
%  \nomenclature[AJ]{$J$}{Jacobian Matrix}{}{}%
%  \nomenclature[Zi]{$i$}{Variable number}{}{}%
%  \nomenclature[Ax]{$\Delta x$}{Variable displacement vector}{}{}%
%  \nomenclature[Af]{$f$}{Residual value vector}{}{}%
%  \nomenclature[Ax]{$x$}{Variable value vector}{}{}%
% \end{verbatim}
% Some symbols with units:
% \begin{equation}
%   \label{eq:3}
%   F = m \alpha
% \end{equation}
% \nomenclature[AF]{$F$}{Force}{N}{ML/T$^2$}%
% \nomenclature[Am]{$m$}{mass}{kg}{M}%
% \nomenclature[Ga]{$\alpha$}{acceleration}{m/s$^2$}{L/T$^2$}%
% \begin{verbatim}
%  \nomenclature[AF]{$F$}{Force}{N}{ML/T$^2$}%
%  \nomenclature[Am]{$m$}{mass}{kg}{M}%
%  \nomenclature[Ga]{$\alpha$}{acceleration}{m/s$^2$}{L/T$^2$}%
% \end{verbatim}
%
% The nomenclature is typeset in a |section*| by using the
% |\printnomenclature| command. In this example it gives the following
% result nomenclature.
% \printnomenclature
%
% \section{The \texttt{\textbackslash nomenclature} command}
% \label{sect:nomenclature_command}%
% \DescribeMacro{\nomenclature}
% To use the \texttt{\textbackslash nomenclature} command
%     \begin{center}
%     \verb+\nomenclature[<prefix>]{<symbol>}{<description>}{<units>}{<dimension>}+
%     \end{center}
% The \verb+<symbol>+ is the symbol entry to the nomenclature table.
% Do not forget to use the math environment (\verb+$ $+) if it is a
% mathematical symbol. The \verb+<description>+ is the description of
% the symbol. The \verb+<units>+ are the physical (SI) units of the
% symbol. The |<dimension>| may be used to give the dimension of the
% used symbol, but other uses may be found.
%
% The \verb+<prefix>+ is made of two characters, as outlined in
% Section \ref{sect:examples}. The second character acts as a sorting
% identifier, for example, a--z. The first character can be:
%
% \begin{itemize}
% \item
% `A' so that the symbol is classified as a Latin letter.
% \item
% `G' so that the symbol is classified as a Greek letter.
% \item
% `X' so that the symbol is classified as a superscript.
% \item
% `Z' so that the symbol is classified as a subscript.
% \end{itemize}
%
%

% \section{Acknowledgements}
% \label{sec:acknowledgements}

% \textsf{Nomentbl} is only a customized version of the \textsf{nomencl}
% by Boris Veytsman and Bernd Schandl. 
%
%
%
% The package files \texttt{nomentbl.ins} and \texttt{nomentbl.dtx} are
% based on \texttt{skeleton.ins} and \texttt{skeleton.dtx} in the
% \textsf{dtxtut} package by Scott Pakin.
%
% \changes{v0.3}{2004/02/17}{Initial version more or less}
% \changes{v0.4}{2006/04/14}{Updating to version 4.2 of nomencl}
% \changes{v0.4}{2006/04/14}{Adding intoc option (SP)}
% \changes{v0.4}{2006/04/14}{Improving the table by using a
% |definition| column}
% \changes{v0.4}{2006/04/14}{Improving the table by use of the
% \textsf{array} package}
% Additions and corrections to the package (especially for updating
% it to version 4.2 of nomencl) have been provided by: 
% Stefan Pinnow (SP), 
% Patrick Egan (PE), 
% Rasmus Solmer Eriksen (RSE),
% Andrea Kern,
% Christian Faulhammer (CF)
%
% \section{To do}
% \label{sec:do}
%
% Ideas for future development:
% \begingroup\obeylines
% Option for underlining group header lines
% Make the dimension column optional
% Possibility for user-defined symbol groups
% Translation of symbol group names
% \endgroup
%
%
%
% \StopEventually{
% \PrintChanges
% \PrintIndex
% }
%
%
%\section{Implementation}
%\label{sec:Implementation}
%    \begin{macrocode}
%<*package>
% Additions and corrections to the package (especially for updating
% it to version 4.2 of nomencl) have been provided by: 
% Stefan Pinnow (SP) 
% Patrick Egan (PE) 
% Rasmus Solmer Eriksen (RSE)
% Andrea Kern
% Christian Faulhammer (CF)
%
\def\docdate{2006/04/14}
%SP
%    \end{macrocode}
% \begin{macro}{\intoc}
% Option to specify if the nomenclature should be shown in the table
% of contents.
%    \begin{macrocode}
\newif\if@intoc
%    \end{macrocode}
% \end{macro}
%    \begin{macrocode}
\RequirePackage{longtable}
%SP
\RequirePackageWithOptions{nomencl}[2005/09/22 v4.2 Nomenclature package (LN)]
\RequirePackage{ifthen}
\RequirePackage{calc}
%SP
\RequirePackage{array}
%SP
\DeclareOption{intoc}{\@intoctrue}
\DeclareOption{notintoc}{\@intocfalse}
%
\DeclareOption*{%
\PassOptionsToPackage{\CurrentOption}{nomencl}%
}
%
 \DeclareOption{croatian}{%
   \def\eqdeclaration#1{jednad\v{z}bu\nobreakspace(#1)}%
   \def\pagedeclaration#1{\hspace*{2mm}stranica\nobreakspace#1}%
%SP
   \def\nomname{Popis simbola}%
   \def\nomAname{Latin Letters}%
   \def\nomGname{Greek Letters}%
   \def\nomXname{Superscripts}%
   \def\nomZname{Subscripts}}
 \DeclareOption{danish}{%
   \def\eqdeclaration#1{ligning\nobreakspace(#1)}%
   \def\pagedeclaration#1{\hspace*{2mm}side\nobreakspace#1}%
%SP
   \def\nomname{Symbolliste}%
   \def\nomAname{Romerske bogstaver}%
   \def\nomGname{Gr�ske bogstaver}%
   \def\nomXname{(H�jtstillede) indices}%
   \def\nomZname{Indices}}
 \DeclareOption{english}{%
   \def\eqdeclaration#1{equation\nobreakspace(#1)}%
   \def\pagedeclaration#1{\hspace*{2mm}page\nobreakspace#1}%
%SP
   \def\nomname{Nomenclature}%
   \def\nomAname{Latin Letters}%
   \def\nomGname{Greek Letters}%
   \def\nomXname{Superscripts}%
   \def\nomZname{Subscripts}}
 \DeclareOption{french}{%
   \def\eqdeclaration#1{\'equation\nobreakspace(#1)}%
   \def\pagedeclaration#1{\hspace*{2mm}page\nobreakspace#1}%
%SP
   \def\nomname{Liste des symboles}%
   \def\nomAname{Latin Letters}%
   \def\nomGname{Greek Letters}%
   \def\nomXname{Superscripts}%
   \def\nomZname{Subscripts}}
\DeclareOption{german}{%
   \def\eqdeclaration#1{Gleichung\nobreakspace(#1)}%
   \def\pagedeclaration#1{\hspace*{2mm}Seite\nobreakspace#1}%
%SP
%CF
   \def\nomname{Symbolverzeichnis}%
   \def\nomAname{Lateinische Buchstaben}%
   \def\nomGname{Griechische Buchstaben}%
   \def\nomXname{(hochgestellte) Indizes}%
   \def\nomZname{Indizes}}
 \DeclareOption{italian}{%
   \def\eqdeclaration#1{equazione\nobreakspace(#1)}%
   \def\pagedeclaration#1{\hspace*{2mm}pagina\nobreakspace#1}%
%SP
   \def\nomname{Elenco dei Simboli}%
   \def\nomAname{Latin Letters}%
   \def\nomGname{Greek Letters}%
   \def\nomXname{Superscripts}%
   \def\nomZname{Subscripts}}
 \DeclareOption{polish}{%
   \def\eqdeclaration#1{rownanie\nobreakspace(#1)}%
   \def\pagedeclaration#1{\hspace*{2mm}strona\nobreakspace#1}%
%SP
   \def\nomname{Lista symboli}%
   \def\nomAname{Latin Letters}%
   \def\nomGname{Greek Letters}%
   \def\nomXname{Superscripts}%
   \def\nomZname{Subscripts}}
 \DeclareOption{portuguese}{%
   \def\eqdeclaration#1{equa\c{c}\~ao\nobreakspace(#1)}%
   \def\pagedeclaration#1{\hspace*{2mm}p\'agina\nobreakspace#1}%
%SP
   \def\nomname{Nomenclatura}%
   \def\nomAname{Latin Letters}%
   \def\nomGname{Greek Letters}%
   \def\nomXname{Superscripts}%
   \def\nomZname{Subscripts}}
 \DeclareOption{russian}{%
   \def\eqdeclaration#1{\cyrs\cyrm.\nobreakspace(#1)}%
   \def\pagedeclaration#1{\hspace*{2mm}\cyrs\cyrt\cyrr.\nobreakspace#1}%
   \def\nomname{\CYRS\cyrp\cyri\cyrs\cyro\cyrk%
     \ \cyro\cyrb\cyro\cyrz\cyrn\cyra\cyrch\cyre\cyrn\cyri%
     \cyrishrt}%
%SP
   \def\nomAname{Latin Letters}%
   \def\nomGname{Greek Letters}%
   \def\nomXname{Superscripts}%
   \def\nomZname{Subscripts}}
\DeclareOption{spanish}{%
   \def\eqdeclaration#1{ecuaci\'on\nobreakspace(#1)}%
   \def\pagedeclaration#1{\hspace*{2mm}p\'agina\nobreakspace#1}%
%SP
   \def\nomname{Nomenclatura}%
   \def\nomAname{Latin Letters}%
   \def\nomGname{Greek Letters}%
   \def\nomXname{Superscripts}%
   \def\nomZname{Subscripts}}
 \DeclareOption{ukrainian}{%
   \def\eqdeclaration#1{\cyrd\cyri\cyrv.\nobreakspace(#1)}%
   \def\pagedeclaration#1{\hspace*{2mm}\cyrs\cyrt\cyro\cyrr.\nobreakspace#1}%
   \def\nomname{\CYRP\cyre\cyrr\cyre\cyrl\cyrii\cyrk%
          \ \cyrp\cyro\cyrz\cyrn\cyra\cyrch\cyre\cyrn\cyrsftsn}%
%SP
   \def\nomAname{Latin Letters}%
   \def\nomGname{Greek Letters}%
   \def\nomXname{Superscripts}%
   \def\nomZname{Subscripts}}
\ExecuteOptions{notintoc,norefeq,norefpage,prefix,cfg,english}
\ProcessOptions\relax
%
%SP
%    \end{macrocode}
% \begin{macro}{\nomenclature}
% This is the actual command provided by the package.
%    \begin{macrocode}
\def\@@nomenclature[#1]#2#3#4#5{\endgroup\@esphack}
\def\@@@nomenclature[#1]#2#3#4#5{%
 \def\@tempa{#2}\def\@tempb{#3}%
%    \end{macrocode}
% \end{macro}
%    \begin{macrocode}
%SP
%PE
 \protected@write\@nomenclaturefile{}%
  {\string\nomenclatureentry{#1\nom@verb\@tempa @{\nom@verb\@tempa}&%
      \begingroup\nom@verb\@tempb\endgroup &\begingroup#4\endgroup&%
      \begingroup#5\endgroup&\begingroup\protect\nomeqref{\theequation}%
        |nompageref}{\thepage}}%
 \endgroup
 \@esphack}
%
%SP
%PE
%RSE


\def\thenomenclature{%
  \@ifundefined{chapter}%
  {
    \section*{\nomname}
    \if@intoc\addcontentsline{toc}{section}{\nomname}\fi%
  }%
  {
    \chapter*{\nomname}
    \if@intoc\addcontentsline{toc}{chapter}{\nomname}\fi%
  }%
%  \@ifundefined{chapter}{\section*}{\chapter*}{\nomname}%
  \markboth{\nomname}{\nomname}
  \nompreamble
}

\def\endthenomenclature{%
  \endlist
  \nompostamble}

\renewcommand\nomgroup[1]{%
%SP
    \ifthenelse{\equal{#1}{A}}{%
      \large{\nomAname}}{%
      \ifthenelse{\equal{#1}{G}}{%
        \large{\nomGname}}{%
        \ifthenelse{\equal{#1}{X}}{%
          \large{\nomXname}}{%
          \ifthenelse{\equal{#1}{Z}}{%
            \large{\nomZname}}{%
            {}}}}}}
%    \end{macrocode}

%    \begin{macrocode}
%</package>
%    \end{macrocode}
% \subsection{The \MakeIndex\ Style File}
% \label{sec:ist}
%
%    \begin{macrocode}
%<*idxstyle>
%    Nomenclature style file for makeindex. Based on the file
%SP
%    nomencl.ist distributed with the LaTeX package nomencl version v4.2 2005/09/22
%
%
%    Written by Brian Elmegaard be@mek.dtu.dk
%    (Original file by Boris Veytsman)
%SP
%    Updated by Stefan Pinnow 27 March 2006.
%PE
%    Updated by Patrick Egan 02 March 2006.

%
%    The output has been changed to a (LaTeX-style) longtable to have four
%    columns.
%
actual '@'
quote '%'
delim_0   ""
delim_1   ""
delim_2   ""
item_0    ""
delim_t   " \\\\\n"
line_max  1000
heading_prefix   "\\multicolumn{3}{l}{\\nomgroup{"
heading_suffix   "}} \\\\\n\\nopagebreak\\\\*[\\parskip]\n\\nopagebreak{}"
headings_flag       1
group_skip        "\\\\*[\\parskip]"
%SP
%PE
preamble "\n\\begin{thenomenclature}\n%
\\begin{longtable}[l]%
{cp{\\textwidth*\\real{0.5}}c!{\\extracolsep{\\fill}}lll}\n"
postamble "\n\\end{longtable}\n\n\\end{thenomenclature}\n"
%SP
%PE
keyword "\\nomenclatureentry"
%
%    \end{macrocode}

%    \begin{macrocode}
%</idxstyle>
%    \end{macrocode}
%%
%
%%
%    \begin{macrocode}
%<*example>
% Example provided by Stefan Pinnow (SP) 
\documentclass{article}
\usepackage[notintoc]{nomentbl}
\usepackage{setspace}
    \makenomenclature
%
\begin{document}
%
\section*{Main equations}
%
Here an equation
    \begin{equation}\label{eq:heatflux}
        \dot{Q} = k \cdot A \cdot \Delta T
    \end{equation}%
    \nomenclature[aQ]{$\dot{Q}$}{heat flux}{W}{}%
    \nomenclature[ak]{$k$}{overall heat transfer coefficient}{$\frac{\mathrm{W}}{\mathrm{m}^2\mathrm{K}}$}{see eq.~(\ref{eq:ohtc})}%
    \nomenclature[aA]{$A$}{area}{m$^2$}{$L^2$}%
    \nomenclature[aL]{$L$}{length}{m}{SI base quantity}%
    \nomenclature[aT]{$T$}{temperature}{K}{SI base quantity}%
    \nomenclature[aT]{$\Delta T$}{temperature difference}{K}{SI base quantity}%
%
or another one
    \begin{equation}\label{eq:ohtc}
        \frac{1}{k} = \left[\frac{1}{\alpha _{\mathrm{i}}\,r_{\mathrm{i}}} +
        \sum^n_{j=1}\frac{1}{\lambda _j}\,
        \ln \frac{r_{\mathrm{a},j}}{r_{\mathrm{i},j}} +
        \frac{1}{\alpha _{\mathrm{a}}\,
          r_{\mathrm{a}}}\right] \cdot r_{\mathrm{reference}}
    \end{equation}%
    \nomenclature[ga]{$\alpha$}{convection heat transfer coefficient}{$\frac{\mathrm{W}}{\mathrm{m}^2\mathrm{K}}$}{}%
    \nomenclature[zi]{i}{in}{}{}%
    \nomenclature[gl]{$\lambda$}{thermal conductivity}{$\frac{\mathrm{W}}{\mathrm{m K}}$}{}%
    \nomenclature[za]{a}{out}{}{}%
    \nomenclature[zn]{$n$}{number of walls}{}{}%
    \nomenclature[zj]{$j$}{running parameter}{}{}%
%
That should do it.
%
\onehalfspacing
\printnomenclature
%
\end{document}
%    \end{macrocode}
%    \begin{macrocode}
%</example>
%    \end{macrocode}


% \Finale


\endinput