Bug 112384 - Chapter Numbering: Allow line breaks for "separator, after" in the Chapter Numbering dialog
Summary: Chapter Numbering: Allow line breaks for "separator, after" in the Chapter Nu...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Nithin
URL:
Whiteboard: target:6.1.0
Keywords:
Depends on:
Blocks: Chapter-Numbering
  Show dependency treegraph
 
Reported: 2017-09-14 10:14 UTC by RGB
Modified: 2018-05-27 04:45 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample file with a manually inserted two line heading (9.80 KB, application/vnd.oasis.opendocument.text)
2017-10-28 18:22 UTC, RGB
Details

Note You need to log in before you can comment on or make changes to this bug.
Description RGB 2017-09-14 10:14:53 UTC
Two line headings for chapters are quite common. In fact they are default on all "book" documentclasses for LaTeX. They usually display like this

  Chapter 1
  The Chapter Name
  
  Body text.

usually with the fist line displaying a different format than the chapter name.

On Writer it is possible to get quite close to this format but for a single point: there is no way to insert an automated line break between chapter number and chapter name, it needs to be manually added each time. 

Hence the enhancement proposal: in addition to normal text allow the use of a line break control on "separator, after".

Note: AFAIK, on ODT line breaks are created with the tag <text:line-break/>. I tried to edit the styles.xml to manually add that tag on the heading style definition but then Writer complains of a badly formatted file. It seems that the file format do not allow control tags on the "separator, after" field so maybe there is a limitation on ODT format that prevents this, but I do not know enough of ODF to be sure.
Comment 1 Buovjaga 2017-10-28 15:02:16 UTC
Sounds good, but could you mention in what feature this would be added? Table of contents or something else?
Comment 2 RGB 2017-10-28 18:22:54 UTC
Created attachment 137343 [details]
Sample file with a manually inserted two line heading

@Buovjaga just for chapter numbering. See the attached sample file: the two line heading you'll find below the TOC has a *manually* inserted line break to get two lines as described on comment 0. This enhancement request is about gaining the ability to set that line break *as part of the outline numbering* so it's inserted *automatically*.
Comment 3 Dieter Praas 2017-10-29 08:07:40 UTC
I confirm this enhancement.

Tools => Cahpter Numbering. An option for line break as a separator after is missing


Version: 6.0.0.0.alpha1 (x64)
Build ID: c1d1f859b268f650143d48f294999cda0fa57350
CPU threads: 4; OS: Windows 10.0; UI render: default; 
Locale: de-DE (de_DE); Calc: group
Comment 4 Nithin 2018-04-07 14:30:35 UTC
I plan to try to implement this during the Hamburg Hackfest.
Comment 5 Commit Notification 2018-04-08 14:57:42 UTC
Nithin Kumar Padavu committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=4f5928ea8022d879764cc882f01a1b642645d66f

tdf#112384 sw: Allow New line as a label followed by chapter numbering

It will be available in 6.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Cor Nouws 2018-04-08 19:15:31 UTC
nice - thanks! esp. Nithan!
Comment 7 Roman Kuznetsov 2018-04-08 20:25:53 UTC
what distance will be between first and second line  of Heading in this case?
I inserted line break in option ... and?
Comment 8 Nithin 2018-04-09 14:33:47 UTC
A big thanks to Miklos and Michael for helping me in the Hackfest. Specially to Miklos for helping with basic cpp, git and Linux Commands.

The distance between the First and Second line of the Heading will depend upon the Paragraph Format settings specified in "Heading #".

Will fix the Preview as well and commit a patch this week.
Comment 9 Roman Kuznetsov 2018-04-09 14:48:55 UTC
(In reply to Nithin from comment #8)
> A big thanks to Miklos and Michael for helping me in the Hackfest. Specially
> to Miklos for helping with basic cpp, git and Linux Commands.
> 
> The distance between the First and Second line of the Heading will depend
> upon the Paragraph Format settings specified in "Heading #".
> 
Will it be a new option?

Or you talk about existing options in dialogue Paragraph style? What is option?
Comment 10 Nithin 2018-04-09 19:15:16 UTC
In the Tools>Chapter Numbering> Position Tab

There will be a new option in the dropdown list "Numbering followed by:" called New Line.
Comment 11 Commit Notification 2018-04-09 22:54:57 UTC
Adolfo Jayme Barrientos committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/help/commit/?id=bea85ade6e8110f9b944840edcf65d405c6946ac

tdf#112384 Mention the new possibility of adding a line break as separator…
Comment 12 Rizal Muttaqin 2018-05-05 16:19:33 UTC
(In reply to Nithin from comment #10)
> In the Tools>Chapter Numbering> Position Tab
> 
> There will be a new option in the dropdown list "Numbering followed by:"
> called New Line.

Unfortunately in the preview box there's no changes. It would be nice if we add them to see the differences.
Comment 13 Dieter Praas 2018-05-05 17:34:56 UTC
(In reply to Rizal Muttaqin from comment #12)

> Unfortunately in the preview box there's no changes. It would be nice if we
> add them to see the differences.

I agree. But since the reported issue is fixed, I think it will be better to open a new bug report for that.
Comment 14 Nithin 2018-05-13 07:56:37 UTC
The code for the Preview is also submitted. But there was some problem in i being able to see the changes and the others not. So checking what is the problem now.
Comment 15 Nithin 2018-05-26 13:40:15 UTC
Reviewed the code again today. Opened a bug report for it. Hope someone can shed light on how the behavior should be. Bug 117818
Comment 16 Nithin 2018-05-26 13:41:31 UTC
The preview is broken in the current version as well.