"flatten" branch insets

Jean-Marc Lasgouttes lasgouttes at lyx.org
Thu Mar 31 16:42:47 UTC 2022


Le 31/03/2022 à 17:03, Scott Kostyshak a écrit :
> I have some documents with many branches. For example, when I write a
> recommendation letter there are some shared elements across my letters
> where I describe the class the student took with me, etc. The branches
> handle which class the student took for me, whether they are undergrads
> or grads, and whether they are applying to graduate programs or jobs.
> 
> My workflow is to copy a "base" letter, activate the relevant branchs,
> and to then write the elements of the letter that are specific to the
> student. In this workflow, I would find it useful to be able to
> "flatten" the document, in the sense of deleting all branch insets that
> are not activated, and dissolving all branch insets that are activated.
> Note that this would work on the branch *inset* level since some insets
> of the same branch might be activated and others not because of our
> "invert" feature.
> 
> Would anyone else have use for such a workflow? I would guess not. But
> would a patch likely be accepted that just implements the LFUN? I could
> use the patch locally, so if someone prefers not to add such an uncommon
> feature, I would understand.

If we decided to have branch inset layout() return Branch:<name>:active 
or Branch:<name>:inactive, one could do that with something like
inset-forall Branch:*:active inset-dissolve
inset-forall Branch:*:inactive char-delete-forward

I guess there are some part of code that are not ready for that, but in 
general it should work.

And branches could have a color/font that depends on the state.

JMarc



More information about the lyx-devel mailing list