Hi I have a problem with referencing which I cannot reproduce with the MWE. Here is what the problem is. I need to write next to the page number of my reference also if that page comes before and or after (Cf. above P. X - cf. below P. Y).
For that I am using following definition:
\makeatletter%
\newcount\here@undef%
\newcommand{\here}[1]{%
\@ifundefined{here@#1@undef}{}{\advance\here@undef by -1}%
\@namedef{here@#1}{}}%
\newcommand{\where}[1]{%
\@ifundefined{here@#1}{%
unten\space%
\@ifundefined{here@#1@undef}{%
\@namedef{here@#1@undef}{}%
\advance\here@undef by 1%
}{}%
}{%
oben%
}%
}%
\AtEndDocument{%
\ifnum\here@undef>0%
\GenericWarning{}{There were undefined above/below labels}%
\fi}%
\makeatother%
and than in the text I put: \here{x}\label{x}
and \footnote{Siehe dazu \where{x} S. \pageref{x}.}
Now that works fine for the most parts but there are some entries where it doesn't meaning it tells above when its below or below when its above.
Here is an example:
The page number is ok but it should be oben (above) instead of below (unten). This happens only with few references - not with all, but still thats a problem and it shouldn't happen.
I can't figure out why it does this.In the .aux file it looks like this:
\@writefile{toc}{\defcounter {refsection}{0}\relax }\@writefile{toc}{\contentsline {subsubsection}{\numberline {1.2.2}Homoousianismus}{36}{subsubsection.1.2.2}}
\newlabel{hmsnsnms}{{1.2.2}{36}{Homoousianismus}{subsubsection.1.2.2}{}}
\newlabel{ZGHPAZ8A62}{{1.2.2}{36}{Homoousianismus}{subsubsection.1.2.2}{}}
\newlabel{ZGGRAAN9M3}{{1.2.2}{36}{Homoousianismus}{subsubsection.1.2.2}{}}
\newlabel{ZGF97PS312}{{1.2.2}{37}{Homoousianismus}{subsubsection.1.2.2}{}}
\newlabel{ZENP2OXA6Z}{{1.2.2}{37}{Homoousianismus}{subsubsection.1.2.2}{}}
\newlabel{ZDNOW6A981}{{1.2.2}{38}{Homoousianismus}{subsubsection.1.2.2}{}}
\newlabel{athglbkntns}{{1.2.2}{38}{Homoousianismus}{subsubsection.1.2.2}{}}
\newlabel{ZBT29MH2LW}{{1.2.2}{38}{Homoousianismus}{subsubsection.1.2.2}{}}
\newlabel{ZAPYHEWQ07}{{1.2.2}{39}{Homoousianismus}{subsubsection.1.2.2}{}}
\newlabel{ZA4HNDP59U}{{1.2.2}{39}{Homoousianismus}{subsubsection.1.2.2}{}}
\newlabel{Z546N43KIX}{{1.2.2}{39}{Homoousianismus}{subsubsection.1.2.2}{}}
\newlabel{Z50RQN9QUC}{{1.2.2}{39}{Homoousianismus}{subsubsection.1.2.2}{}}
\newlabel{Z4RSFUMEBP}{{1.2.2}{39}{Homoousianismus}{subsubsection.1.2.2}{}}
\newlabel{Z2ZXAGGBHJ}{{1.2.2}{39}{Homoousianismus}{subsubsection.1.2.2}{}}
\newlabel{doppltexath}{{2}{40}{Homoousianismus}{Item.29}{}}
\newlabel{Z0H2OLHK3K}{{1.2.2}{42}{Homoousianismus}{Item.30}{}}
The problematic reference is:
\newlabel{doppltexath}{{2}{40}{Homoousianismus}{Item.29}{}}
and I get it that the reason for this is that here I have {2}
(second chapter) instead of {1.2.2}
(first chapter), but I can't figure out why he is doing this with exactly this entry which is just a normal entry like any other (nothing special about it).
Here is a MWE but as I mentioned I can't reproduce this behaviour:
\documentclass[a4paper,11pt]{scrartcl}
\usepackage[latin1]{inputenc}
\usepackage{csquotes}
\usepackage{blindtext}
\usepackage{filecontents}
\usepackage{hyperref}
\hypersetup{
colorlinks,
citecolor=black,
filecolor=black,
linkcolor=black,
urlcolor=black
}
\makeatletter%
\newcount\here@undef%
\newcommand{\here}[1]{%
\@ifundefined{here@#1@undef}{}{\advance\here@undef by -1}%
\@namedef{here@#1}{}}%
\newcommand{\where}[1]{%
\@ifundefined{here@#1}{%
unten\space%
\@ifundefined{here@#1@undef}{%
\@namedef{here@#1@undef}{}%
\advance\here@undef by 1%
}{}%
}{%
oben%
}%
}%
\AtEndDocument{%
\ifnum\here@undef>0%
\GenericWarning{}{There were undefined above/below labels}%
\fi}%
\makeatother%
\begin{filecontents}{\jobname.bib}
@incollection{athanasius1857,
Address = {Parisiis},
Author = {{Athanasius Alexandrinus}},
Booktitle = {S. P. N. Athanasii archiepiscopi Alexandrini opera omnia quae exstant},
Editor = {Jacques Paul Migne},
Keywords = {source},
Pages = {14013-1422},
Publisher = {Accurante J.-P. Migne},
Series = {Patrologia Graeca},
Shortauthor = {Ath.},
Shorttitle = {ep. fest. 12.},
Title = {Epistola XII heortastica},
Volume = {26},
Year = {1857}}
@book{athanasius1858,
Address = {Parisiis},
Author = {{Athanasius Alexandrinus}},
Booktitle = {S. P. N. Athanasii archiepiscopi Alexandrini opera omnia quae exstant},
Editor = {Jacques Paul Migne},
Keywords = {source},
Pages = {1403-1412},
Publisher = {Accurante J.-P. Migne},
Series = {Patrologia Graeca},
Shortauthor = {Ath.},
Shorttitle = {ep. fest. 11.},
Title = {Epistola XI heortastica},
Volume = {26},
Year = {1857}}
\end{filecontents}
\usepackage[ngerman]{babel}
\usepackage[style=historische-zeitschrift, maxnames=2, hyperref=true, backref=true, backrefstyle=none, backend=bibtex,idemtracker=true]{biblatex}
\bibliography{\jobname}
%
\begin{document}
\blindtext\footnote{Siehe dazu \where{x} S. \pageref{x}ff.}
\pagebreak
\blindtext\here{x}\label{x}
\pagebreak
\blindtext\footnote{Siehe dazu \where{x} S. \pageref{x}ff.}
\pagebreak
\printbibliography
\end{document}
Also and I think that is very important this only happens with Cf. below
and not with Cf. above
references!
I also uploaded my .tex and .aux files here if someone wants to take a look at them:
https://dl.dropboxusercontent.com/u/17374757/Inhalt.tex https://dl.dropboxusercontent.com/u/17374757/struktur.aux
Thanks for your help!
varioref
\global\@namedef
and also\global\advance