LaTeX forum ⇒ Text Formattingnomencl | New Line in Item Label conflicts with Group Label Topic is solved

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

nomencl | New Line in Item Label conflicts with Group Label

Postby will_flp » Mon Dec 17, 2012 7:19 pm

Hi,

Following the solution given in this thread, I am using
  1. \renewcommand{\nomlabel}[1]{\smash{\parbox[t]{1.5cm}{#1}}\hfil}

However, it conflicts with the \nomgroup (see below).
  1. \documentclass{article}
  2. \usepackage{ifthen}
  3. \usepackage{calc}
  4. \usepackage[noprefix]{nomencl}
  5.  
  6. % Configure title of groups
  7. \newcommand{\bfdz}[1]{\bf\fontsize{12}{14}\selectfont #1}
  8. \newcommand{\meru}[1]{\rule[2pt]{\textwidth-(\widthof{#1})}{.5pt}}
  9.  
  10. % Enable two line label
  11. \renewcommand{\nomlabel}[1]{\smash{\parbox[t]{1.5cm}{#1}}\hfil}
  12.  
  13. % Create Groups
  14. \renewcommand{\nomgroup}[1]{%
  15. \ifthenelse{\equal{#1}{A}}{\vspace{5mm} \item[\bfdz General Symbols] \meru{\bfdz General Symbols~~}}{%
  16. \ifthenelse{\equal{#1}{G}}{\vspace{5mm} \item[\bfdz Greek Symbols] \meru{\bfdz Greek Symbols~~}}{}}}
  17.  
  18. \makenomenclature
  19.  
  20. \begin{document}
  21.  
  22. \printnomenclature[1.5cm]
  23.  
  24. \nomenclature[A]{$p(r_m,t)$, $p_m(t)$}{Received signal at the $m^{th}$ microphone\nomrefpage}%{}{}
  25.  
  26. \nomenclature[G]{$\Delta t_{\vec{x}}$}{Emission time delay at focus point $\vec{x}$, $\Delta t_{\vec{x}}=r_{\vec{x}} / c$\nomrefpage}%{}{}
  27.  
  28. \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 1248 times

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
Stefan Kottwitz
Site Admin
Posts: 7801
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Mon Dec 17, 2012 8:40 pm

Hi Will,

welcome to the board!

What is the conflict? It compiles without error.

Stefan
Site admin

Link:
BBcode:
HTML:
Hide post links
Show post links

will_flp
Posts: 4
Joined: Mon Dec 17, 2012 7:06 pm

Postby will_flp » Mon Dec 17, 2012 9:39 pm

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
  1. \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 1248 times

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
cgnieder
Site Moderator
Posts: 1948
Joined: Sat Apr 16, 2011 7:27 pm
Location: Germany
Contact:

Postby cgnieder » Wed Dec 19, 2012 9:55 pm

Here's a suggestion:

  1. % arara: pdflatex
  2. % arara: nomencl
  3. % arara: pdflatex
  4. \documentclass{article}
  5.  
  6. \usepackage{ragged2e}
  7. \usepackage[noprefix]{nomencl}
  8.  
  9. \newcommand\grouphead[1]{%
  10. \rlap{%
  11. \parbox{\textwidth}{\textbf{\large#1 \hrulefill}}%
  12. }\hfill
  13. }
  14.  
  15. % Enable two line label
  16. \renewcommand{\nomlabel}[1]{%
  17. \smash{\parbox[t]{.15\linewidth}{\RaggedRight#1}}}
  18.  
  19. % Create Groups
  20. \renewcommand{\nomgroup}[1]{%
  21. \ifx#1A\relax
  22. \item[\grouphead{General Symbols}]
  23. \fi
  24. \ifx#1G\relax
  25. \item[\grouphead{Greek Symbols}]
  26. \fi
  27. \bigskip}
  28.  
  29. \makenomenclature
  30.  
  31. \begin{document}
  32.  
  33. Text bla bla
  34.  
  35. \printnomenclature[1.5cm]
  36.  
  37. \nomenclature[A]{$p(r_m,t)$, $p_m(t)$}{Received signal at the $m^{th}$ microphone\nomrefpage}%{}{}
  38.  
  39. \nomenclature[G]{$\Delta t_{\vec{x}}$}{Emission time delay at focus point $\vec{x}$, $\Delta t_{\vec{x}}=r_{\vec{x}} / c$\nomrefpage}%{}{}
  40.  
  41. \end{document}


nomencl.png
nomencl.png (17.87 KiB) Viewed 1436 times


Regards
Clemens
------------------------------
New German Q&A site about TeX: http://texwelt.de/wissen

Link:
BBcode: Topic is solved[/url]" title="Click to select post's link in BBcode format" onclick="this.focus();this.select();" />
HTML: Topic is solved</a>" title="Click to select post's link in HTML format" onclick="this.focus();this.select();" />
Hide post links
Show post links

will_flp
Posts: 4
Joined: Mon Dec 17, 2012 7:06 pm

Postby will_flp » Wed Dec 19, 2012 10:45 pm

cgnieder, thanks a lot !

It is working perfectly!

=]

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
cgnieder
Site Moderator
Posts: 1948
Joined: Sat Apr 16, 2011 7:27 pm
Location: Germany
Contact:

Postby cgnieder » Wed Dec 19, 2012 11:14 pm

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
Clemens
------------------------------
New German Q&A site about TeX: http://texwelt.de/wissen

Link:
BBcode:
HTML:
Hide post links
Show post links


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 3 guests