I want to generate a nomenclature with the nomencl package, which should be in a framed box and where both the header and symbol column are aligned with the global parindent value. The document class must be elsarticle and the result should be kind of steered by the values given by this class - so I'm not able to change global values if that makes sense.

Anyways, so far I found out that the alignment of the symbol column can be achieved by using the patchcmd. Unfortunately, I couldn't figure out how to do the same with the header, also tried to mess around with the help given here, but without success.

I've attached an example with highly exaggerated indentation and fbox' separation and ruler values to make the problem more drastic.

Therein, I've tried to shift the header manually by an hspace command, but the result is not good as shown in the picture. There is still a gap which is highly dependent on the set parindent and frame box settings.

I'm looking forward to your suggestions.

Kind regards

SebastianNomenclature header not aligned with parindent

% arara: pdflatex
% arara: nomencl
% arara: pdflatex
\documentclass[preprint,3p, times]{elsarticle}

% these are relevant variables to play around in order to check dependencies
% parident, nomenclature header and nomenclature symbol column should always
% start at the same horizontal position, no matter hwo the parameter change.

% package to define a nomenclature
   % OPTION: no empty line between nomenclature lines
   % OPTION: manipulate distance between symbol column and explanation column
   % MODIFICATION: new command to make a box around nomenclature
   % definition of space between top box line and start of Nomenclature
   % definition of space between end of Nomenclature and bottom box line
   % definition of the framed box
   % parbox inside a fbox

   % Nomenclature environment sets a local \parindent with 0.0, we need to shift environment by
   % global parident
   \setlength{\globalParindent}{\dimexpr \the\parindent \relax}

   % xpatch package allows to change lines of a package temporary
   % here: the left symbol colum is indented accordinglig
      % search for original line of source code
      % replace with
      {\leftmargin\labelwidth\itemindent \dimexpr \globalParindent-\fboxsep -\fboxrule \relax  }
      % in case of success
      % in case it fails

   % definition of the complete nomenclature

% Nomenclatur content
\nomenclature{$m$}{Mass of a point object}
\nomenclature{$v$}{Speed of a point object}
\nomenclature{$E_{kin}$}{Kinetic Energy of a point object}

\indent Nomenclature: here should it actually start \\
\printNomenclatureWithBox \\
\indent Nomenclature: here should it actually start

% FIXME: indent the section title by redefine name of nomenclature
%        result not satisfying
\renewcommand{\nomname}{\hspace{\dimexpr \globalParindent -\fboxsep  -\fboxrule  \relax}
Nomenclature - parident var: local = \the\parindent, global = \the\globalParindent }

\printNomenclatureWithBox \\
\indent Nomencalture: here should it actually start. \lipsum[1-3]
  • Welcome to TeX.SE!
    – Mensch
    Commented Apr 5 at 10:57
  • @Mensch Thank you! Commented Apr 5 at 12:27


You must log in to answer this question.

Browse other questions tagged .