On Thu, 19 Sep 2019 10:18:55 +0100 Paul Evans <p...@cpevans.org> wrote:
> Hi > > I would be grateful for advice on how to enter labels automatically > in all headings (Chapter, Section etc). > > I wanted to achieve this as I am starting up a new document with > multiple sections etc with the expectation that there will be > multiple cross references. > > I use the keyboard to start a new section or subsection. The obvious > (!) solution seemed to be to change the relevant key shortcuts. I > tried out the change in the mini buffer. Instead of > > layout Section (as used for Crtl-P-2) > > I tried > > command-sequence layout Section ; label-insert ; > > This opened the dialogue and pressing return completed the process, > accepting the default label. However as I am happy with the defaults > I tried to find a further command to add to the sequence to close and > apply the dialog. I have found lots of options being used in similar > cases but none does the job in this sequence. The various commands > about paragraphs etc do not impact on the dialog and variations using > inset-insert label seem to require explicit stating of the label > required. > > This is my first serious venture into the world of LFUN and I assume > I am missing something straightforward. Ultimately I can live with > the solution I have got so far but it is frustrating not to find the > necessary steps for a fully automatic solution. > > So I have three questions: > > Is there a simple command to close and apply the dialog that opens > with the sequence I have? If not, is there a different command > sequence that will do the job? Or, am I missing some other route or > setting that would achieve the same ends? I am using Lyx2.3.0 with > memoir class for this document and running on OSX Mojave. > > Many thanks > > Paul Evans The first thing that I think of when confronted with this question is to make an AWK or Python program to go through the LyX file and add an intelligently named label to each heading that doesn't yet have a label. Such a program would probably take 1 to 4 seconds to run, depending on the size of the LyX file. Obviously, you'd need to close the document in LyX before running the external program on it. SteveT Steve Litt Author: The Key to Everyday Excellence http://www.troubleshooters.com/key Twitter: http://www.twitter.com/stevelitt