6

I want to create two separate acronym list. One with 3 columns and the other with four columns. I have defined the two styles for the two types of acronym list, style1 and style2.

I have my acronym files INP-00-glossary.tex and INP-01-glossary.tex

How can I print two separate list of acronyms on separate pages?

EDIT:

The two lists I need are like following: List 1: (Which I call Nomenclature) This list consists of all the mathematical symbols that I have used. For example

**Nomenclature** 
**Symbol     Description     Units       First used on Page No.** 

T            Temperature      K                    5

I have second list which is like following

**Abbreviations** 
**Term     Description                First used on Page No.** 

MD          molecular dynamics                       7

The Nomenclature I have defined as \acronym. For example

\newacronym[user1={K}]{T}{\textit{T}}{temperature} 

The Abbreviations I have defined as Glossaries. For example

\newglossaryentry{md}
{
  name={MD},
  description={molecular dynamics},
}

Now When I refer to \gls{T}. it expands on first occurrence and puts the symbol T in parenthesis. But when I refer to \gls{md}, it only writes MD. I want it like the first list I have created, both expansion and abbreviation in parenthesis.

So I wanted both the list to be defined as acronyms.

MWE:

\documentclass[12pt,a4paper]{article}




%hyperlink
%\usepackage[backref=page]{hyperref}
\usepackage{hyperref}
\hypersetup{
    bookmarks=true,         % show bookmarks bar?
    unicode=false,          % non-Latin characters in Acrobat’s bookmarks
    pdftoolbar=true,        % show Acrobat’s toolbar?
    pdfmenubar=true,        % show Acrobat’s menu?
    pdffitwindow=false,     % window fit to page when opened
    pdfstartview={FitH},    % fits the width of the page to the window
    pdftitle={My title},    % title
    pdfauthor={Author},     % author
    pdfsubject={Subject},   % subject of the document
    pdfcreator={Creator},   % creator of the document
    pdfproducer={Producer}, % producer of the document
    pdfkeywords={keyword1} {key2} {key3}, % list of keywords
    pdfnewwindow=true,      % links in new window
    colorlinks=true,       % false: boxed links; true: colored links
    linkcolor=red,          % color of internal links
    citecolor=blue,        % color of links to bibliography
    filecolor=magenta,      % color of file links
    urlcolor=cyan           % color of external links
}


\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{enumerate}


\usepackage{tocloft}% deal with Tables of Con­tents
\usepackage[T1]{fontenc} %font encoding
\usepackage{lmodern} % better font
\usepackage{lipsum,appendix}
\usepackage{booktabs}%beautiful table
\usepackage{siunitx} %angstrom use: \si{\angstrom}
\usepackage{setspace}%one and half space
\usepackage[english]{babel}
\usepackage[round]{natbib}
\usepackage{upgreek}
\usepackage{pdflscape} %landscape page
\usepackage{mhchem} %left superscript subscipt
\usepackage{float}%exact location
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption} % for subfigures




%glossaries and acronym
\usepackage[acronym,xindy,toc,numberline,indexonlyfirst, nomain]{glossaries}


\newglossary[nlg]{nomenc}{not}{ntn}{Nomenclature}
\newglossary[slg]{abbrev}{sot}{stn}{Abbreviations}



