PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Probleme mit hyperref oder ref in LaTeX-basierter API



damue
24-04-2007, 14:35
Hallo,
ich bin ein Newbie, wie man so schön sagt. Ich habe lange gekämpft und gelesen, aber jetzt ist leider schluß.

Mein Problem:
Ich erstelle via XSLT ein TEX-Dokument. Das TEX-Dokument stellt eine API dar, in der zwischen den Element hin und her gesprungen werden soll.

Bsp in TEX:

\label{A} Knoten A: hat Vater \hyperref[B]{B} und Kinder \hyperref[C]{C} und \hyperref[D]{D}

\label{C} Knoten C: hat Vater \hyperref[A]{A} und Kinder \hyperref[E]{E} und \hyperref[F]{F}

usw.

Die Verlinkung lässt sich einwandfrei "compilieren", doch klappt's dann dennoch nicht. Jeder Link springt an den Kapitelanfang und nicht zur Labelpos im Text.

Hier mein Minimalbeispiel:


\documentclass[12pt,a4paper]{scrreprt} %Für Diplomarbeiten geeignet
\usepackage{ngerman}
\usepackage[ngerman]{babel} % mehrsprachiger Textsatz, hier neue deutsche Rechtschreibung
\usepackage[latin1]{inputenc} % verwendeter Zeichensatz für Eingabe
\usepackage[babel,german=quotes]{csquotes} % Deutsche Anführungszeichen
\usepackage{color} % Ermöglicht farbigen Text
\usepackage{xspace} % Ermöglicht korrekten Leerraum nach Befehlen
\usepackage{amssymb} % Symbolpaket
\usepackage{ifthen} % Paket für if-then-else Test
\usepackage{hyperref} % ermöglicht das Springen innerhalb des Dokuments -> Tutorial unter

% -----------------------------------------------------------------------
% -----------------------------------------------------------------------
% -----------------------------------------------------------------------
% -----------------------------------------------------------------------

\definecolor{attributeGroupBGColor}{gray}{0.95}

% ------------------------------------------------------------------
% Eigene Formatvorlagen -> bitte nur diese ändern (vgl. CSS bei HTML)

% oberer Abstand zwischen Linie und Text
\newcommand{\marginTop}{\vspace{1.5mm}}
\newcommand{\newTextWidth}{ \hsize }

