Re: Adding label to all headings automatically

2019-09-24 Thread Dr Eberhard Lisse
LyX also proposes a name if you manually add a label, so there must be
programming logic for the naming.  

If one could find that, and then use it for a script as below (probably
Python :-)-O) it might be really simple to implement :-)-O

Actually LyX notices if a document changes (for example when using RCS)
and then offers a reload :-)-O

el

On 19/09/2019 14:39, Steve Litt wrote:
[...]
> 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
[...]



Re: Adding label to all headings automatically

2019-09-19 Thread Steve Litt
On Thu, 19 Sep 2019 10:18:55 +0100
Paul Evans  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



Adding label to all headings automatically

2019-09-19 Thread Paul Evans
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