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 Contents
\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
Best Answer
This is the right way.
I added
\glsaddall
simply to add all entries in the lists.EDIT
If you have the need to load the
glossaries
package with the optionacronym
then you can use this workaround to load your database with acronyms: substitute the line
with
EDIT2
To solve your issue with
\gls{md}
, you should define thefirst
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: