Michael Zedler
2006-01-20 09:26:41 UTC
Hello,
how can I get hyperref to create hyperlinks to the bibliography when
bibunits and babel are used? The patch proposed in
<***@gmx.net> makes bibunits+hyperref work, but not
bibunits+babel+hyperref.
\listfiles
\documentclass{book}
\usepackage[ngerman,english]{babel}
\usepackage{bibunits}
\usepackage[sort]{cite}
\usepackage[colorlinks]{hyperref}
\makeatletter
\def\***@natlinkstart#1{%
\***@backout{#1}%
\***@linkstart{cite}{cite.\@bibunitname.#1}%
% ^^^^^^^^^^^^^^
\def\***@nat@current{#1}%
}
\def\***@natlinkbreak#1#2{%
\***@linkend#1\***@linkstart{cite}{cite.\@bibunitname.#2}%
% ^^^^^^^^^^^^^^
}
\def\***@natanchorstart#1{%
\***@anchorstart{cite.\@bibunitname.#1}%
% ^^^^^^^^^^^^^^
}
\def\bibcite#1#2{%
\@***@bel{b}{#1}{\hyper@@link[cite]{}{cite.\@bibunitname.#1}{#2}}%
% ^^^^^^^^^^^^^^
}%
\def\@lbibitem[#1]#2{%
\@skiphyperreftrue
\***@item[\***@anchorstart{cite.\@bibunitname.#2}%
% ^^^^^^^^^^^^^^
\@BIBLABEL{#1}\***@anchorend\hfill]%
\@skiphyperreffalse
\***@filesw
\begingroup
\let\protect\noexpand
\immediate\write\@auxout{%
\string\bibcite{#2}{#1}%
}%
\endgroup
\fi
\ignorespaces
}%
\def\@bibitem#1{%
\@skiphyperreftrue\***@item\@skiphyperreffalse
\***@anchorstart{cite.\@bibunitname.#1}\relax\***@anchorend
% ^^^^^^^^^^^^^^
\***@filesw
\begingroup
\let\protect\noexpand
\immediate\write\@auxout{%
\string\bibcite{#1}{\the\value{\@listctr}}%
}%
\endgroup
\fi
\ignorespaces
}%
\def\@citex[#1]#2{%
\let\@citea\@empty
\@cite{%
\@for\@citeb:=#2\do{%
\@citea
\def\@citea{,\penalty\@m\ }%
\edef\@citeb{\expandafter\@firstofone\@citeb}%
\***@filesw
\immediate\write\@auxout{\string\citation{\@citeb}}%
\fi
\@ifundefined{b@\@citeb}{%
\mbox{\***@font\bfseries ?}%
\***@refundefinedtrue
\@***@warning{%
Citation `\@citeb' on page \thepage \space undefined%
}%
}{%
\***@natlinkstart{#2}%
% ^^^^^^^^^^^^^^^^^^^^^^^^
\hbox{\csname b@\@citeb\endcsname}%
\***@natlinkend%
% ^^^^^^^^^^^^^^^^^^
}%
}%
}{#1}%
}%
\makeatother
\begin{document}
\bibliographyunit[\chapter]
\bibliography*{EMCEbib}
\bibliographystyle*{ieeetr}
\makeatletter
\let\stdthebibliography\thebibliography
\renewcommand{\thebibliography}{%
\let\chapter\section
\renewcommand{\@mkboth}[2]{}
\stdthebibliography}
\makeatother
\chapter{first}
Hallo \cite{Rayleigh1897} \putbib
\chapter{second}
Hallo \cite{Abraham1983} \putbib
\end{document}
-- EMCEbib.bib
@BOOK{Abraham1983,
author = "Ralph Abraham and Jerrold E. Marsden and Tudor Ratiu",
title = "Manifolds, Tensor Analysis and Applications",
publisher = "Addison-Wesley",
address = "London",
year = 1983 }
@BOOK{Abramowitz1993,
author = "M.~Abramowitz and I.A.~Stegun",
title = "Handbook of Mathematical Functions with Formulas, Graphs
and Mathematical Tables",
publisher = "Dover",
address = "New York",
year = 1965 }
--
*File List*
book.cls 2004/02/16 v1.4f Standard LaTeX document class
bk10.clo 2004/02/16 v1.4f Standard LaTeX file (size option)
babel.sty 2005/05/21 v3.8g The Babel package
ngermanb.ldf 2004/02/20 v2.6m new German support from the babel system
english.ldf 2005/03/30 v3.3o English support from the babel system
bibunits.sty 2004/05/12 v2.4 Multiple bibliographies in one document.
cite.sty 2003/11/04 v 4.01
hyperref.sty 2003/11/30 v6.74m Hypertext links for LaTeX
keyval.sty 1999/03/16 v1.13 key=value parser (DPC)
pd1enc.def 2003/11/30 v6.74m Hyperref: PDFDocEncoding definition (HO)
hyperref.cfg 2003/03/08 v1.0 MiKTeX 'hyperref' configuration
url.sty 2005/06/27 ver 3.2 Verb mode for urls, etc.
hypertex.def 2003/11/30 v6.74m Hyperref driver for HyperTeX specials
color.sty 1999/02/16 v1.0i Standard LaTeX Color (DPC)
color.cfg 2005/12/29 v1.1 MiKTeX 'color' configuration
dvips.def 1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)
dvipsnam.def 1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)
nameref.sty 2003/12/03 v2.21 Cross-referencing by name of section
bu1.bbl
bu2.bbl
***********
thanks in advance,
Michael
how can I get hyperref to create hyperlinks to the bibliography when
bibunits and babel are used? The patch proposed in
<***@gmx.net> makes bibunits+hyperref work, but not
bibunits+babel+hyperref.
\listfiles
\documentclass{book}
\usepackage[ngerman,english]{babel}
\usepackage{bibunits}
\usepackage[sort]{cite}
\usepackage[colorlinks]{hyperref}
\makeatletter
\def\***@natlinkstart#1{%
\***@backout{#1}%
\***@linkstart{cite}{cite.\@bibunitname.#1}%
% ^^^^^^^^^^^^^^
\def\***@nat@current{#1}%
}
\def\***@natlinkbreak#1#2{%
\***@linkend#1\***@linkstart{cite}{cite.\@bibunitname.#2}%
% ^^^^^^^^^^^^^^
}
\def\***@natanchorstart#1{%
\***@anchorstart{cite.\@bibunitname.#1}%
% ^^^^^^^^^^^^^^
}
\def\bibcite#1#2{%
\@***@bel{b}{#1}{\hyper@@link[cite]{}{cite.\@bibunitname.#1}{#2}}%
% ^^^^^^^^^^^^^^
}%
\def\@lbibitem[#1]#2{%
\@skiphyperreftrue
\***@item[\***@anchorstart{cite.\@bibunitname.#2}%
% ^^^^^^^^^^^^^^
\@BIBLABEL{#1}\***@anchorend\hfill]%
\@skiphyperreffalse
\***@filesw
\begingroup
\let\protect\noexpand
\immediate\write\@auxout{%
\string\bibcite{#2}{#1}%
}%
\endgroup
\fi
\ignorespaces
}%
\def\@bibitem#1{%
\@skiphyperreftrue\***@item\@skiphyperreffalse
\***@anchorstart{cite.\@bibunitname.#1}\relax\***@anchorend
% ^^^^^^^^^^^^^^
\***@filesw
\begingroup
\let\protect\noexpand
\immediate\write\@auxout{%
\string\bibcite{#1}{\the\value{\@listctr}}%
}%
\endgroup
\fi
\ignorespaces
}%
\def\@citex[#1]#2{%
\let\@citea\@empty
\@cite{%
\@for\@citeb:=#2\do{%
\@citea
\def\@citea{,\penalty\@m\ }%
\edef\@citeb{\expandafter\@firstofone\@citeb}%
\***@filesw
\immediate\write\@auxout{\string\citation{\@citeb}}%
\fi
\@ifundefined{b@\@citeb}{%
\mbox{\***@font\bfseries ?}%
\***@refundefinedtrue
\@***@warning{%
Citation `\@citeb' on page \thepage \space undefined%
}%
}{%
\***@natlinkstart{#2}%
% ^^^^^^^^^^^^^^^^^^^^^^^^
\hbox{\csname b@\@citeb\endcsname}%
\***@natlinkend%
% ^^^^^^^^^^^^^^^^^^
}%
}%
}{#1}%
}%
\makeatother
\begin{document}
\bibliographyunit[\chapter]
\bibliography*{EMCEbib}
\bibliographystyle*{ieeetr}
\makeatletter
\let\stdthebibliography\thebibliography
\renewcommand{\thebibliography}{%
\let\chapter\section
\renewcommand{\@mkboth}[2]{}
\stdthebibliography}
\makeatother
\chapter{first}
Hallo \cite{Rayleigh1897} \putbib
\chapter{second}
Hallo \cite{Abraham1983} \putbib
\end{document}
-- EMCEbib.bib
@BOOK{Abraham1983,
author = "Ralph Abraham and Jerrold E. Marsden and Tudor Ratiu",
title = "Manifolds, Tensor Analysis and Applications",
publisher = "Addison-Wesley",
address = "London",
year = 1983 }
@BOOK{Abramowitz1993,
author = "M.~Abramowitz and I.A.~Stegun",
title = "Handbook of Mathematical Functions with Formulas, Graphs
and Mathematical Tables",
publisher = "Dover",
address = "New York",
year = 1965 }
--
*File List*
book.cls 2004/02/16 v1.4f Standard LaTeX document class
bk10.clo 2004/02/16 v1.4f Standard LaTeX file (size option)
babel.sty 2005/05/21 v3.8g The Babel package
ngermanb.ldf 2004/02/20 v2.6m new German support from the babel system
english.ldf 2005/03/30 v3.3o English support from the babel system
bibunits.sty 2004/05/12 v2.4 Multiple bibliographies in one document.
cite.sty 2003/11/04 v 4.01
hyperref.sty 2003/11/30 v6.74m Hypertext links for LaTeX
keyval.sty 1999/03/16 v1.13 key=value parser (DPC)
pd1enc.def 2003/11/30 v6.74m Hyperref: PDFDocEncoding definition (HO)
hyperref.cfg 2003/03/08 v1.0 MiKTeX 'hyperref' configuration
url.sty 2005/06/27 ver 3.2 Verb mode for urls, etc.
hypertex.def 2003/11/30 v6.74m Hyperref driver for HyperTeX specials
color.sty 1999/02/16 v1.0i Standard LaTeX Color (DPC)
color.cfg 2005/12/29 v1.1 MiKTeX 'color' configuration
dvips.def 1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)
dvipsnam.def 1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)
nameref.sty 2003/12/03 v2.21 Cross-referencing by name of section
bu1.bbl
bu2.bbl
***********
thanks in advance,
Michael