[Tex/LaTex] Longtable nomenclature firsthead problem

longtablenomenclature

After my question here:
Format nomencl in table style

Everything ran smooth, however, the list expanded and I was in the need to take advantage of the longtable properties: i.e. repeating the header and footer.

The nomentbl script for makeindex was slighty modified as follows:

actual '@'
quote '%'
delim_0   ""
delim_1   ""
delim_2   ""
item_0    ""
delim_t   " \\\\\n"
line_max  1000
headings_flag       1
group_skip        "[1.1\\parskip]"
preamble "\n\\begin{thenomenclature}\n
\\begin{longtable}[l]{p{\\textwidth*\\real{0.10}}p{\\textwidth*\\real{0.65}}c!    {\\extracolsep{0pt}}lll}
\\toprule \\\\
\\multicolumn{1}{l}{Symbol}&\\multicolumn{1}{l}{Quantity}& \\multicolumn{1}{l}{Unit}     \\\\%% <------ header here
\\midrule \\\\ "
 postamble "\\bottomrule\\\\\n\\end{longtable}\n\\end{thenomenclature}\n" 
 keyword "\\nomenclatureentry"

%%
%%


\endinput

The basic nomenclature declaration looks as follows:

 \makenomenclature
 \nomenclature[a ]{$A$}{Area}{m2}{}

Which ran smoothly up until I changed everything to get the header and footer repeated.

The error I get is as follows:

! Missing } inserted
<inserted text>
}
1.18 \bottomrule

I double checked all the accolades, but I could not isolate the problem. I reduced my abbreviations to just one in order to found the error, but without luck.

Any suggestion to improve/fix this?

NLS file output:

 \begin{thenomenclature}
 %
 \begin{longtable}[l]%
 {p{\textwidth*\real{0.15}}p{\textwidth*\real{0.65}}c!{\extracolsep{0pt}}lll}
 \toprule \\ 

 \multicolumn{1}{l}{Symbol}&\multicolumn{1}{l}{Quantity}& \multicolumn{1}{l}{Unit} \\%% <------ header here
 \midrule \\
 \endhead 
 {$A$}&\begingroup Area\endgroup &\begingroup m2\endgroup &\begingroup \endgroup      &\begingroup \nomeqref {0}\nompageref{i}, \nompageref{ix} \\
 \bottomrule\endfoot
 \end{longtable}
 \end{thenomenclature}

Changes made

  • added \endinput to the end of the above nomtbl script
  • added nls file
  • Extra observation: commenting out \printnomenclature lets the LaTeX compile; the problem is isolated to nomenclature issues (this topic)

Best Answer

Finally, after a night of coding, I found out the problem. Hereby I want to contribute with my adapted nomenbtl.ist file, using longtable and suitable for multiple pages:

 %%
 %% This is file `nomentbl.ist',
 %% generated with the docstrip utility.
 %%
 %% The original source files were:
 %%
 %% nomentbl.dtx  (with options: `idxstyle')
 %% 
 %% Copyright (C) 2006 by Brian Elmegaard <be@mek.dtu.dk>
 %% 
 %% This file can be redistributed and/or modified under the terms
 %% of the LaTeX Project Public License distributed from CTAN
 %% archives in the directory macros/latex/base/lppl.txt; either
 %% version 1.2 of the license, or (at your option) any later version.
 %% 
 %% Nomenclature style file for MAKEINDEX.
 %% For nomentbl v0.4
 %% 
 %% Written by Brian Elmegaard
 %% 

 %% RdN March 2012: adapted this script to facilitate two page and long
 %% table usage. In addition, some changes are made:
 %% - headings_flag set to zero
 %% - group_skip changed
 %% - heading removed

 actual '@'
 quote '%'
 delim_0   ""
 delim_1   ""
 delim_2   ""
 item_0    ""
 delim_t   " \\\\\n"
 line_max  1000
 headings_flag       0
 group_skip        "[1.1\\parskip]"
 preamble "\n\\begin{thenomenclature}\n
 \\begin{longtable}[l]{p{\\textwidth*\\real{0.10}}p{\\textwidth*\\real{0.65}}c!     {\\extracolsep{0pt}}lll}
 \\toprule 
 \\multicolumn{1}{l}{Symbol}&\\multicolumn{1}{l}{Quantity}& \\multicolumn{1}{l}{Unit}          \\\\%% <------ header here
 \\midrule  \\endhead \\bottomrule\\endfoot\\\\"
  postamble "\n\\end{longtable}\n\\end{thenomenclature}\n" 
  keyword "\\nomenclatureentry"

 %%
 %%
 %%
 %% End of file `nomentbl.ist'.

Hope it helps others...