Ask Your Question
0

How to display indent level numerically [closed]

asked 2017-10-20 22:16:41 +0100

radbobdad gravatar image

updated 2017-10-20 22:17:30 +0100

I want to create something like a numbered list, but where the item number reflects the indent level. This is to represent a multi-branching hierarchy of questions. Example:

1 Why am you confused?
  Because I am a newbie
  2 Why are you a newbie?
    Because I don't write a lot of documents and have never had to do this before
     3 Why don't you write a lot of documents?
        Because that's not my main job function
       4 Why is that not your main job function?
          Because I find it mind-numbing and I have pursued a career where I mostly do other things
          5 Why do you find it mind-numbing?
             Because it's not analytical enough for me
          5 Why have you pursued a career where you mostly do other things?
             Because I find writing mind-numbing
     3 Why have you not had to do this before?
        Because this is never come up
        4 Why has this never come up?
           Because I mostly write simple documents
           5 Why do you mostly write simple documents?
              Because I want to get it over with as quickly as possible

I want the lines auto-numbered based on indentation level. Is there an easy way to do this in LibreOffice?

(extra points if you can guess from this example what company I work for)

Thanks, Bob

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2020-10-18 16:32:58.512927

3 Answers

Sort by » oldest newest most voted
0

answered 2017-10-21 00:08:44 +0100

RGB-es gravatar image

You can "hack" a bullet list to provide such order. First insert a normal bullet list. Then go to its configuration and then to the Customize tab to finally choose the character for the "bullet": just pick the proper number for each level as "symbol"

image description

edit flag offensive delete link more

Comments

This proved to be very simple, if not very flexible (I've decided I'd prefer to use "1." for example instead of "1").

radbobdad gravatar imageradbobdad ( 2017-10-21 01:15:43 +0100 )edit

This is the proper way of doing it. You can even refine the solution by defining a dedicated paragraph style linked to a so-called list style to only need to "type" your paragraphs with this single paragraph style, thus minimising manual fiddling on text.

ajlittoz gravatar imageajlittoz ( 2017-10-21 08:04:01 +0100 )edit
0

answered 2017-10-21 01:18:06 +0100

radbobdad gravatar image

I also posted this question and got an additional answer here:

https://forum.openoffice.org/en/forum...

But that's still more work than hacking the bullet list as suggested by RGB-es

edit flag offensive delete link more
0

answered 2017-10-21 00:57:41 +0100

Lupp gravatar image

updated 2017-10-21 01:04:58 +0100

The attached example is containing the code I sketched.

Sub aboutParaIndent()
indentStep = 1250 
REM (1.25cm) 1251 actually for unknown reasons in Writer.No effect in this context.
REM I don't know a way to change the value.
REM If you know one and made a change, you need to set the correct value above.
theDoc  = ThisComponent
theText = theDoc.Text
theParaEnum = theText.CreateEnumeration
Do While theParaEnum.HasMoreElements
    thePara = theParaEnum.NextElement
    theTC = theText.CreateTextCursorByRange(thePara)
    theTC.GotoStartOfParagraph(False)
    theText.InsertString(theTC,""&Format((thePara.ParaLeftMargin \ 1250) + 1,"00") & ": ",False)
Loop    
End Sub
edit flag offensive delete link more

Comments

Thanks, but this is way over my head. I don't know how to add code to LiberOffice.

radbobdad gravatar imageradbobdad ( 2017-10-21 01:14:19 +0100 )edit

Question Tools

1 follower

Stats

Asked: 2017-10-20 22:16:41 +0100

Seen: 88 times

Last updated: Oct 21 '17