von V00d00 » Sa 1. Feb 2014, 14:59
Also folgendes Minibeispiel funktioniert, wenn ich es aus dem anderen Forum komplett übernehme und in eine neue .tex Datei einfüge und kompiliere wunderbar.
\documentclass[a4paper,10pt]{article}
\usepackage{glossaries}
\makeglossaries
\newglossaryentry{A}{%
name={foo},%
description={bar},%
user1={cm}%
}
\newglossaryentry{B}{%
name={AAPL},%
description={apples},%
user1={box}%
}
\newglossaryentry{C}{%
name={BTR},%
description={books to read},%
user1={LoC}%
}
\newglossaryentry{D}{%
name={BTRTIO},%
description={books to read that I own},%
user1={shelf},%
parent={C}
}
\newglossarystyle{aiaostyle}{%
% put the glossary in a longtable environment:
\renewenvironment{theglossary}%
{\begin{longtable}{lp{\glsdescwidth}cp{\glspagelistwidth}}}%
{\end{longtable}}%
% Set the table’s header: title row
\renewcommand*{\glossaryheader}{%
\bfseries Term & \bfseries Description &
\bfseries Units & \bfseries Page List
\\\endhead}%
% No table header:
\renewcommand*{\glossaryheader}{}%
% No heading between groups:
\renewcommand*{\glsgroupheading}[1]{}%
% Main (level 0) entries displayed in a row optionally numbered:
\renewcommand*{\glossaryentryfield}[5]{%
\glstarget{##1}{##2}% Name
& ##3% Description
& \glsentryuseri{##1}% Units
& ##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
& \glsentryuseri{##2}% Units
& ##6% Page list
\\% end of row
}%
% Nothing between groups:
\renewcommand*{\glsgroupskip}{}%
}
\begin{document}
\null
\glsaddall
\glossarystyle{aiaostyle}
\setlength{\glsdescwidth}{0.5\textwidth}
\setlength{\glspagelistwidth}{0.1\textwidth}
\printglossary
\end{document}
Ich möchte gerne den mittleren Teil zwischen \newglossarystyle{aiaostyle} und \begin{document} auslagern in eine andere Datei. Wie muss ich das machen? Ich habe einfach den mittleren Teil in eine neue Datei kopiert und diese dann als aiaostyle.sty gespeichert in demselben Ordner ohne Unterverzeichnisse.
Ich bekomme jedoch folgende Fehlermeldung
! Package glossaries Error: Glossary style `aiaostyle' undefined.
See the glossaries package documentation for explanation.
Type H <return> for immediate help.
...
l.34 \glossarystyle{aiaostyle}
?
Ich will mich jetzt langsam an den Fehler heranschleichen und das Schritt für Schritt optimieren.
Also folgendes Minibeispiel funktioniert, wenn ich es aus dem anderen Forum komplett übernehme und in eine neue .tex Datei einfüge und kompiliere wunderbar.
[code]\documentclass[a4paper,10pt]{article}
\usepackage{glossaries}
\makeglossaries
\newglossaryentry{A}{%
name={foo},%
description={bar},%
user1={cm}%
}
\newglossaryentry{B}{%
name={AAPL},%
description={apples},%
user1={box}%
}
\newglossaryentry{C}{%
name={BTR},%
description={books to read},%
user1={LoC}%
}
\newglossaryentry{D}{%
name={BTRTIO},%
description={books to read that I own},%
user1={shelf},%
parent={C}
}
\newglossarystyle{aiaostyle}{%
% put the glossary in a longtable environment:
\renewenvironment{theglossary}%
{\begin{longtable}{lp{\glsdescwidth}cp{\glspagelistwidth}}}%
{\end{longtable}}%
% Set the table’s header: title row
\renewcommand*{\glossaryheader}{%
\bfseries Term & \bfseries Description &
\bfseries Units & \bfseries Page List
\\\endhead}%
% No table header:
\renewcommand*{\glossaryheader}{}%
% No heading between groups:
\renewcommand*{\glsgroupheading}[1]{}%
% Main (level 0) entries displayed in a row optionally numbered:
\renewcommand*{\glossaryentryfield}[5]{%
\glstarget{##1}{##2}% Name
& ##3% Description
& \glsentryuseri{##1}% Units
& ##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
& \glsentryuseri{##2}% Units
& ##6% Page list
\\% end of row
}%
% Nothing between groups:
\renewcommand*{\glsgroupskip}{}%
}
\begin{document}
\null
\glsaddall
\glossarystyle{aiaostyle}
\setlength{\glsdescwidth}{0.5\textwidth}
\setlength{\glspagelistwidth}{0.1\textwidth}
\printglossary
\end{document}[/code]
Ich möchte gerne den mittleren Teil zwischen \newglossarystyle{aiaostyle} und \begin{document} auslagern in eine andere Datei. Wie muss ich das machen? Ich habe einfach den mittleren Teil in eine neue Datei kopiert und diese dann als aiaostyle.sty gespeichert in demselben Ordner ohne Unterverzeichnisse.
Ich bekomme jedoch folgende Fehlermeldung
[code]! Package glossaries Error: Glossary style `aiaostyle' undefined.
See the glossaries package documentation for explanation.
Type H <return> for immediate help.
...
l.34 \glossarystyle{aiaostyle}
?[/code]
[url=http://rghost.net/52122509.view][img]http://rghost.net/52122509/thumb.png[/img][/url]
Ich will mich jetzt langsam an den Fehler heranschleichen und das Schritt für Schritt optimieren.