Fonts & Character SetsAccents in \label and \ref arguments

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Post Reply
Tititex
Posts: 1
Joined: Sat Aug 22, 2015 7:03 pm

Accents in \label and \ref arguments

Post by Tititex »

Hi, I'd like to know how to include words with accents in \label{} and \ref{} arguments.


For example : \label{Molécules d'immunoglobulines)
\ref{Molécules d'immunoglobulines}


I've already succeeded giving file names with spaces and accents to the argument command \includegraphics{} thanks to the package grffile, but I can't find an easy way to do it with \label{} and \ref{} commands. Do you have any idea ?

Thanks.
Last edited by cgnieder on Fri Aug 28, 2015 7:23 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Accents in \label and \ref arguments

Post by Johannes_B »

It is in fact possible with unicode-aware engines like XeTeX and LuaTeX. But really, don't do it.

Code: Select all

% arara: xelatex
% arara: xelatex
\documentclass{article}
\begin{document}
\section{Heart}\label{♥}
Listen to your \ref{♥}
\end{document}
It is completely impossible with pdfTeX. Sorry. That engine has no clue that there is more than the 52 letters of the latin alphabet (and numbers and punctuation), or in other words: pdfTeX has no idea that there is more in the world than ascii.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Accents in \label and \ref arguments

Post by Stefan Kottwitz »

Welcome to the forum!

As labels are only internally used, I would use shortcuts anyway, as long as I and somebody else reading the code can understand the key / label.

Nice to see a user writing French again. Friends and I think about starting a French LaTeX support forum. We set something first up on TeXnique.fr. Do you think it would be a good idea?

Stefan
LaTeX.org admin
Post Reply