6

Im trying to have two glossaries in my Thesis. One for the acronyms and the other one for the equation symbols. the problem is that for the acronyms i want to have just two columns without headers and for the equations three with headers. I've wrtitten this code but i dont know how can i give a different Style for the acronyms (only two columns) (see below)

\documentclass[12pt,twoside,booktabs,a4paper]{book}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[acronym,toc,shortcuts]{glossaries}


\newglossary[ch1]{formel}{ch2}{ch3}{Formelverzeichnis}

\makenoidxglossaries
\setacronymstyle{long-short}

\newglossarystyle{formel_altlong4colheader}{%
\setglossarystyle{altlong4colheader}%
% 
\renewcommand*{\glossaryheader}{%
    \bfseries Formelzeichnen
   & \bfseries Bedeutung
   & \bfseries Einheit\\
   \hline
   \\\endhead}%
 \renewcommand{\glossentry}[2]{% 
 \glstarget{##1}{\glossentryname{##1}}% 
 & \glossentrydesc{##1}% 
 & \glossentrysymbol{##1}% 
 \tabularnewline % end of row
 }%
}

\setlength{\glsdescwidth}{3in}
\setglossarystyle{formel_altlong4colheader}


%------Acronym---------
\renewcommand*{\acronymname}{Abkürzungsverzeichnis}
\newacronym[shortplural={BLKs},longplural={Belastungskollektive}]{BLK}{BLK}{Belastungskollektiv}
\newacronym{DL}{DL}{Dauerlauf}
\newacronym[shortplural={Fzg-DL},longplural={Fahrzeugdauerläufen}]{Fzg-DL}{Fzg-DL}{Fahrzeug Dauerlauf}

%-----Formel---
\newglossaryentry{re}
{%
name={$R_e$},
description={Streckgrenze},
symbol={Pa},
sort=streckgrenze,
type=formel
}
\newglossaryentry{rm}
{%
name={$R_m$},
description={Zugfestigkeit},
symbol={Pa},
sort=Zugfestigkeit,
type=formel
}



\begin{document}

\printnoidxglossaries

\newpage
\gls{BLK}
\gls{DL}
\gls{Fzg-DL}
\gls{re}

\end{document}

enter image description here

do you have any idea how can i do it??

Thank you!

2
  • 1
    You need to use different printglossary commands and add the style as the optional argument.
    – Johannes_B
    Jan 12, 2015 at 16:29
  • but how can i print separately the glossaries. when i try \printnoidxglossaries[type=formel] then i get nothing.
    – elToro
    Jan 12, 2015 at 17:16

2 Answers 2

8

It seems to me that you want a style for your acronyms that looks like long3col but without page numbers.

So, define a new style for acronyms

\newglossarystyle{acronym_long3col}{%
\setglossarystyle{long3col}%
%
 \renewenvironment{theglossary}%
    {\begin{longtable}[l]{@{}p{0.2\hsize}p{0.7\hsize}p{0.01\hsize}@{}}}%
    {\end{longtable}}%
 \renewcommand{\glossentry}[2]{%
 \glstarget{##1}{\glossentryname{##1}}%
 & \glossentrydesc{##1}%
 \tabularnewline % end of row
 }%
}

and then delete the line

\setglossarystyle{formel_altlong4colheader}

After that, replace

\printnoidxglossaries

with

\printnoidxglossary[type=acronym, style=acronym_long3col]
\printnoidxglossary[type=formel,  style=formel_altlong4colheader]

MWE:

\documentclass[12pt,twoside,booktabs,a4paper]{book}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[acronym,toc,shortcuts]{glossaries}


\newglossary[ch1]{formel}{ch2}{ch3}{Formelverzeichnis}

\makenoidxglossaries
\setacronymstyle{long-short}

\newglossarystyle{formel_altlong4colheader}{%
\setglossarystyle{altlong4colheader}%
%
\renewcommand*{\glossaryheader}{%
    \bfseries Formelzeichnen
   & \bfseries Bedeutung
   & \bfseries Einheit\\
   \hline
   \\\endhead}%
 \renewcommand{\glossentry}[2]{%
 \glstarget{##1}{\glossentryname{##1}}%
 & \glossentrydesc{##1}%
 & \glossentrysymbol{##1}%
 \tabularnewline % end of row
 }%
}
\newglossarystyle{acronym_long3col}{%
\setglossarystyle{long3col}%
%
 \renewenvironment{theglossary}%
    {\begin{longtable}[l]{@{}p{0.2\hsize}p{0.7\hsize}p{0.01\hsize}@{}}}%
    {\end{longtable}}%
 \renewcommand{\glossentry}[2]{%
 \glstarget{##1}{\glossentryname{##1}}%
 & \glossentrydesc{##1}%
 \tabularnewline % end of row
 }%
}

\setlength{\glsdescwidth}{3in}


%------Acronym---------
\renewcommand*{\acronymname}{Abkürzungsverzeichnis}
\newacronym[shortplural={BLKs},longplural={Belastungskollektive}]{BLK}{BLK}{Belastungskollektiv}
\newacronym{DL}{DL}{Dauerlauf}
\newacronym[shortplural={Fzg-DL},longplural={Fahrzeugdauerläufen}]{Fzg-DL}{Fzg-DL}{Fahrzeug Dauerlauf}

%-----Formel---
\newglossaryentry{re}
{%
name={$R_e$},
description={Streckgrenze},
symbol={Pa},
sort=streckgrenze,
type=formel
}
\newglossaryentry{rm}
{%
name={$R_m$},
description={Zugfestigkeit},
symbol={Pa},
sort=Zugfestigkeit,
type=formel
}



\begin{document}

\printnoidxglossary[type=acronym, style=acronym_long3col]
\printnoidxglossary[type=formel,  style=formel_altlong4colheader]

\newpage
\gls{BLK}
\gls{DL}
\gls{Fzg-DL}
\gls{re}

\end{document} 

Output (List of acronyms)

enter image description here

2

Much easier then you think. Call the glossaries one by one and you can give them a different style each.

\documentclass[12pt,twoside,booktabs,a4paper]{book}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[acronym,toc,shortcuts]{glossaries}


\newglossary[ch1]{formel}{ch2}{ch3}{Formelverzeichnis}

\makenoidxglossaries
\setacronymstyle{long-short}

\newglossarystyle{formel_altlong4colheader}{%
    \setglossarystyle{altlong4colheader}%
    % 
    \renewcommand*{\glossaryheader}{%
        \bfseries Formelzeichnen
        & \bfseries Bedeutung
        & \bfseries Einheit\\
        \hline
    \\\endhead}%
    \renewcommand{\glossentry}[2]{% 
        \glstarget{##1}{\glossentryname{##1}}% 
        &
        \glossentrydesc{##1}% 
        &
        \glossentrysymbol{##1}% 
        \tabularnewline % end of row
    }%
}

\setlength{\glsdescwidth}{3in}


                      %------Acronym---------
\renewcommand*{\acronymname}{Abkürzungsverzeichnis}
\newacronym[shortplural={BLKs},longplural={Belastungskollektive}]{BLK}{BLK}{Belastungskollektiv}
\newacronym{DL}{DL}{Dauerlauf}
\newacronym[shortplural={Fzg-DL},longplural={Fahrzeugdauerläufen}]{Fzg-DL}{Fzg-DL}{Fahrzeug
Dauerlauf}

                      %-----Formel---
\newglossaryentry{re}
{%
    name={$R_e$},
    description={Streckgrenze},
    symbol={Pa},
    sort=streckgrenze,
    type=formel
}
\newglossaryentry{rm}
{%
    name={$R_m$},
    description={Zugfestigkeit},
    symbol={Pa},
    sort=Zugfestigkeit,
    type=formel
}



\begin{document}

\printnoidxglossary[type=acronym]
\printnoidxglossary[type=formel,style=formel_altlong4colheader]

\setglossarystyle{formel_altlong4colheader}
\newpage
\gls{BLK}
\gls{DL}
\gls{Fzg-DL}
\gls{re}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .