Referenz auf Appendix ergibt falschen Namen

Inhalt, Abbildungen, Tabellen, Quellcodes und andere Verzeichnisse


BlackDevil
Forum-Century
Forum-Century
Beiträge: 107
Registriert: Di 23. Jul 2013, 11:38
Wohnort: Deutschland

Referenz auf Appendix ergibt falschen Namen

Beitrag von BlackDevil »

Hallo Zusammen,

in meinem Dokument habe ich einen Appendix bereich \begin{appendix} ... \end{appendix}. Kapitel, Abschnitte und Unterabschnitte versehe ich fleißig mit Labels, wenn notwendig:
\chapter{Neural Networks}\label{chap:neuronet}
Mit dem Ergebnis
Appendix A
Neural Networks
Wenn ich nun von anderer Stelle mit Autoref darauf verweise
In \autoref{chap:neuronet} the theory of biological neural networks and the development of \glspl{ANN} is elaborated.
bekomme ich als Ergebnis nur
In A the theory of ...
Heißt: Anstelle der kompletten Überschrift bekomme ich nur ein "A". Das A ist zwar richtig, aber eben nicht alles.

Minimalbeispiel mit gleichem Problem:
\documentclass{scrbook}

	\usepackage[toc,page]{appendix}
	\usepackage[
	%%% Extension options
	  ,backref=page       % Adds backlink text to the end of each item in the
	                      % bibliography, as a list of section numbers.
	                      % (section, slide, page, none)
	  ,pagebackref=false  % Adds backlink text to the end of each item in the
	                      % bibliography, as a list of page numbers.
	  ,hyperindex=true    % Makes the page numbers of index entries into
	                      % hyperlinks.
	  ,hyperfootnotes=false % Makes the footnote marks into hyperlinks to the
	                        % footnote text (must be false if footmisc is loaded).
	]{hyperref}
	
	\usepackage[
	automark,
	footsepline,
	headsepline,
	]{scrpage2}
	
\begin{document}
	Lorem Ipsum. Verweis auf Kapitel im Appendix \autoref{chap:testchapter}. Verweis auf Abschnitt in diesem Kapitel \autoref{sec:testsection}.
	
	\begin{appendix}
		\chapter{Lorem Ipsum}\label{chap:testchapter}
			Lorem Ipsum
			\section{Lorem Ipsum}\label{sec:testsection}
	\end{appendix}
\end{document}
Das Hypersetup im richtigen Dokument habe ich weggelassen, weil ich sonst viel mehr ins Minimalbeispiel packen müsste. Es sieht aber so aus :
	\hypersetup{
	%%% General options
	  ,linkcolor  =pdflinkcolor   % Color for normal internal links.
	  ,anchorcolor=pdfanchorcolor % Color for anchor text.
	  ,citecolor  =pdfcitecolor   % Color for bibliographical citations in text.
	  ,filecolor  =pdffilecolor   % Color for URLs which open local files.
	  ,menucolor  =pdfmenucolor   % Color for Acrobat menu items.
	  ,runcolor   =pdfruncolor    % Color for run links (launch annotations).
	  ,urlcolor   =pdfurlcolor    % color magenta Color for linked URLs.
	  ,draft=false, % all hypertext options are turned off
	  ,final=true   % all hypertext options are turned on
	  ,debug=false  % extra diagnostic messages are printed in the log file
	  ,hypertexnames=true % use guessable names for links
	  ,naturalnames=false % use LaTeX-computed names for links
	  ,setpagesize=true   % sets page size by special driver commands
	%%% Configuration options
	  ,raiselinks=true    % forces commands to reflect the
	                      % real height of the link 
	  ,breaklinks=true    % Allows link text to break across lines
	  ,pageanchor=true    % Determines whether every page is given an implicit
	                      % anchor at the top left corner. 
	  ,plainpages=false   % Forces page anchors to be named by the arabic
	                      % form of the page number, rather than the formatted form.
	%%% Extension options
	  ,linktocpage=true   % make page number, not text, be link on TOC, LOF and LOT
	  ,colorlinks=true    % Colors the text of links and anchors.
	  ,bookmarksopen=true     % If Acrobat bookmarks are requested, show them
	                          % with all the subtrees expanded.
	  ,bookmarksopenlevel=2   % level (\maxdimen) to which bookmarks are open
	  ,bookmarksnumbered=true %
	  ,bookmarkstype=toc      %
	%%% PDF display and information options
	  ,pdfpagemode=UseOutlines % Determines how the file is opening in Acrobat:
	                          %  UseNone, UseThumbs (show thumbnails),
	                          %  UseOutlines (show bookmarks), FullScreen,
	                          %  UseOC (PDF 1.5), and UseAttachments (PDF 1.6).
	                          %
	  ,pdfstartpage=1         % Determines on which page the PDF file is opened.
	  ,pdfstartview=FitV      % Set the startup page view
	  % options: (same for pdfview, pdfremotestartview)
	  %  Fit   Fits the page to the window.
	  %  FitH  Fits the width of the page to the window.
	  %  FitV  Fits the height of the page to the window.
	  %  FitB  Fits the page bounding box to the window.
	  %  FitBH Fits the width of the page bounding box to  the window.
	  %  FitBV Fits the height of the page bounding box to the window.
	  ,pdfremotestartview=Fit % Set the startup page view of remote PDF files
	  ,pdfcenterwindow=false  %
	  ,pdffitwindow=false     % resize document window to fit document size
	  ,pdfnewwindow=false     % make links that open another PDF file 
	                          % start a new window
	  % options:
	  %  SinglePage     Displays a single page; advancing flips the page
	  %  OneColumn      Displays the document in one column; continuous scrolling.
	  %  TwoColumnLeft  Displays the document in two columns, 
	  %                 odd-numbered pages to the left.
	  %  TwoColumnRight Displays the document in two columns, 
	  %                 odd-numbered pages to the right.
	  %  TwoPageLeft    Displays two pages, odd-numbered pages to the left 
	  %  TwoPageRight   Displays two pages, odd-numbered pages to the right 
	  %
	  ,pdfdisplaydoctitle=true  % display document title instead of file name 
	}%