% eingerückte ParBox
\newcommand{\indentParbox}[1]{ % erwartet Namen und LabelID
\vspace{0mm}%
\begin{minipage}{0.1\linewidth} ~ \end{minipage}%
\begin{minipage}{0.9\linewidth}%
\colorbox{white}{\parbox{\newTextWidth}{\textcolor {black}{#1}}}%
\end{minipage}%
}


% Box für die Darstellung der zu dokumentierenden Elements
\newcommand{\nodeOut}[1]{ % erwartet Namen und LabelID
\vspace{5mm}%
\colorbox{white}{\parbox{\hsize}{\textcolor{black} {\hrule height 0.5mm \marginTop%
\bfseries%
#1%
\hfill \tiny \hyperref[LabelofROOT]{top}}}}
}

% Box für die Darstellung der möglichen Elternknoten
\newcommand{\parentOut}[1]{ % erwartet Namen und LabelID
\vspace{0mm}
\indentParbox{%
\hrule height 0.1mm \marginTop%
\bfseries%
Parentelement(s): %
\mdseries%
\ifthenelse{\equal{#1}{ }}{$ \varnothing $}{#1}%
}}

% Box für die Darstellung der möglichen Kindknoten
\newcommand{\childrenOut}[1]{ % erwartet Namen und LabelID
\vspace{0mm}
\indentParbox{%
\hrule height 0.1mm \marginTop%
\bfseries%
Childelement(s): %
\mdseries%
\ifthenelse{\equal{#1}{ }}{$ \varnothing $}{#1}%
}}

% Box für die Darstellung der AttributeGruppen
\newcommand{\attributeGroupOut}[1]{ % erwartet Namen und LabelID
\vspace{0mm}
\indentParbox{%
\hrule height 0.1mm \marginTop%
\bfseries%
AttributeGroups: %
\mdseries%
\ifthenelse{\equal{#1}{ }}{$ \varnothing $}{#1}%
}}


% Box für die Darstellung der Attribute
\newcommand{\attributeOut}[1]{ % erwartet Namen und LabelID
\vspace{0mm}
\indentParbox{%
\hrule height 0.1mm \marginTop%
\bfseries%
Attribute: %
\mdseries%
\ifthenelse{\equal{#1}{ }}{$ \varnothing $}{#1}%
}}

% ------------------------------------------------------------------
% ------------------------------------------------------------------

\begin{document}


\chapter{Anhangname} \label{anhang1}

\section{Quellcodes}

\subsubsection{CDISC ODM Documentation}


% Automatisch generierte ODM-Doku



\label{LabelofROOT}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'ODM'

\normalsize
\nodeOut{ \label{ODM} ODM}
\footnotesize\parentOut{ \hyperref[ODM]{ODM}}

\childrenOut{
\hyperref[AdminData]{AdminData}
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'AdminData'

\normalsize
\nodeOut{ \label{AdminData} AdminData}
\footnotesize\parentOut{ \hyperref[ODM]{ODM}}

\childrenOut{
\hyperref[Location]{Location}\textsuperscript{*}
\hyperref[SignatureDef]{SignatureDef}\textsuperscript{*}
\hyperref[User]{User}\textsuperscript{*}
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'Location'

\normalsize
\nodeOut{ \label{Location} Location}
\footnotesize\parentOut{ \hyperref[AdminData]{AdminData}}

\childrenOut{
\hyperref[MetaDataVersionRef]{MetaDataVersionRef}
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'MetaDataVersionRef'

\normalsize
\nodeOut{ \label{MetaDataVersionRef} MetaDataVersionRef}
\footnotesize\parentOut{ \hyperref[Location]{Location}}

\childrenOut{
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'SignatureDef'

\normalsize
\nodeOut{ \label{SignatureDef} SignatureDef}
\footnotesize\parentOut{ \hyperref[AdminData]{AdminData}}

\childrenOut{
\hyperref[LegalReason]{LegalReason}
\hyperref[Meaning]{Meaning}
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'LegalReason'

\normalsize
\nodeOut{ \label{LegalReason} LegalReason}
\footnotesize\parentOut{ \hyperref[SignatureDef]{SignatureDef}}

\childrenOut{
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'Meaning'

\normalsize
\nodeOut{ \label{Meaning} Meaning}
\footnotesize\parentOut{ \hyperref[SignatureDef]{SignatureDef}}

\childrenOut{
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'User'

\normalsize
\nodeOut{ \label{User} User}
\footnotesize\parentOut{ \hyperref[AdminData]{AdminData}}

\childrenOut{
\hyperref[Address]{Address}\textsuperscript{*}
\hyperref[Certificate]{Certificate}\textsuperscript{*}
\hyperref[DisplayName]{DisplayName}
\hyperref[Email]{Email}\textsuperscript{*}
\hyperref[Fax]{Fax}\textsuperscript{*}
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'Address'

\normalsize
\nodeOut{ \label{Address} Address}
\footnotesize\parentOut{ \hyperref[User]{User}}

\childrenOut{
\hyperref[City]{City}
\hyperref[Country]{Country}
\hyperref[OtherText]{OtherText}
\hyperref[PostalCode]{PostalCode}
\hyperref[StateProv]{StateProv}
\hyperref[StreetName]{StreetName}\textsuperscript{*}
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'City'

\normalsize
\nodeOut{ \label{City} City}
\footnotesize\parentOut{ \hyperref[Address]{Address}}

\childrenOut{
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'Country'

\normalsize
\nodeOut{ \label{Country} Country}
\footnotesize\parentOut{ \hyperref[Address]{Address}}

\childrenOut{
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'OtherText'

\normalsize
\nodeOut{ \label{OtherText} OtherText}
\footnotesize\parentOut{ \hyperref[Address]{Address}}

\childrenOut{
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'PostalCode'

\normalsize
\nodeOut{ \label{PostalCode} PostalCode}
\footnotesize\parentOut{ \hyperref[Address]{Address}}

\childrenOut{
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'StateProv'

\normalsize
\nodeOut{ \label{StateProv} StateProv}
\footnotesize\parentOut{ \hyperref[Address]{Address}}

\childrenOut{
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'StreetName'

\normalsize
\nodeOut{ \label{StreetName} StreetName}
\footnotesize\parentOut{ \hyperref[Address]{Address}}

\childrenOut{
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'Certificate'

\normalsize
\nodeOut{ \label{Certificate} Certificate}
\footnotesize\parentOut{ \hyperref[User]{User}}

\childrenOut{
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'DisplayName'

\normalsize
\nodeOut{ \label{DisplayName} DisplayName}
\footnotesize\parentOut{ \hyperref[User]{User}}

\childrenOut{
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'Email'

\normalsize
\nodeOut{ \label{Email} Email}
\footnotesize\parentOut{ \hyperref[User]{User}}

\childrenOut{
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'Fax'

\normalsize
\nodeOut{ \label{Fax} Fax}
\footnotesize\parentOut{ \hyperref[User]{User}}

\childrenOut{
}

\end{document}


Mein Wunsch:
Ich bin auf der Suche nach einer Möglichkeit eine API mit (vielen) Querverweisen in LaTeX zu schreiben/generieren.

Bin für jede Hilfe dankbar.
VG Daniel

countbela666
24-04-2007, 15:20
Hallo, Daniel,

jedes Label, das du setzt, muss an einen Zähler gebunden sein. Wenn du im Text mehrere \label-Befehle wild durch- und hintereinandersetzt, werden alle dasselbe Sprungziel haben, nämlich den zuletzt veränderten Zähler, in deinem Fall scheinbar das aktuelle Kapitel.

Für deine Einsatz ist \label schlicht und ergreifend ungeeignet -- es sein denn, du würdest dir einen eigenen Befehl basteln wollen, der bei jedem Knoten mit dem zu setzenden Label auch einen eigenen Zähler manipuliert. Brauchst du aber nicht, denn dafür gibt's den hyperref-Befehl \hypertarget:

\documentclass{scrartcl}
\usepackage{hyperref}
\begin{document}
\hypertarget{A}{Knoten A}: hat Kinder \hyperlink{B}{B} und \hyperlink{C}{C}\par
\hypertarget{B}{Knoten B}: hat Vater \hyperlink{A}{A}\par
\hypertarget{C}{Knoten C}: hat Vater \hyperlink{A}{A}
\end{document}Grüße
Marcel

damue
25-04-2007, 10:28
Toll! Danke.

Ich habe mich gleich herangesetzt und konnte alles unter "Laborbedingungen" nachvollziehen. Danke.

Leider bekomme ich nun in meinem richtigen Dokument eine Serie von Fehlermeldungen:



! Undefined control sequence.
\hyper@@link ->\let \Hy@reserved@a
\relax \@ifnextchar [{\hyper@link@ }{\hyp...
1.115 ... notesize\parentOut{ \hyperlink{ODM}{ODM}}


! Argument of \hyper@link@ has an extra }.
<inserted text>
\par
1.115 ... notesize\parentOut{ \hyperlink{ODM}{ODM}}

.
.
.



Mir ist bei meiner Recherche untergekommen, dass der 2. Fehler häufig auf "zerbrechliche" Befehle zurückgeht. Aber eine Lösung fällt mir deswegen auch nicht ein. :confused:
Ich habe Sorge, dass das mit meinen eigenen WrapperCommands zusammenhängt. Sie sollen mir als "CSS" dienen.

Hier das neue Minimalbeispiel:


\documentclass[12pt,a4paper]{scrreprt} %Für Diplomarbeiten geeignet
\usepackage{ngerman}
\usepackage[ngerman]{babel} % mehrsprachiger Textsatz, hier neue deutsche Rechtschreibung
\usepackage[latin1]{inputenc} % verwendeter Zeichensatz für Eingabe
\usepackage[babel,german=quotes]{csquotes} % Deutsche Anführungszeichen
\usepackage{color} % Ermöglicht farbigen Text
\usepackage{xspace} % Ermöglicht korrekten Leerraum nach Befehlen
\usepackage{amssymb} % Symbolpaket
\usepackage{ifthen} % Paket für if-then-else Test
\usepackage{hyperref} % ermöglicht das Springen innerhalb des Dokuments -> Tutorial unter

% -----------------------------------------------------------------------
% -----------------------------------------------------------------------
% -----------------------------------------------------------------------
% -----------------------------------------------------------------------

\definecolor{attributeGroupBGColor}{gray}{0.95}

% ------------------------------------------------------------------
% Eigene Formatvorlagen -> bitte nur diese ändern (vgl. CSS bei HTML)

% oberer Abstand zwischen Linie und Text
\newcommand{\marginTop}{\vspace{1.5mm}}
\newcommand{\newTextWidth}{ \hsize }

% eingerückte ParBox
\newcommand{\indentParbox}[1]{ % erwartet Namen und LabelID
\vspace{0mm}%
\begin{minipage}{0.1\linewidth} ~ \end{minipage}%
\begin{minipage}{0.9\linewidth}%
\colorbox{white}{\parbox{\newTextWidth}{\textcolor {black}{#1}}}%
\end{minipage}%
}


% Box für die Darstellung der zu dokumentierenden Elements
\newcommand{\nodeOut}[1]{ % erwartet Namen und LabelID
\vspace{5mm}%
\colorbox{white}{\parbox{\hsize}{\textcolor{black} {\hrule height 0.5mm \marginTop%
\bfseries%
#1%
\hfill \tiny \hyperlink{LabelofROOT}{top}}}}
}

% Box für die Darstellung der möglichen Elternknoten
\newcommand{\parentOut}[1]{ % erwartet Namen und LabelID
\vspace{0mm}
\indentParbox{%
\hrule height 0.1mm \marginTop%
\bfseries%
Parentelement(s): %
\mdseries%
\ifthenelse{\equal{#1}{ }}{$ \varnothing $}{#1}%
}}

% Box für die Darstellung der möglichen Kindknoten
\newcommand{\childrenOut}[1]{ % erwartet Namen und LabelID
\vspace{0mm}
\indentParbox{%
\hrule height 0.1mm \marginTop%
\bfseries%
Childelement(s): %
\mdseries%
\ifthenelse{\equal{#1}{ }}{$ \varnothing $}{#1}%
}}

% Box für die Darstellung der AttributeGruppen
\newcommand{\attributeGroupOut}[1]{ % erwartet Namen und LabelID
\vspace{0mm}
\indentParbox{%
\hrule height 0.1mm \marginTop%
\bfseries%
AttributeGroups: %
\mdseries%
\ifthenelse{\equal{#1}{ }}{$ \varnothing $}{#1}%
}}


% Box für die Darstellung der Attribute
\newcommand{\attributeOut}[1]{ % erwartet Namen und LabelID
\vspace{0mm}
\indentParbox{%
\hrule height 0.1mm \marginTop%
\bfseries%
Attribute: %
\mdseries%
\ifthenelse{\equal{#1}{ }}{$ \varnothing $}{#1}%
}}

% ------------------------------------------------------------------
% ------------------------------------------------------------------

\begin{document}


\chapter{Anhangname} \hypertarget{anhang1}{}

\section{Quellcodes}

\subsubsection{CDISC ODM Documentation}


% Automatisch generierte ODM-Doku



\hypertarget{LabelofROOT}{}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'ODM'

\normalsize
\nodeOut{ \hypertarget{ODM}{ODM}}
\footnotesize\parentOut{ \hyperlink{ODM}{ODM}}

\childrenOut{
\hyperlink{AdminData}{AdminData}
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'AdminData'

\normalsize
\nodeOut{ \hypertarget{AdminData}{AdminData}}
\footnotesize\parentOut{ \hyperlink{ODM}{ODM}}

\childrenOut{
\hyperlink{Location}{Location}\textsuperscript{*}
\hyperlink{SignatureDef}{SignatureDef}\textsupersc ript{*}
\hyperlink{User}{User}\textsuperscript{*}
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'Location'

\normalsize
\nodeOut{ \hypertarget{Location}{Location}
\footnotesize\parentOut{ \hyperlink{AdminData}{AdminData}}

\childrenOut{
\hyperlink{MetaDataVersionRef}{MetaDataVersionRef}
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'MetaDataVersionRef'

\normalsize
\nodeOut{ \hypertarget{MetaDataVersionRef}{MetaDataVersionRe f}}
\footnotesize\parentOut{ \hyperlink{Location}{Location}}

\childrenOut{
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'SignatureDef'

\normalsize
\nodeOut{ \hypertarget{SignatureDef}{SignatureDef} }
\footnotesize\parentOut{ \hyperlink{AdminData}{AdminData}}

\childrenOut{
\hyperlink{LegalReason}{LegalReason}
\hyperlink{Meaning}{Meaning}
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'LegalReason'

\normalsize
\nodeOut{ \hypertarget{LegalReason}{LegalReason}}
\footnotesize\parentOut{ \hyperlink{SignatureDef}{SignatureDef}}

\childrenOut{
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'Meaning'

\normalsize
\nodeOut{ \hypertarget{Meaning}{Meaning}}
\footnotesize\parentOut{ \hyperlink{SignatureDef}{SignatureDef}}

\childrenOut{
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'User'

\normalsize
\nodeOut{ \hypertarget{User}{User}}
\footnotesize\parentOut{ \hyperlink{AdminData}{AdminData}}

\childrenOut{
\hyperlink{Address}{Address}\textsuperscript{*}
\hyperlink{Certificate]{Certificate}\textsuperscript{*}
\hyperlink{DisplayName]{DisplayName}
\hyperlink{Email}{Email}\textsuperscript{*}
\hyperlink{Fax}{Fax}\textsuperscript{*}
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'Address'

\normalsize
\nodeOut{ \hypertarget{Address}{Address}}
\footnotesize\parentOut{ \hyperlink{User}{User}}

\childrenOut{
\hyperlink{City}{City}
\hyperlink{Country}{Country}
\hyperlink{OtherText}{OtherText}
\hyperlink{PostalCode}{PostalCode}
\hyperlink{StateProv}{StateProv}
\hyperlink{StreetName}{StreetName}\textsuperscript {*}
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'City'

\normalsize
\nodeOut{ \hypertarget{City}{City}}
\footnotesize\parentOut{ \hyperlink{Address}{Address}}

\childrenOut{
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'Country'

\normalsize
\nodeOut{ \hypertarget{Country}{Country}}
\footnotesize\parentOut{ \hyperlink{Address}{Address}}

\childrenOut{
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'OtherText'

\normalsize
\nodeOut{ \hypertarget{OtherText}{OtherText}}
\footnotesize\parentOut{ \hyperlink{Address}{Address}}

\childrenOut{
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'PostalCode'

\normalsize
\nodeOut{ \hypertarget{PostalCode}{PostalCode}}
\footnotesize\parentOut{ \hyperlink{Address}{Address}}

\childrenOut{
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'StateProv'

\normalsize
\nodeOut{ \hypertarget{StateProv}{StateProv}}
\footnotesize\parentOut{ \hyperlink{Address}{Address}}

\childrenOut{
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'StreetName'

\normalsize
\nodeOut{ \hypertarget{StreetName}{StreetName}}
\footnotesize\parentOut{ \hyperlink{Address}{Address}}

\childrenOut{
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'Certificate'

\normalsize
\nodeOut{ \hypertarget{Certificate}{Certificate}}
\footnotesize\parentOut{ \hyperlink{User}{User}}

\childrenOut{
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'DisplayName'

\normalsize
\nodeOut{ \hypertarget{DisplayName}{DisplayName}}
\footnotesize\parentOut{ \hyperlink{User}{User}}

\childrenOut{
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'Email'

\normalsize
\nodeOut{ \hypertarget{Email}{Email}}
\footnotesize\parentOut{ \hyperlink{User}{User}}

\childrenOut{
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'Fax'

\normalsize
\nodeOut{ \hypertarget{Fax}{Fax}}
\footnotesize\parentOut{ \hyperlink{User}{User}}

\childrenOut{
}

\end{document}


Vielen Dank, für die weitere Hilfe.

VG Daniel

countbela666
25-04-2007, 11:13
Hallo, Daniel,

wie du schon richtig erkannt hast, sind die Befehle \hyperlink und \hypertarget zerbrechlich und dürfen nicht einfach als Parameter anderer Befehle verwendet werden, ohne dass sie durch \protect geschützt werden. Du kannst also vor jeden der beiden Befehle ein \protect schreiben, oder folgenden Code ausprobieren:

\documentclass[12pt,a4paper]{scrreprt} %Für Diplomarbeiten geeignet
%\usepackage{ngerman} %% Humbug, du nutzt schon babel
\usepackage[ngerman]{babel} % mehrsprachiger Textsatz, hier neue deutsche Rechtschreibung
\usepackage[latin1]{inputenc} % verwendeter Zeichensatz für Eingabe
\usepackage[babel,german=quotes]{csquotes} % Deutsche Anführungszeichen
\usepackage{color} % Ermöglicht farbigen Text
\usepackage{xspace} % Ermöglicht korrekten Leerraum nach Befehlen
\usepackage{amssymb} % Symbolpaket
\usepackage{ifthen} % Paket für if-then-else Test
\usepackage{hyperref} % ermöglicht das Springen innerhalb des Dokuments -> Tutorial unter

\let\orighlink\hyperlink
\let\orightarget\hypertarget
\def\hyperlink#1#2{\protect\orighlink{#1}{#2}}
\def\hypertarget#1#2{\protect\orightarget{#1}{#2}}

% -----------------------------------------------------------------------
% -----------------------------------------------------------------------
% -----------------------------------------------------------------------
% -----------------------------------------------------------------------

\definecolor{attributeGroupBGColor}{gray}{0.95}

% ------------------------------------------------------------------
% Eigene Formatvorlagen -> bitte nur diese ändern (vgl. CSS bei HTML)

% oberer Abstand zwischen Linie und Text
\newcommand{\marginTop}{\vspace{1.5mm}}
\newcommand{\newTextWidth}{ \hsize }

% eingerückte ParBox
\newcommand{\indentParbox}[1]{ % erwartet Namen und LabelID
\vspace{0mm}%
\begin{minipage}{0.1\linewidth} ~ \end{minipage}%
\begin{minipage}{0.9\linewidth}%
\colorbox{white}{\parbox{\newTextWidth}{\textcolor {black}{#1}}}%
\end{minipage}%
}


% Box für die Darstellung der zu dokumentierenden Elements
\newcommand{\nodeOut}[1]{ % erwartet Namen und LabelID
\vspace{5mm}%
\colorbox{white}{\parbox{\hsize}{\textcolor{black} {\hrule height 0.5mm \marginTop%
\bfseries%
#1%
\hfill \tiny \hyperlink{LabelofROOT}{top}}}}
}

% Box für die Darstellung der möglichen Elternknoten
\newcommand{\parentOut}[1]{ % erwartet Namen und LabelID
\vspace{0mm}
\indentParbox{%
\hrule height 0.1mm \marginTop%
\bfseries%
Parentelement(s): %
\mdseries%
\ifthenelse{\equal{#1}{ }}{$ \varnothing $}{#1}%
}}

% Box für die Darstellung der möglichen Kindknoten
\newcommand{\childrenOut}[1]{ % erwartet Namen und LabelID
\vspace{0mm}
\indentParbox{%
\hrule height 0.1mm \marginTop%
\bfseries%
Childelement(s): %
\mdseries%
\ifthenelse{\equal{#1}{ }}{$ \varnothing $}{#1}%
}}

% Box für die Darstellung der AttributeGruppen
\newcommand{\attributeGroupOut}[1]{ % erwartet Namen und LabelID
\vspace{0mm}
\indentParbox{%
\hrule height 0.1mm \marginTop%
\bfseries%
AttributeGroups: %
\mdseries%
\ifthenelse{\equal{#1}{ }}{$ \varnothing $}{#1}%
}}


% Box für die Darstellung der Attribute
\newcommand{\attributeOut}[1]{ % erwartet Namen und LabelID
\vspace{0mm}
\indentParbox{%
\hrule height 0.1mm \marginTop%
\bfseries%
Attribute: %
\mdseries%
\ifthenelse{\equal{#1}{ }}{$ \varnothing $}{#1}%
}}

% ------------------------------------------------------------------
% ------------------------------------------------------------------

\begin{document}


\chapter{Anhangname} \hypertarget{anhang1}{}

\section{Quellcodes}

\subsubsection{CDISC ODM Documentation}


% Automatisch generierte ODM-Doku



\hypertarget{LabelofROOT}{}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'ODM'

\normalsize
\nodeOut{ \hypertarget{ODM}{ODM}}
\footnotesize\parentOut{ \hyperlink{ODM}{ODM}}

\childrenOut{
\hyperlink{AdminData}{AdminData}
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'AdminData'

\normalsize
\nodeOut{ \hypertarget{AdminData}{AdminData}}
\footnotesize\parentOut{ \hyperlink{ODM}{ODM}}

\childrenOut{
\hyperlink{Location}{Location}\textsuperscript{*}
\hyperlink{SignatureDef}{SignatureDef}\textsupersc ript{*}
\hyperlink{User}{User}\textsuperscript{*}
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'Location'

\normalsize
\nodeOut{ \hypertarget{Location}{Location} } %<-----------------------------------
\footnotesize\parentOut{ \hyperlink{AdminData}{AdminData}}

\childrenOut{
\hyperlink{MetaDataVersionRef}{MetaDataVersionRef}
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'MetaDataVersionRef'

\normalsize
\nodeOut{ \hypertarget{MetaDataVersionRef}{MetaDataVersionRe f}}
\footnotesize\parentOut{ \hyperlink{Location}{Location}}

\childrenOut{
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'SignatureDef'

\normalsize
\nodeOut{ \hypertarget{SignatureDef}{SignatureDef} }
\footnotesize\parentOut{ \hyperlink{AdminData}{AdminData}}

\childrenOut{
\hyperlink{LegalReason}{LegalReason}
\hyperlink{Meaning}{Meaning}
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'LegalReason'

\normalsize
\nodeOut{ \hypertarget{LegalReason}{LegalReason}}
\footnotesize\parentOut{ \hyperlink{SignatureDef}{SignatureDef}}

\childrenOut{
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'Meaning'

\normalsize
\nodeOut{ \hypertarget{Meaning}{Meaning}}
\footnotesize\parentOut{ \hyperlink{SignatureDef}{SignatureDef}}

\childrenOut{
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'User'

\normalsize
\nodeOut{ \hypertarget{User}{User}}
\footnotesize\parentOut{ \hyperlink{AdminData}{AdminData}}

\childrenOut{
\hyperlink{Address}{Address}\textsuperscript{*}
\hyperlink{Certificate}{Certificate}\textsuperscri pt{*} %<-----------------------
\hyperlink{DisplayName}{DisplayName} %<-----------------------
\hyperlink{Email}{Email}\textsuperscript{*}
\hyperlink{Fax}{Fax}\textsuperscript{*}
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'Address'

\normalsize
\nodeOut{ \hypertarget{Address}{Address}}
\footnotesize\parentOut{ \hyperlink{User}{User}}

\childrenOut{
\hyperlink{City}{City}
\hyperlink{Country}{Country}
\hyperlink{OtherText}{OtherText}
\hyperlink{PostalCode}{PostalCode}
\hyperlink{StateProv}{StateProv}
\hyperlink{StreetName}{StreetName}\textsuperscript {*}
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'City'

\normalsize
\nodeOut{ \hypertarget{City}{City}}
\footnotesize\parentOut{ \hyperlink{Address}{Address}}

\childrenOut{
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'Country'

\normalsize
\nodeOut{ \hypertarget{Country}{Country}}
\footnotesize\parentOut{ \hyperlink{Address}{Address}}

\childrenOut{
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'OtherText'

\normalsize
\nodeOut{ \hypertarget{OtherText}{OtherText}}
\footnotesize\parentOut{ \hyperlink{Address}{Address}}

\childrenOut{
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'PostalCode'

\normalsize
\nodeOut{ \hypertarget{PostalCode}{PostalCode}}
\footnotesize\parentOut{ \hyperlink{Address}{Address}}

\childrenOut{
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'StateProv'

\normalsize
\nodeOut{ \hypertarget{StateProv}{StateProv}}
\footnotesize\parentOut{ \hyperlink{Address}{Address}}

\childrenOut{
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'StreetName'

\normalsize
\nodeOut{ \hypertarget{StreetName}{StreetName}}
\footnotesize\parentOut{ \hyperlink{Address}{Address}}

\childrenOut{
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'Certificate'

\normalsize
\nodeOut{ \hypertarget{Certificate}{Certificate}}
\footnotesize\parentOut{ \hyperlink{User}{User}}

\childrenOut{
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'DisplayName'

\normalsize
\nodeOut{ \hypertarget{DisplayName}{DisplayName}}
\footnotesize\parentOut{ \hyperlink{User}{User}}

\childrenOut{
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'Email'

\normalsize
\nodeOut{ \hypertarget{Email}{Email}}
\footnotesize\parentOut{ \hyperlink{User}{User}}

\childrenOut{
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%
% Erzeuge Beschreibung fuer den Knoten 'Fax'

\normalsize
\nodeOut{ \hypertarget{Fax}{Fax}}
\footnotesize\parentOut{ \hyperlink{User}{User}}

\childrenOut{
}

\end{document}(ein paar andere Fehler hab ich dir auch mal korrigiert)

Grüße
Marcel

damue
25-04-2007, 13:59
Danke.

Ich könnte Dich knutschen.
Ich werde mich Stück für Stück im Minimalbeispiel durcharbeiten, um Deine Verbesserungen und LaTeX besser zu verstehen.

VG Daniel