1

I have problems putting the ä character inside a reference link. In fact, when I click on it in the .pdf file that I obtain, the link sends me to the top of the first page, instead that to the reference voice.

Here is the code:

\documentclass{article}
\usepackage[utf8]{inputenc} 
\usepackage[english]{babel}
\usepackage{lipsum} 
\usepackage[T1]{fontenc}
\usepackage[colorlinks=true]{hyperref}

\begin{document}

\lipsum
\cite{ä0000}
\cite{word}


\begin{thebibliography} {20}
    \small
    \bibitem [ä0000] {ä0000} description1
    \bibitem [word] {word} description2
\end{thebibliography}
\end{document}
  • 3
    The why do you use ä? Replace it by e.g. ae -- as the key is not printed it doesn't matter. – Ulrike Fischer Jun 22 '16 at 8:17
  • @UlrikeFischer: if it's possible I would like to maintain ä; otherwise I'll follow your suggestion – Andrea Jun 22 '16 at 8:20
  • 2
    Is there something that's forcing you to use a diacritic in the arguments of \cite and \bibitem? Changing the two instances of {ä0000} to {a0000} (or some other string that doesn't contain non-ASCII characters) eliminates the problem immediately. Incidentally, I assume you're compiling your document with pdfLaTeX; if you can switch to LuaLaTeX, you can keep the ä character and still get the correct hyperlink behavior... – Mico Jun 22 '16 at 8:22
  • @Mico: see my comment to UlrikeFischer – Andrea Jun 22 '16 at 8:25
  • @Andrea - Is switching to LuaLaTeX an option for you? As I mentioned in my earlier comment, that will let you keep using non-ASCII characters. Separately, it would be helpful if you explained your reason for wanting to have non-ASCII characters in the arguments of \cite and \bibitem in the first place. Neither Ulrike nor I can so far see a compelling reason for doing so. – Mico Jun 22 '16 at 8:27
3

With pdflatex you shouldn't use non-ascii chars in labels and cite keys. Replace the ä with ae:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{lipsum}
\usepackage[T1]{fontenc}
\usepackage[colorlinks=true]{hyperref}

\begin{document}

\lipsum
\cite{ae0000}
\cite{word}


\begin{thebibliography} {20}
    \small
    \bibitem [ä0000] {ae0000} description1
    \bibitem [word] {word} description2
\end{thebibliography}
\end{document}

With lualatex it would be possible to use the ä, but lualatex would need other changes in your document (no inputenc, fontspec instead of fontenc, and probably more in your real document). I doubt very much that a change to lualatex is easier than exchanging ä with ae.

  • It's (also) bibtex that can't use non-7bit characters. Bibtex8 can use full Ascii. Biblatex should be utf8 compatible. – PhilipPirrip Jun 22 '16 at 11:43
  • @PhilipPirrip: The example of the question doesn't use bibtex, but a manually written bibliography. – Ulrike Fischer Jun 22 '16 at 11:47
  • Sorry, my fault. I thought that manually written bibliography was used just to simplify things (the MWE). – PhilipPirrip Jun 22 '16 at 12:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.