0

When I reference a figure or table in the text using \ref{something} it appears a tilde between Figura (or Tabla) and the number (something like Figura~1), but I realized it's only when using packages chemstyleand [spanish]{babel}

Here you have a MWE:

\documentclass[a4paper]{book}
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}
\usepackage{graphicx} 
\usepackage{chemstyle}

\begin{document}

\begin{figure}
\includegraphics[width=\textwidth]{lion}
\caption{esto es un león}\label{fig-lion}
\end{figure}
bla bla \ref{fig-lion} bla bla bla bla bla bla bla bla

\end{document}

I use TexShop on a Mac with OSX 10.10. The composition is done with LaTeX (pdfTex).

Is there any incompatibility between chemstyleand [spanish]{babel}? or any error of my settings?

Any help would be greatly appreciated.

  • I've tried with some different languages and I've found it happens in spanish and galician. For catalan, italian, portuguese, french, romanian, latin, english, german, dutch, finnish, swedish... it works fine. – Pere Ferriol Aug 9 '15 at 10:27
1

It's a flaw in how babel handles active characters in labels. There are two options:

\usepackage[spanish.notilde]{babel}

or:

\usepackage[spanish,safe=none]{babel}
  • only the second option worked for me ( \usepackage[spanish.notilde, es-tabla]{babel} didn't work) as I'm using es-tabla in order to have Tabla instead of Cuadro, like this \usepackage[spanish,safe=none, es-tabla]{babel} – Pere Ferriol Aug 9 '15 at 16:58
  • Write either spanish.tabla.notilde or spanish,es-tabla,es-notilde. – Javier Bezos Aug 10 '15 at 13:20
  • OK! now both options work – Pere Ferriol Aug 13 '15 at 16:07

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.