Ask Your Question
1

Indent on paragraph first line

asked 2012-08-20 21:34:45 +0200

Maynar gravatar image Maynar
13 1 3

updated 2013-04-20 18:04:28 +0200

manj_k gravatar image manj_k
5947 4 35 53

Paragraphs in LibreOffice Writer support indentation for the first line of the paragraph, but I'm looking for a little more flexibility.

When the paragraph is the first on a page after a heading or when a paragraphs are separated by a blank line I don't want this to happen.

Think of a book, that's the result I'm trying to accomplish. In the example below the Lorem ipsum text is a little short, to keep it simple.


[First paragraph: no indent]
Lorem ipsum dolor sit amet, consectetur adipiscing elit.  
  [Second paragraph: indent]
  Praesent fringilla ipsum ut dolor egestas blandit. Integer convallis pharetra sollicitudin.

[First paragraph after white line: no indent]
Cras ut rutrum risus. Integer non massa urna.  
  [Second paragraph: indent]
  Quisque turpis sapien, tincidunt sed hendrerit iaculis, semper vel leo.

I'm using the Text body style, first line indentation on Automatic, no spacing above and below paragraphs.

Any ideas on how to accomplish this without going through every page to set this style manually? Is there some conditional setting I missed or is there another approach to accomplish this?
It's some 300 pages I have to apply this to so I'd rather not go through that.

delete close flag offensive retag edit

Comments

@tohuwawohu (I can't seem to find a way to directly comment on your answer...) It is the solution I need, but like I said I can't go through the 300 pages and apply them on every occurence.

Maynar ( 2012-08-22 14:02:03 +0200 )edit

@tohuwawohu Also I'm not entirely sure what you meant with the WhiteLinePar. Would I have to apply a special style to a white just so the next one is without indentation? Is there a way I could apply that to all white lines in one go?

Maynar ( 2012-08-22 14:04:41 +0200 )edit

Using a dedicated paragraph style for the empty lines was just one idea how to make LO insert the FirstPar style automatically. A "cleaner" solution would be to have two FirstPar styles with different top spacing. To apply the styles automatically afterwards, i fear you'll need a macro.

tohuwawohu ( 2012-08-22 15:01:55 +0200 )edit
2

@tohuwawohu made two macros, one for searching for the next paragraph (regular expression ^$) and one to select and replace the text body style with a new custom style. Takes a few minutes to work through the entire document, but it's a lot better than doing everything manually. Thanks for the help!

Maynar ( 2012-08-22 19:24:59 +0200 )edit

Great - i'm very happy to hear that you found a solution!

tohuwawohu ( 2012-08-22 21:06:54 +0200 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2012-08-21 07:17:40 +0200

tohuwawohu gravatar image tohuwawohu flag of Germany
1812 13 40

Generally, you could do this using different paragraph styles and using the "Next Style" setting. Just create another "FirstPar" paragraph style with no indentation, based on the default paragraph style. Then, set the "FirstPar" as "Next Style" in the heading style, and set the default paragraph style as "Next Style" in the "FirstPar" Style:

Heading ---> FirstPar ---> DefaulPar

Same with white line:

WhiteLinePar ---> FirstPar ---> DefaultPar

Now, the problem is applying those styles to your existing documents. IMHO this is the "real" problem, since if you change the "Next Style" setting for a given style, the "next Style" won't get applied automatically - it seems to work only if entering a paragraph break using the "Enter" key. Maybe someone knows how to propagate changes of "Next Style" settings to existing content.

link delete flag offensive edit

Login/Signup to Answer

Donate

LibreOffice is made available by volunteers around the globe, backed by a charitable Foundation. Please support our efforts: Your donation helps us to deliver a better product!

Question tools

Follow
1 follower

subscribe to rss feed

Stats

Asked: 2012-08-20 21:34:45 +0200

Seen: 398 times

Last updated: Aug 21 '12