Shift between levels of bullet

Hi all,

May I know if there is a way to quickly shift level of indentation of the item bullets (like Tab and Shift+Tab does in usual word processing software). I tried Meta + Tab but to no avail.

Thanks!

1 Like

The beginning of an answer is

(kbd-map ("C-tab" (with t (tree-ref (cursor-tree) :up) (tree-set! t (stree->tree `(itemize (document ,(tree->stree t))))))))

If the cursor is in an item, where there is already some content, pressing ctrl-tab will add one level.
The command takes the current item (including the item tag) and places it inside an itemization environment; I found out the structure of the itemization environment by copying one, that included a few times, to Scheme (menu Edit->Copy to->TeXmacs Scheme).
I have the feeling that the tree might also be composed without passing through Scheme trees, but I haven’t been able to.

To turn this into an answer one needs to add the function to decrease the indent, make the functions that increase and decrease indent work also when there is no content in the item and also make the command active only when in an itemization list.
The function to decrease the indent looks to me more complicated because—I think—if other items are present in the list, it needs to “break” the list to preserve their level.

I will try, but I will be slow. Maybe someone else has suggestions.

2 Likes

Isn’t the answer here?

Good find! At first sight it looks brilliant. Maybe the op of this thread wants to test it (the readme—section Limitations & Warning—says to use it on non-critical documents).

Yeah it looks promising, but I tried according to the instructions, and nothing shows up on the toolbar after loading the plugin. I did not copy to wrong folder, since “Outline” already appear in Help->Plug-Ins.

I will also try it and will let you know here. Otherwise I will complete coding what I had in mind (hopefully :slight_smile: )

1 Like