Subject: bug#21183: 11.88; Wrap line break references to labels

From: Mosè Giordano <[email-masked]>
Date: Mon, 3 Aug 2015 23:35:51 +0200

Hi Cristoph,

2015-08-03 22:28 GMT+02:00 Ortner, Christoph <[email-masked]>:
> If I do automatic line wrap in paragraphs with latex labels, e.g.,
> \ref{eq:a long descriptive label}
> then it will often be separated into two lines, and the reference
> breaks. Same problem with labels themselves in fact.

This document

--8<---------------cut here---------------start------------->8---
\documentclass{article}
\begin{document}
\begin{equation}
  \label{eq:a very long label with spaces in it}
  a+b=c
\end{equation}
This is a very long paragraph with a~(\ref{eq:a very long label with spaces in
  it})
\end{document}
--8<---------------cut here---------------end--------------->8---

compiles fine for me, even with a line break in the ref macro.  I'd
suggest not to use spaces in labels at all, see also
https://tex.stackexchange.com/questions/149701/are-latexs-label-names-case-sensitive-can-label-names-contain-spaces#comment340547_149704

Anyway, you can add the ref macro (and all other ref-like macros) to
the `LaTeX-verbatim-macros-with-braces-local' variable in your init
file, in order to avoid breaking it:

    (add-to-list 'LaTeX-verbatim-macros-with-braces-local "ref")

Let me know if this suffices.

Bye,
Mosè