von cgnieder » So 18. Nov 2012, 20:15
Da mein Vorschlag keine echte Tabelle verwendet sondern nur so tut als ob, wäre damit eine Lösung nur umständlich möglich. Eine wesentlich sauberere und flexiblere Lösung wäre es, auf das Paket
glossaries umzusteigen.
Damit würde ich beispielsweise folgende Lösung vorschlagen:
% arara: pdflatex
% arara: makeglossaries
% arara: pdflatex
\documentclass{scrartcl}
\usepackage{siunitx}
\usepackage{glossaries,longtable}
% für die Bequemlichkeit einen \nomenclature Befehl:
\newcommand*\nomenclature[5][A]{%
\ifx#1A\relax
\newglossaryentry{#2}{
name={#3} ,
description={#4} ,
sort={#2} ,
user1 = {#5} ,
parent={abbreviation}
}
\fi
\ifx#1L\relax
\newglossaryentry{#2}{
name={#3} ,
description={#4} ,
sort={#2} ,
user1 = {\unexpanded{#5}} ,
parent={latin}
}
\fi
\ifx#1G\relax
\newglossaryentry{#2}{
name={#3} ,
description={#4} ,
sort={#2} ,
user1 = {\unexpanded{#5}} ,
parent={greek}
}
\fi
}
% einen neuen glossary-Style zur persönlichen Anpassung
\newglossarystyle{nomenclature}{%
\renewenvironment{theglossary}%
{\begin{longtable}{llp{\glsdescwidth}}}%
{\end{longtable}}%
\renewcommand*{\glossaryheader}{}%
\renewcommand*{\glsgroupheading}[1]{}%
\renewcommand*{\glossaryentryfield}[5]{%
\glsentryitem{##1}% Entry number if required
\bfseries\glstarget{##1}{##2}% Name
\\% end of row
}%
\renewcommand*{\glossarysubentryfield}[6]{%
\glstarget{##2}{##3}% Name
& \glsentryuseri{##2}% Units
& ##4% Description
\\% end of row
}%
\renewcommand*{\glsgroupskip}{\\}%
}
% Gruppen:
\newglossaryentry{abbreviation}{name={Abbreviations},description={dummy}}
\newglossaryentry{latin}{name={Latin Symbols},description={dummy}}
\newglossaryentry{greek}{name={Greek Symbols},description={dummy}}
% \nomenclature[Gruppe]{ID}{Symbol}{Beschreibung}{Einheit}
\nomenclature[G]{alpha}{$\alpha$}{Angle}{\si\degree}
\nomenclature[L]{V}{$V$}{Volume}{\si{\cubic\metre}}
\nomenclature[A]{UN}{UN}{
The United Nations (abbreviated UN in English, and ONU in French and Spanish),
is an international organization whose stated aims are facilitating cooperation
in international law, international security, economic development, social progress,
human rights, and achievement of world peace.
}{}
\nomenclature[L]{U}{$U$}{Voltage}{\si{\volt}}
\makeglossaries
\glossarystyle{nomenclature}
\begin{document}
\glsaddall
\printglossaries
\end{document}
Grüße
Da mein Vorschlag keine echte Tabelle verwendet sondern nur so tut als ob, wäre damit eine Lösung nur umständlich möglich. Eine wesentlich sauberere und flexiblere Lösung wäre es, auf das Paket [url=http://www.ctan.org/pkg/glossaries]glossaries[/url] umzusteigen.
Damit würde ich beispielsweise folgende Lösung vorschlagen:
[code]% arara: pdflatex
% arara: makeglossaries
% arara: pdflatex
\documentclass{scrartcl}
\usepackage{siunitx}
\usepackage{glossaries,longtable}
% für die Bequemlichkeit einen \nomenclature Befehl:
\newcommand*\nomenclature[5][A]{%
\ifx#1A\relax
\newglossaryentry{#2}{
name={#3} ,
description={#4} ,
sort={#2} ,
user1 = {#5} ,
parent={abbreviation}
}
\fi
\ifx#1L\relax
\newglossaryentry{#2}{
name={#3} ,
description={#4} ,
sort={#2} ,
user1 = {\unexpanded{#5}} ,
parent={latin}
}
\fi
\ifx#1G\relax
\newglossaryentry{#2}{
name={#3} ,
description={#4} ,
sort={#2} ,
user1 = {\unexpanded{#5}} ,
parent={greek}
}
\fi
}
% einen neuen glossary-Style zur persönlichen Anpassung
\newglossarystyle{nomenclature}{%
\renewenvironment{theglossary}%
{\begin{longtable}{llp{\glsdescwidth}}}%
{\end{longtable}}%
\renewcommand*{\glossaryheader}{}%
\renewcommand*{\glsgroupheading}[1]{}%
\renewcommand*{\glossaryentryfield}[5]{%
\glsentryitem{##1}% Entry number if required
\bfseries\glstarget{##1}{##2}% Name
\\% end of row
}%
\renewcommand*{\glossarysubentryfield}[6]{%
\glstarget{##2}{##3}% Name
& \glsentryuseri{##2}% Units
& ##4% Description
\\% end of row
}%
\renewcommand*{\glsgroupskip}{\\}%
}
% Gruppen:
\newglossaryentry{abbreviation}{name={Abbreviations},description={dummy}}
\newglossaryentry{latin}{name={Latin Symbols},description={dummy}}
\newglossaryentry{greek}{name={Greek Symbols},description={dummy}}
% \nomenclature[Gruppe]{ID}{Symbol}{Beschreibung}{Einheit}
\nomenclature[G]{alpha}{$\alpha$}{Angle}{\si\degree}
\nomenclature[L]{V}{$V$}{Volume}{\si{\cubic\metre}}
\nomenclature[A]{UN}{UN}{
The United Nations (abbreviated UN in English, and ONU in French and Spanish),
is an international organization whose stated aims are facilitating cooperation
in international law, international security, economic development, social progress,
human rights, and achievement of world peace.
}{}
\nomenclature[L]{U}{$U$}{Voltage}{\si{\volt}}
\makeglossaries
\glossarystyle{nomenclature}
\begin{document}
\glsaddall
\printglossaries
\end{document}[/code]
Grüße