Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am using the hack given here as accepted solution to refer to a description list item by name instead of number. It works nicely, except when one of the words in the name ends with a non-ascii character, in which case it kills the space after it (only in the reference). Why is that? Is there a way to modify the hack that avoids this problem? I am using pdflatex with hyperref and inputenc.

A MWE:

\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
  \makeatletter
  \let\orgdescriptionlabel\descriptionlabel
  \renewcommand*{\descriptionlabel}[1]{%
    \let\orglabel\label
    \let\label\@gobble
    \phantomsection
    \edef\@currentlabel{#1}%
    \let\label\orglabel
    \orgdescriptionlabel{#1}%
  }
  \makeatother
\begin{document}
  \begin{description}
    \item[Arzelà and Volterra\label{av}] Reference: \ref{av}.
    \item[Arzel{à} and Volterra\label{av2}] Reference: \ref{av2}.
    \item[Arzel\`a and Volterra\label{av3}] Reference: \ref{av3}.
  \end{description}
\end{document}

An even worse problem arises with ß, which I don't need (try Weierstraß and Kummer).

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

Use \protected@edef\@currentlabel{#1}%

share|improve this answer
    
Great! Thank you. –  quim Apr 29 '11 at 16:07
    
@quim: Glad you got your answer. It's good form to upvote the answer in addition to accepting it. –  Matthew Leingang Apr 29 '11 at 16:50
    
@Matthew: I know. But in order to upvote it is necessary to have 15 rep. –  quim Apr 29 '11 at 17:35
    
Ok, one up vote begets another. –  Matthew Leingang Apr 29 '11 at 18:27
    
Let it be so :D –  quim Apr 29 '11 at 19:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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