%custom glossary style
\newglossarystyle{long6col}{%
% put the glossary in a longtable environment:
\renewenvironment{theglossary}%
{\begin{longtable}{lp{\glsdescwidth}cccp{\glspagelistwidth}}}%
{\end{longtable}}%
% Set the table’s header:
\renewcommand
*
{\glossaryheader}{%
\bfseries Symbol & \bfseries Description & &
\bfseries Units & & \bfseries Page List
\\\endhead}%
% No heading between groups:
\renewcommand
*
{\glsgroupheading}[1]{}%
% Main (level 0) entries displayed in a row optionally numbered:
\renewcommand
*
{\glossaryentryfield}[5]{%
\glsentryitem{##1}% Entry number if required
\glstarget{##1}{##2}% Name
& ##3% Description
& ##4% Symbol
& \glsentryuseri{##1}% Units
& \glsentryuserii{##1}% Dimensions
& ##5% Page list
\\% end of row
}%
% Similarly for sub-entries (no sub-entry numbers):
\renewcommand
*
{\glossarysubentryfield}[6]{%
% ignoring first argument (sub-level)
\glstarget{##2}{##3}% Name
& ##4% Description
& ##5% Symbol
& \glsentryuseri{##2}% Units
& \glsentryuserii{##2}% Dimensions
& ##6% Page list
\\% end of row
}%
% Nothing between groups:
\renewcommand
*
{\glsgroupskip}{}%
}
%END: custom glossary style



%custom glossary1 style
\newglossarystyle{long6col1}{%
% put the glossary in a longtable environment:
\renewenvironment{theglossary}%
{\begin{longtable}{lp{\glsdescwidth}cccp{\glspagelistwidth}}}%
{\end{longtable}}%
% Set the table’s header:
\renewcommand
*
{\glossaryheader}{%
\bfseries Term & \bfseries Description & &
 & & \bfseries Page List
\\\endhead}%
% No heading between groups:
\renewcommand
*
{\glsgroupheading}[1]{}%
% Main (level 0) entries displayed in a row optionally numbered:
\renewcommand
*
{\glossaryentryfield}[5]{%
\glsentryitem{##1}% Entry number if required
\glstarget{##1}{##2}% Name
& ##3% Description
& ##4% Symbol
& \glsentryuseri{##1}% Units
& \glsentryuserii{##1}% Dimensions
& ##5% Page list
\\% end of row
}%
% Similarly for sub-entries (no sub-entry numbers):
\renewcommand
*
{\glossarysubentryfield}[6]{%
% ignoring first argument (sub-level)
\glstarget{##2}{##3}% Name
& ##4% Description
& ##5% Symbol
& \glsentryuseri{##2}% Units
& \glsentryuserii{##2}% Dimensions
& ##6% Page list
\\% end of row
}%
% Nothing between groups:
\renewcommand
*
{\glsgroupskip}{}%
}
%END: custom glossary style





%START hyperlink glossaries of 2nd instance onward off
\usepackage{etoolbox}
\makeatletter
%% patch first occurence of "\@gls@link[#1]{#2}{\@glo@text}", as this is the one for \glsused{#2}
\patchcmd{\@gls@}
  {\@gls@link[#1]{#2}{\@glo@text}}
  {\@gls@link[#1,hyper=false]{#2}{\@glo@text}}
  {}{}


\patchcmd{\@Gls@}
  {\@gls@link[#1]{#2}}
  {\@gls@link[#1,hyper=false]{#2}}
  {}{}

\patchcmd{\@GLS@}
  {\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}}
  {\@gls@link[#1,hyper=false]{#2}{\MakeUppercase{\@glo@text}}}
  {}{}
\makeatother
%END hyperlink glossaries of 2nd instance onward off




\renewcommand*{\glspostdescription}{}%removes dot at end
\glssetwidest{AAAAAAA}% widest name
\renewcommand*{\glsnamefont}[1]{\textmd{#1}}



\makeglossaries

%\loadglsentries[nomenc]{INP-00-glossary}
\let\oldacronymtype\acronymtype
\def\acronymtype{nomenc}
\loadglsentries[nomenc]{INP-00-glossary}
\let\acronymtype\oldacronymtype

\loadglsentries[abbrev]{INP-01-glossary}


%table header multiline START
\newcommand{\specialcell}[2][c]{%
  \begin{tabular}[#1]{@{}c@{}}#2\end{tabular}}
%table header multiline END


\usepackage[showframe=false]{geometry}
\geometry{verbose,tmargin=1in,bmargin=1in,lmargin=1.5in,rmargin=1in}


\renewcommand*\appendixpagename{Appendix}
\renewcommand*\appendixtocname{Appendix}

\renewcommand*{\acronymname}{Nomenclature}%
\renewcommand*{\pagelistname}{First used on page no.}%
%\renewcommand*{\glossaryname}{Abbreviations}
\usepackage{longtable}%for example, manual nomenclature






\begin{document}

%\maketitle
\pagenumbering{alph}
\renewcommand*{\glossaryname}{Abbreviations}



\begin{titlepage}
\begin{center}
\linespread{1}
\Huge\bf{\uppercase{ The Title Page}}\\




\end{center}
\end{titlepage}







\pagenumbering{roman}

\newpage
\onehalfspace
\tableofcontents
\newpage

%list of tables
\phantomsection \label{listoftab}
\addcontentsline{toc}{section}{List of Tables}
\listoftables
\newpage


%list of figures
\phantomsection \label{listoffig}
\addcontentsline{toc}{section}{List of Figures}
\listoffigures
\newpage



\glsaddall

\printglossary[style=long6col,type=nomenc]
\newpage
\printglossary[style=long6col1,type=abbrev]




%\setcounter{page}{3}
\newpage


\setcounter{secnumdepth}{0}
%\include{nomeclature_manual}
%\include{abbreviations}
\setcounter{secnumdepth}{4}
\pagenumbering{arabic}
\include{textbody}



\end{document}

The content of INP-00-glossary.tex

\newacronym[user1={$\AA$}]{a}{\textit{a}}{lattice constant}
\newacronym[user1={$K^{-1}$}]{alphat}{$\alpha_T$}{linear thermal expansion coefficient}

The content of INP-01-glossary.tex

\newglossaryentry{MC}
{
  name={MC},
  description={Monte Carlo},
  first={\glsentrydesc{MC} (\glsentrytext{MC})}
}
\newglossaryentry{MD}
{
  name={MD},
  description={molecular dynamics},
  first={\glsentrydesc{MD} (\glsentrytext{MD})}
}

The content of textbody.tex

\section{My First Section}

text first page \gls{MD}
\newpage
text second page \gls{a}
\newpage
text third page \gls{alphat}
\newpage
text fourth page \gls{MC}

The name of the glossary styles

long6col and long6col1

5

This is the right way.

I added \glsaddall simply to add all entries in the lists.

\documentclass{article}

\usepackage{glossaries}

\newglossary[nlg]{nomenc}{not}{ntn}{Nomenclature}
\newglossary[slg]{abbrev}{sot}{stn}{Abbreviations}

% Your custom styles here
% \newglossarystyle{style1}{.....}
% \newglossarystyle{style2}{.....}

\makeglossaries

\loadglsentries[nomenc]{INP-00-glossary}
\loadglsentries[abbrev]{INP-01-glossary}

\begin{document}

\glsaddall

\printglossary[style=style1,type=nomenc]
\printglossary[style=style2,type=abbrev]

\end{document}

EDIT

If you have the need to load the glossaries package with the option acronym

\usepackage[acronym]{glossaries}

then you can use this workaround to load your database with acronyms: substitute the line

\loadglsentries[nomenc]{INP-00-glossary}

with

\let\oldacronymtype\acronymtype
\def\acronymtype{nomenc}
\loadglsentries[nomenc]{INP-00-glossary}
\let\acronymtype\oldacronymtype

EDIT2

To solve your issue with \gls{md}, you should define the first key, which determines how the glossary entry is printed the first time it is used (it is automatic for acronyms, but not for common glossary entries).

This means that you have to rewrite your entry as:

\newglossaryentry{md}
{
  name={MD},
  description={molecular dynamics},
  first={\glsentrydesc{md} (\glsentrytext{md})}
}
  • Thanks. I have expanded my question with examples. I tried to implement what you said, but I got errors. The reson must be I have not understood what you did. \newglossary[nlg]{notation}{not}{ntn}{Notation} \newglossary[slg]{symbols}{sot}{stn}{Symbols} . These two lines can you explain please. Can you please tell me how shall I define my entries also? – cosmicraga Aug 6 '13 at 6:47
  • I've simply defined two new glossaries, named nomenc and abbrev, so you can apply your custom styles to them when using \printglossary. Without a MWE it is difficult to say why you are getting errors. – karlkoeller Aug 6 '13 at 6:52
  • @cosmicraga Since in one of your database files the entries are defined with \newacronym, try loading the glossaries package without the option acronym, or use the workaround as described in the updated answer. – karlkoeller Aug 6 '13 at 7:51
  • @cosmicraga I've added a second edit regarding your issue with \gls{md} – karlkoeller Aug 6 '13 at 8:27
  • 1
    @cosmicraga This is because you've left \glsaddall in your document. Remove it and all will be fine. I added it in the MWE just for testing... – karlkoeller Aug 12 '13 at 5:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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