label whitespaces no more
Igor
rychphd at gmail.com
Sun Sep 8 10:09:15 UTC 2024
> > Seems like a refstyle's bug.
> > \label{sec:A B}
> > ...
> > \secref{A B} -- can't find the label sec:AB -- refstyle has eaten up
> > my whitespace!
> >
> > \secref{{A B}} -- works!
>
> Maybe, but as long as refstyle is not fixed (and I believe it is not
> maintained any longer), escaping whitespace seems better than such
> extra-grouping.
>
> Long term, more purpose-specific escaping seems the way to go, but this
> requires some work.
>
> > I've relied on my labels to be preserved internally with whitespaces
> > etc. because it's never been forbidden before. I'd have to modify all
> > my manuscripts.
>
> What is the concrete problem you have? I'd like to understand that.
>
Thank you Jürgen for your interest in my problem. Let me begin by
saying that I have some 15 years worth of various lyx notes with
whitespace labels. I would have to re-edit a lot of files carefully to
encapsulate all such labels into Ctrl+L TEX code inserts.
Sometimes it does not matter what the underlying latex label becomes
(although I'd rather lyx not to modify them anyway), but often it does
for me. The places I label are often overloaded with other things,
e.g. section or paragraph titles can have a math expression or a
hyperlink target right inside it and so on. So, when I want to refer
to it by name, I don't want all that to be displayed in a reference,
the target reassigned, etc., but rather the shorter, simplified label
name itself. I still want a textual representation given by the label
name, rather than "see section 43".
I guess I've never run into this whitespace refstyle bug, because I
redefined all my formatted references, for example
\renewcommand*{\thmref}[1]{\hyperref[thm:#1]{#1}}. I'm not sure if I
even need refstyle ... but it's loaded automatically by LyX for
"formatted" references -- fine.
Could you please make an additional tick option under Document
Settings > Document Class, after "Use refstyle.." and before "Format
cross-references"... something like:
"Escape labels for compatibility"
Thank you and hope for a solution (rather than forever staying on Lyx 2.3 :),
Igor
More information about the lyx-devel
mailing list