Text Formattingnomencl | New Line in Item Label conflicts with Group Label

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
will_flp
Posts: 6
Joined: Mon Dec 17, 2012 7:06 pm

nomencl | New Line in Item Label conflicts with Group Label

Post by will_flp »

Hi,

Following the solution given in this thread, I am using

Code: Select all

\renewcommand{\nomlabel}[1]{\smash{\parbox[t]{1.5cm}{#1}}\hfil}
However, it conflicts with the \nomgroup (see below).

Code: Select all

\documentclass{article}
\usepackage{ifthen}
\usepackage{calc}
\usepackage[noprefix]{nomencl}

% Configure title of groups
\newcommand{\bfdz}[1]{\bf\fontsize{12}{14}\selectfont #1}
\newcommand{\meru}[1]{\rule[2pt]{\textwidth-(\widthof{#1})}{.5pt}}

% Enable two line label
\renewcommand{\nomlabel}[1]{\smash{\parbox[t]{1.5cm}{#1}}\hfil}

% Create Groups
\renewcommand{\nomgroup}[1]{%
\ifthenelse{\equal{#1}{A}}{\vspace{5mm} \item[\bfdz General Symbols] \meru{\bfdz General Symbols~~}}{%
\ifthenelse{\equal{#1}{G}}{\vspace{5mm} \item[\bfdz Greek Symbols] \meru{\bfdz Greek Symbols~~}}{}}}

\makenomenclature 

\begin{document}

\printnomenclature[1.5cm]

\nomenclature[A]{$p(r_m,t)$, $p_m(t)$}{Received signal at the $m^{th}$ microphone\nomrefpage}%{}{}

\nomenclature[G]{$\Delta t_{\vec{x}}$}{Emission time delay at focus point $\vec{x}$, $\Delta t_{\vec{x}}=r_{\vec{x}} / c$\nomrefpage}%{}{}

\end{document}
Does anyone know a way to fix it ?

Thanks,

Will
Attachments
nomencl-conflict-item-group.png
nomencl-conflict-item-group.png (36.88 KiB) Viewed 5084 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Re: nomencl | New Line in Item Label conflicts with Group La

Post by Stefan Kottwitz »

Hi Will,

welcome to the board!

What is the conflict? It compiles without error.

Stefan
LaTeX.org admin
will_flp
Posts: 6
Joined: Mon Dec 17, 2012 7:06 pm

nomencl | New Line in Item Label conflicts with Group Label

Post by will_flp »

Hi Stefan, thanks for the welcome.


Well, to be more clear please see the attached picture. I want the name of the groups to be wider ("blue space") and the labels smaller ("delimited green").

If you comment the line

Code: Select all

\renewcommand{\nomlabel}[1]{{\parbox[t]{1.5cm}{#1}}\hfil}
you will get something like the picture.
Attachments
nomencl-conflict-details.png
nomencl-conflict-details.png (35.09 KiB) Viewed 5084 times
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

nomencl | New Line in Item Label conflicts with Group Label

Post by cgnieder »

Here's a suggestion:

Code: Select all

% arara: pdflatex
% arara: nomencl
% arara: pdflatex
\documentclass{article}

\usepackage{ragged2e}
\usepackage[noprefix]{nomencl}

\newcommand\grouphead[1]{%
  \rlap{%
    \parbox{\textwidth}{\textbf{\large#1 \hrulefill}}%
  }\hfill
}

% Enable two line label
\renewcommand{\nomlabel}[1]{%
  \smash{\parbox[t]{.15\linewidth}{\RaggedRight#1}}}

% Create Groups
\renewcommand{\nomgroup}[1]{%
  \ifx#1A\relax
    \item[\grouphead{General Symbols}]
  \fi
  \ifx#1G\relax
    \item[\grouphead{Greek Symbols}]
  \fi
  \bigskip}

\makenomenclature 

\begin{document}

Text bla bla

\printnomenclature[1.5cm]

\nomenclature[A]{$p(r_m,t)$, $p_m(t)$}{Received signal at the $m^{th}$ microphone\nomrefpage}%{}{}

\nomenclature[G]{$\Delta t_{\vec{x}}$}{Emission time delay at focus point $\vec{x}$, $\Delta t_{\vec{x}}=r_{\vec{x}} / c$\nomrefpage}%{}{}

\end{document}
nomencl.png
nomencl.png (17.87 KiB) Viewed 5272 times
Regards
site moderator & package author
will_flp
Posts: 6
Joined: Mon Dec 17, 2012 7:06 pm

nomencl | New Line in Item Label conflicts with Group Label

Post by will_flp »

cgnieder, thanks a lot !

It is working perfectly!

=]
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

nomencl | New Line in Item Label conflicts with Group Label

Post by cgnieder »

For reference [1]: this question has been asked and answered on TeX.SX, too.

[1]: The board rules state that a direct link to crossposts has to be provided.

Regards
site moderator & package author
Post Reply