6

The problem: How to add a "Nomenclature" section for Elsevier journals in a 2-column format at the top of the second page in a frame through TexMaker

So, I googled a lot for this problem and finally found a solution. I'm sharing it here maybe it helps someone in future to save time.

5

Most elsarticle.cls comes with a nomenclature environment. If not, open elsarticle.cls and paste this at the bottom before \endinput

\newbox\tempbox%
\newenvironment{nomenclature}{\par\vskip6pt plus1pt\setbox\tempbox\vbox\bgroup\if@twocolumn\hsize17.5pc\else\hsize37.3pc\fi\vspace*{-17.7pt}\section*{Nomenclature}}{\egroup\par\noindent\fboxsep10pt\fbox{\box\tempbox}\vskip6pt}
\def\deflist{\@ifnextchar[{\@deflist}{\@deflist[]}}
\newbox\defbox%
\newdimen\defboxdimen%
\def\@deflist[#1]{%
\setbox\defbox\hbox{#1:\quad}%
\defboxdimen\wd\defbox%
\def\tempa{#1}%
\par\addvspace{12pt plus2pt minus2pt}%
\setlength\parindent{0pt}%
\def\deftitle##1{{\noindent\itshape##1}\par}%\fontsize{12}{12}\selectfont
\ifx\tempa\@empty%
\def\defitem##1{\@hangfrom{##1\ }}%%%
\else%
\def\defitem##1{\@hangfrom{\hbox to \defboxdimen{##1\quad}}}%%
\fi%
\def\defterm##1{##1\par}
}

Then in your main file simply write

\begin{nomenclature}
\begin{deflist}[A] %[AAAA] if you have 4 letters max for example
\defitem{A}\defterm{radius of}
\defitem{B}\defterm{position of}
\defitem{C}\defterm{further nomenclature continues down the page}
\end{deflist}
\end{nomenclature}
2
  • 2
    Modifying a class file is not really a recommended procedure; such code can go in the document. – egreg Apr 14 '17 at 20:54
  • 1
    While I agree with @egreg 's comment in general, note that Elsevier templates are not perfect. I've posted questions about the bugs in their double column template, and asked them directly, and their support is not fantastic. So while no publisher wants you to edit their templates, you can certainly do it, it just depends on what you want to do with your document. In some jounrals, what you submit is only used for the reviewers, not final acceptance. In others, they may immediately reject if they diff a change. I've edited some that have been accepted. – delrocco Oct 10 '19 at 20:04
3

Step1. You should add these lines at the top of the page in TeXmaker:

\documentclass[5p]{elsarticle}

\usepackage{framed} % Framing content

\usepackage{multicol} % Multiple columns environment

\usepackage{nomencl} % Nomenclature package

\makenomenclature

\setlength{\nomitemsep}{-\parskip} % Baseline skip between items

\renewcommand*\nompreamble{\begin{multicols}{2}}

\renewcommand*\nompostamble{\end{multicols}}

\begin{document}

Step2. Add these codes in the body of the document:

\begin{table*}[!t]   

\begin{framed}

\nomenclature{$abbreviation$}{explanation for the abbreviation}

\printnomenclature

\end{framed}

\end{table*}

Note1: this command allows you to add Nomenclature as many times as you want

\nomenclature{$abbreviation$}{explanation for the abbreviation}

Step3. Go to Options > Configure Texmaker > TEX Commands

In the Latexmk command space, add this code at the end of the already written command (completely):

 ; makeindex elsarticle-template.nlo -s nomencl.ist -o elsarticle-template.nls 

(don't forget, you may need to change the name of *.nlo or *.nls if you have made some modifications to the name)


Step4. Go to Tools > open Terminal

and then enter this code (same code without semicolon ';' at the beginning):

 makeindex elsarticle-template.nlo -s nomencl.ist -o elsarticle-template.nls 

Step5. From the drop-down menu, choose LatexMK to compile your code and then you can choose Quick Build as well. (try more than once if the first time the table doesn't appear)

That's it guys. The final work should create a table like this at the top of the second page:

enter image description here

Not the answer you're looking for? Browse other questions tagged or ask your own question.