0

There are a lot of similar posts to this but I have yet to find one that correctly solves my issue. The tl;dr is: How do I make nomenclature produce only a list of variables without producing a new chapter?

Long version:

I want to use the nomencl package to create a sorted list of variables in the first appendix chapter of my thesis. I am writing in Overleaf.

The appendix package works fine on its own. In my main .tex file, I have

\include{introduction}
...
\include{conclusion}
\appendix
\include{appa}
\include{appb}
\include{biblio}
\end{document}

My appendix files appa and appb both start with a chapter title. For example, appb begins with \chapter{Figures} which displays on the page as

AppendixB on the Page

and in the table of contents as

AppendixA in ToC

The nomenclature package on its own works just fine. I define all of my variables and a new chapter containing a list appears where I place \printnomenclature. I only want the list though. It should appear on the page as

Appendix A

Nomenclature

(list of nomenclature)

Because \printnomenclature starts a new chapter, if I write

\chapter{Nomenclature}
\printnomenclature

in appa I end up with

nomenclature wrong

with Chapter A: Nomenclature on page 55 and the list actually on page 57. It only appears in the ToC because I included [intoc] for the sake of illustration. I want everything to be on page 55 with the page itself appearing like Appendix B did in the first figure. How do I do this?

I tried various solutions from other posts to remove the chapter title on Page 57, but I couldn't find a way to prevent that chapter from being produced itself. As a result, I end up with skipped pages between the chapter title on page 55 and the list on page 57.

1
  • Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – Alessandro Cuttin Apr 21 '20 at 20:21
1

Warning: this answer may not apply to your actual needs.

IF you want to completely ignore all \chapter* commands in your appendices, and do the sectioning yourself, then you can declare

\makeatletter
\g@addto@macro\appendix{\renewcommand\@schapter[1]{}}
\makeatother

in your document preamble.

IF you want to treat those \chapter* declarations as numbered (lettered) chapters (appendices), then the incantation is

\makeatletter
\g@addto@macro\appendix{\renewcommand\@schapter{\chapter}}
\makeatother

(The "*" is consumed before \@schapter goes to work.)

Note that these make assumptions on how the document class defines \chapter, so can't be relied on everywhere.

1
  • Welcome Back....happy to see you.... – MadyYuvi Apr 22 '20 at 5:03
1

The nomencl makes use of \chapter*{} (if available in the class) to create the list of symbols and so a new page is created.

First, load the nomencl package with the option notocbasic (but not intoc otherwise the entry will be duplicated in table of contents), that is,

\usepackage[notocbasic]{nomencl}

From nomencl.sty we find:

\makeatletter % added
\def\thenomenclature{%
  \providecommand*{\listofnlsname}{\nomname}%
  \if@nomencl@tocbasic
    \let\list@fname\listofnlsname
    \def\@currext{nls}%
    \tocbasic@listhead{\list@fname}%
   \else
    \@ifundefined{chapter}%
    {
      \section{\nomname}
      \if@intoc\addcontentsline{toc}{section}{\nomname}\fi%
    }%
    {
      \chapter{\nomname} %%% <----------- deleted * here
      \@mkboth{\nomname}{\nomname}%
      \if@intoc\addcontentsline{toc}{chapter}{\nomname}\fi%
    }%
  \fi
  \nompreamble
  \if@nomentbl
    \let\itemOrig=\item
    \def\item{\gdef\item{\\}}%
    \expandafter\longtable\expandafter{\@nomtableformat}
  \else
    \list{}{%
      \labelwidth\nom@tempdim
      \leftmargin\labelwidth
      \advance\leftmargin\labelsep
      \itemsep\nomitemsep
      \let\makelabel\nomlabel}%
  \fi
}

\makeatother % added

and then simply put the code above on your preamble. In the document, you simply use \appendix and \printnomenclature.

enter image description here

4
  • Thanks for the help. That didn't solve the problem, unfortunately. I added the code to the preamble followed by \usepackage[notocbasic]{nomencl} \makenomenclature and still have Appendix A: Nomenclature on page 55 and Nomenclature followed by the list on Page 57. What other info can I provide to help? – Daniel M Apr 22 '20 at 2:23
  • The code has to go after loading nomencl.sty, because it replaces part of the nomencl definitions. – Donald Arseneau Apr 22 '20 at 2:58
  • @DonaldArseneau, yes, right. I forgot to mention that. I'll edit. – Sigur Apr 22 '20 at 11:32
  • Still doesn't work for me. I also wasn't sure where to place \makenomenclature, so I tried both before and after the code block and it doesn't seem to make a difference. – Daniel M Apr 22 '20 at 21:29

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.