LaTeX forum ⇒ MakeIndex, Nomenclature, Glossaries and AcronymsGlossaries,acronym, symbols, etc. per chapter with style super so that description part aligned vertically

Information and discussion about MakeIndex - the tool to generate subject indices for LaTeX documents.
Posts: 1
Joined: Mon Aug 27, 2018 5:02 am

Glossaries,acronym, symbols, etc. per chapter with style super so that description part aligned vertically

Postby bijandeb » Mon Aug 27, 2018 5:15 am

I am using the sample code provided by TEX.SX provided by Talbot and also here . But here the glossaries are not arranged in an aligned mode which looks very bad in formatting. It would be very good if both the name and description etc are aligned vertically so that there is clear readability of each of the glossary terms, symbols, acronym, notation or whatever be the custom glossaries used per chapter. The super style is good looking, but not able to do using the provided idea for per chapter in mentioned link.

The MWE may same as provided in this page or I have copied.
There should be two options, 1. Each unique glossaries per chapter is printed which is not used earlier chapter
2. Each chapter glossaries are printed irrespective of used earlier or not. In this case, there may be some repetition of glossaries even if it used in previous chapters.

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \documentclass{book}% I am trying it for book
  2. \usepackage{datatool-base}
  3. \usepackage[counter=chapter,xindy,section=section]{glossaries}
  4. \GlsSetXdyMinRangeLength{0}
  5. \makeglossaries
  6. \newglossaryentry{E}{name={\ensuremath{E}},description={energy}}
  7. \newglossaryentry{m}{name={\ensuremath{m}},description={mass}}
  8. \newglossaryentry{c}{name={\ensuremath{c}},description={speed of light}}
  9. \newglossaryentry{v}{name={\ensuremath{v}},description=velocity}
  10. \newglossarystyle{mystyle}%
  11. {%
  12. \setglossarystyle{list}% % I want to use style=super for per chapter glossary with aligned description
  13. \renewcommand*{\glossaryentrynumbers}[1]{\striprelax##1\endstriprelax}%
  14. \renewcommand*{\glsXchapterXglsnumberformat}[2]{##2}%
  15. \renewcommand*{\delimR}{,}%
  16. \renewcommand*{\glossentry}[2]{%
  17. \edef\doifinlocation{\noexpand\ifinlocation{\thechapter}{##2}}%
  18. \doifinlocation
  19. {%
  20. \item \glossentryname{##1} \glossentrydesc{##1}%
  21. }%
  22. }%
  23. }
  24. \newcommand{\ifinlocation}[3]{%
  25. \DTLifinlist{#1}{#2}{#3}{}%
  26. }
  27. \def\striprelax\relax#1\endstriprelax{#1}
  28. \setglossarystyle{mystyle}
  30. \begin{document}
  31. \chapter{Sample Chapter}
  32. \printglossary
  33. \begin{equation}
  34. \gls{E} = \gls{m}\cdot \gls{c}^2
  35. \end{equation}
  36. \glsresetall
  37. \chapter{Another Chapter}
  38. \printglossary
  39. \begin{equation}
  40. \gls{E} = \frac{\gls{m}\gls{v}^2}{2}
  41. \end{equation}
  42. \end{document}
  43. \end{document}

I want the output of this short
nb9hI.png (16.27 KiB) Viewed 3357 times

Return to “MakeIndex, Nomenclature, Glossaries and Acronyms”

Who is online

Users browsing this forum: No registered users and 1 guest