Vielleicht hat jemand eine Idee wie ich das beheben kann. Ich fände es schöner wenn da stünde
In Anhang A Neuronale Netze [...]

Danke im voraus und Grüße :)

Benutzeravatar
Johannes_B
Moderator
Moderator
Beiträge: 5079
Registriert: Do 1. Nov 2012, 14:55
Kontaktdaten:

Beitrag von Johannes_B »

\documentclass[ngerman]{scrreprt}
%\usepackage[toc,page]{appendix}
\usepackage{nameref}
\usepackage[
	,backref=page       
	,pagebackref=false  
	,hyperindex=true    
	,hyperfootnotes=false 
]{hyperref}

\begin{document}
Verweis auf Kapitel im Appendix \nameref{chap:testchapter}.
Verweis auf Abschnitt in diesem Kapitel
\nameref{sec:testsection}.

Verweis auf Kapitel im Appendix \autoref{chap:testchapter}.
Verweis auf Abschnitt in diesem Kapitel
\autoref{sec:testsection}.

%\begin{appendix}
	\appendix
	\chapter{Anhang chapterebene}\label{chap:testchapter}
	Lorem Ipsum
	\section{Anhang Sectionebene}\label{sec:testsection}
%\end{appendix}
\end{document} 
TeXwelt - Fragen und Antworten Schaut vorbei und stellt Fragen.
LaTeX-Vorlagen?

Der Weg zum Ziel: Ruhe bewahren und durchatmen, Beiträge und unterstützende Links aufmerksam lesen, Lösungsansätze verstehen und ggf. nachfragen.

BlackDevil
Forum-Century
Forum-Century
Beiträge: 107
Registriert: Di 23. Jul 2013, 11:38
Wohnort: Deutschland

Beitrag von BlackDevil »

Sollte ich alle autoref durch nameref ersetzen oder nur solche, die auf den Anhang verweisen?

Benutzeravatar
Johannes_B
Moderator
Moderator
Beiträge: 5079
Registriert: Do 1. Nov 2012, 14:55
Kontaktdaten:

Beitrag von Johannes_B »

Autoref verhält sich doch erwartungsgemäß, oder?
Siehe \autoref{tab:irgendwas}
würde »Siehe Tabelle <Zahl>« liefern (vorrausgesetzt, das Label gehört auch wirklich zu einer Tabelle). Würdest du da jetzt die Caption erwarten?
TeXwelt - Fragen und Antworten Schaut vorbei und stellt Fragen.
LaTeX-Vorlagen?

Der Weg zum Ziel: Ruhe bewahren und durchatmen, Beiträge und unterstützende Links aufmerksam lesen, Lösungsansätze verstehen und ggf. nachfragen.

BlackDevil
Forum-Century
Forum-Century
Beiträge: 107
Registriert: Di 23. Jul 2013, 11:38
Wohnort: Deutschland

Beitrag von BlackDevil »

Ähm, ja. Klar soll \autoref{tab:lorem} nur Liefern "Table 4711". Irgendwie hatte ich soweit nicht gedacht und nicht gemerkt, dass autoref ordnungsgemäß funktioniert :roll: .

Das ändert aber nichts an der Tatsache, das "A shows bla" ziemlich blöd ist. Aber gut, ich hab mich selbst irritiert und werde die Stellen händisch mit einem "Appendix \autoref{chap:lorem}" versehen, dann passt das. Ansonsten müsste ich wohl eine eigene Referenz mit Text kreieren ;)

Danke :D

Benutzeravatar
Johannes_B
Moderator
Moderator
Beiträge: 5079
Registriert: Do 1. Nov 2012, 14:55
Kontaktdaten:

Beitrag von Johannes_B »

Wenn du mein Beispiel kopierst und kompilierst, was kommt dann dabei für Text raus, wie/wo sind die Sprungmarken von hyperref?
TeXwelt - Fragen und Antworten Schaut vorbei und stellt Fragen.
LaTeX-Vorlagen?

Der Weg zum Ziel: Ruhe bewahren und durchatmen, Beiträge und unterstützende Links aufmerksam lesen, Lösungsansätze verstehen und ggf. nachfragen.

BlackDevil
Forum-Century
Forum-Century
Beiträge: 107
Registriert: Di 23. Jul 2013, 11:38
Wohnort: Deutschland

Beitrag von BlackDevil »

Dann gibt er ganz korrekt den Text des jeweiligen Kapitels/Abschnitts aus. Ich schreibe von Hand Appendix, ich schaff es nicht mehr mich noch mehr damit zu befassen zumal Latex mich immer wieder mit neuen Sachen ärgert :roll:


danke :D

Antworten