Generalglossaries | New Acronym Style

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
letscho84
Posts: 7
Joined: Tue Jan 10, 2012 10:01 pm

glossaries | New Acronym Style

Post by letscho84 »

Hello,

I'm writing my thesis and needed a acronym list at the opening of my document. I try to create one by my own, but it does not comply to my expectations. I put a PDF of what I want in the attachment.

And now I try to explain what I want. In my acronym list I would like to have at the left side the abbreviation then the German meaning and with a little space after that meaning a English translation. What i can´t adjust is that the first description (the German meaning) starts for every abbreviation at the same point (like in the PDF). AND I only want that in the text I´m writing stands the English translation and the abbreviation at the first use.

I hope one could help me with my problem and understood what I want. Here is what I´ve created up to now:

Code: Select all

\documentclass[a4paper, 11pt, oneside, ngerman]{book}
\usepackage[latin9]{inputenc}	
\usepackage[T1]{fontenc}
\usepackage{subscript}			

\usepackage{longtable,tabu,booktabs,threeparttable}							
\usepackage{multirow}	

\usepackage[mode=text,per-mode=symbol,exponent-product = \cdot]{siunitx}
\sisetup{locale = DE}

\usepackage{amsmath, amsthm, amssymb, mathtools}

\usepackage[nonumberlist, numberline, acronym, toc, sanitize={description=false}, description]{glossaries}									

%Symbols
\newglossary[slg]{symbolslist}{syi}{syg}{Symbolverzeichnis}

%Style Symbols definiation
\newglossarystyle{symbver}{ % put the glossary in a longtable environment:
\renewenvironment{theglossary}
{\begin{longtable}{lp{\glsdescwidth}cccp{\glspagelistwidth}}}
{\end{longtable}}

\renewcommand*{\glossaryheader}{}

\renewcommand*{\glossaryentryfield}[4]{
\glstarget{##1}\\[0.5cm]{##2}&{##3}&{##4}}

\renewcommand*{\glossarysubentryfield}[6]{
\glossaryentryfield{##2}{##3}{##4}{[##5]}}

\renewcommand*{\glsgroupskip}{}}

\renewcommand*{\acrnameformat}[2]{\acronymfont{#1} #2}			
\renewcommand*{\glsnamefont}[1]{\textmd{#1}}

%no dotes
\renewcommand*{\glspostdescription}{}

\newglossaryentry{romanletter}{name={\textbf{\rlap{Lateinische Buchstaben}}},description={},sort=a} %Latain
\newglossaryentry{greekletter}{name={\textbf{\rlap{Griechische Buchstaben}}},description={},sort=b} %Greak
\newglossaryentry{indizes}{name={\textbf{\rlap{Indizes}}},description={},sort=c} %Indizes


\makeglossaries

\newacronym[description={- Antiblockiersystem}]{ABS}{ABS}{anti-lock braking system}
\newacronym[description={- Heißgassytemteil}]{HGST}{HGST}{...}

\newglossaryentry{symb:p}{name=$p$, symbol=\protect\si{\protect\bar}, description={Druck}, sort=symbolp, parent=romanletter, type=symbolslist}
\newglossaryentry{symb:start}{name=${Start}$, description={Anfang}, sort=symbolstart, parent=indizes, type=symbolslist}														
\newglossaryentry{symb:zeta}{name=$\zeta$, symbol=-, description={Verlustfaktor}, sort=symbolzeta, parent=greekletter, type=symbolslist}								
\begin{document}

\tableofcontents

%Abkürzungen ausgeben
\printglossary[type=\acronymtype,style=list, title=Abkürzungsverzeichnis, toctitle=Abkürzungsverzeichnis]

%Symbole ausgeben
\printglossary[type=symbolslist,style=symbver,title=Symbolverzeichnis] 



Hier soll mal der ganze Text stehen!

\gls{ABS}

\gls{HGST}

\gls{symb:p}\textsubscript{\gls{symb:start}} 

\gls{symb:p}

\gls{symb:zeta}

\end{document}
greetings, letscho
Attachments
Acronyms.pdf
(5.97 KiB) Downloaded 475 times
Last edited by letscho84 on Thu Jan 19, 2012 5:57 pm, edited 2 times in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

nlct
Posts: 276
Joined: Thu Nov 06, 2008 11:15 am

glossaries | New Acronym Style

Post by nlct »

Is this what you want?

Code: Select all

\documentclass[a4paper, 11pt, oneside, ngerman]{book}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage[nonumberlist,numberline,acronym,toc]{glossaries}   

\newglossarystyle{dual}{%
  \renewenvironment{theglossary}%
  {\begin{longtable}{lll}}%
  {\end{longtable}}%
  \renewcommand*{\glossaryheader}{}%
  \renewcommand*{\glsgroupheading}{}%
  \renewcommand*{\glsgroupskip}{}%
  \renewcommand*{\glossaryentryfield}[5]{%
    \glsentryitem{##1}\glstarget{##1}{##2} & 
      -- \glsentryuseri{##1} & ##3\\
  }%
  \renewcommand*{\glossarysubentryfield}[6]{%
    \glossaryentryfield{##2}{##3}{##4}{##5}{##6}%
  }%
}

\renewcommand*{\acrnameformat}[2]{\acronymfont{#1} #2}
\renewcommand*{\glsnamefont}[1]{\textmd{#1}}

\makeglossaries

\newacronym[user1={Antiblockiersystem}]{ABS}{ABS}{anti-lock
braking system}
\newacronym[user1={Heißgassytemteil}]{HGST}{HGST}{...}

\begin{document}

\printglossary[type=\acronymtype,style=dual,
title=Abkürzungsverzeichnis, toctitle=Abkürzungsverzeichnis]

\gls{ABS}

\gls{HGST}

\end{document}
Regards
Nicola Talbot
letscho84
Posts: 7
Joined: Tue Jan 10, 2012 10:01 pm

glossaries | New Acronym Style

Post by letscho84 »

Hi Nicola,

yes that´s exactly what i wanted! Thanks for your help.

But how could i do a line break at longer description?

Greetings,
Letscho
letscho84
Posts: 7
Joined: Tue Jan 10, 2012 10:01 pm

Re: glossaries | New Acronym Style

Post by letscho84 »

Hello together,

I tested the code of Nicola with a larger document and find some difficulties in the produced file. LaTeX put at the beginnen of every new acronym a letter. Like:

AABS
ACD
BBD
BS

and so on. So the right formation must be like:

ABS
ACD
BD
BS

Now my question: how could i deactive the first letter in the formation of Nicola? I hope you know what i mean.

Greetings, Letscho
User avatar
nlct
Posts: 276
Joined: Thu Nov 06, 2008 11:15 am

glossaries | New Acronym Style

Post by nlct »

Sorry, I missed the argument for \glsgroupheading. Replace the line:

Code: Select all

\renewcommand*{\glsgroupheading}{}%
with

Code: Select all

\renewcommand*{\glsgroupheading}[1]{}%
Regards
Nicola Talbot
User avatar
nlct
Posts: 276
Joined: Thu Nov 06, 2008 11:15 am

glossaries | New Acronym Style

Post by nlct »

letscho84 wrote: But how could i do a line break at longer description?
Use the "p" column specifier instead of "l". For example, change:
\renewenvironment{theglossary}%
{\begin{longtable}{lll}}%
{\end{longtable}}%
with something like:

Code: Select all

  \renewenvironment{theglossary}%
  {\begin{longtable}{lp{0.4\linewidth}p{0.4\linewidth}}}%
  {\end{longtable}}%
(Change the lengths as appropriate.)

Regards
Nicola Talbot
Post Reply