In all paragraph styles, widow and orphan control should be enabled by default. Orphaned text on the top or bottom of a page is simply bad looking and bad typography. Users unaware of this setting unnecessarily produce documents with mediocre typography. There is no obvious reason why it should be off as it is now.
After installing LO, you always have to remember to activate widow and orphan control on all paragraph styles and save the new document template as default.
However, when opening an HTML page in Writer, it does not respect this setting. You have to manually re-enable widow and orphan control before you are going to save as odt file - each and every time.
thanks for the issue. Sounds good.
Should it be activated in Text Body or in Standard?
Reason for the question: how would inheritance influence other styles that are derived from Standard? Didn't look in details, but maybe it's not always desired?
fine that you find it useful.
I would say that it should be applied to both, Standard and Text Body, and it should be inherited to all other styles as well.
A long header text that is wrapped in two lines looks especially ugly when there is a page break in between. The same is true for list items, table cells, index entries, table of contents items, etc. Off my head, I simply cannot imagine a situation where an orphaned line with a few words does not look bad. Of course, if the user does not want widow and orphan control (to save space for printing), he/she should be able to go ahead and change this. I am just talking about the default, out-of-the-box-behaviour. It should be quality typography by default - and widow/orphan control is one big step in this direction.
Since, in my opinion, it is (almost) always desired, the default should be exactly the other way round as it is at the moment.
Thanks for the comprehensive explanation!
Set to New
So the control is in the Paragraph dialog
Format -> Paragraph -> Text flow: Options stanza
"Orphan control" checkbox w/default 2 lines
"Widow control" checkbox w/default 2 lines
What line settings would be used if by default is set enabled?
Also, aren't the two mutually exclusive? Orphan controls page break at end of page, while Widow controls page break at top of page.
Orphan: Specifies the minimum number of lines in a paragraph before a page break.
Widow: Specifies the minimum number of lines in a paragraph in the first page after the break. If both checked active and both at default of 2--what happens?
(In reply to V Stuart Foote from comment #4)
> What line settings would be used if by default is set enabled?
I think that the current default setting of 2 lines is suitable.
> Also, aren't the two mutually exclusive? Orphan controls page break at end
> of page, while Widow controls page break at top of page.
No, they are not. They are meant for two different things.
> Orphan: Specifies the minimum number of lines in a paragraph before a page
> Widow: Specifies the minimum number of lines in a paragraph in the first
> page after the break. If both checked active and both at default of 2--what
I also cannot remember which of both applies to the paragraph start or paragraph end. Here is what I have looked up.
Widow: If your paragraph does not fit on the page and the last line would go to the top of the next page, this setting causes the previous line also to go on the new page so that the "widowed" line (consisting probably of only one or two words) does not stand alone on top of the page.
Orphan: If only one line of your new paragraph just fits on the bottom of the page while the rest of the paragraph goes to the next page, this setting prevents that "orphaned" line on the bottom of the page and causes the paragraph to go completely to the next page.
Both settings control the page break that would happen after the first or before the last line of a paragraph, respectively.
Please also refer to Wikipedia (https://en.wikipedia.org/wiki/Widows_and_orphans)
In the past, I have always checked both options in the Paragraph dialog and it has always worked perfectly.
Created attachment 113824 [details]
ODF text document to demonstrate orphan widow function
Attached is a silly two page document can use to demonstrate effect of Orphan and Widow settings.
Select all text in document and use Format -> Paragraph -> Text flow to select either/or both Orphan or Widow.
Not sure which gets priority when both are checked active, but they don't seem to conflict. I'd agree with change that both Orphan and Widow text flow should be checked on by default.
> Not sure which gets priority when both are checked active, but they don't
> seem to conflict. I'd agree with change that both Orphan and Widow text flow
> should be checked on by default.
Fine that we agree on this aspect.
I do not believe that both settings interact in a non-predictable way. In the past 10 or more years, I never noticed any problems having both checked so I presume that the code is already working properly. It is probably best to view both features as algorithms to alter the position of the page break within a paragraph. And they both work in the same way: move an additional line (in the case of n = 2) to the next page when the respective constraint is violated.
There is only one case where they both perform changes: a paragraph covering 3 lines and the need to put a page break within the paragraph (orphan-lines + widow-lines - 1 as a general formula) This causes either 2 lines on the first, and 1 line on the second page or vice versa.
However, both cases resolve cleanly:
2 + 1 case:
a) widow rule applies moving one line to the new page
b) then, orphan rule kicks in moving the first line to the new page as well
1 + 2 case:
orphan rule applies moving the first line to the next page.
Result is the same: the entire 3-line paragraph is completely moved to the next page instead of leaving either an orphan or a widow.
The original report (widow+orphan control should be on by default) is important, perhaps especially for users who do not use styles.
The default line values should be those used in style/paragraph formatting (2 in both cases). MAYBE this could be included in LO defaults, at Writer level or above, so that those who want these controls off can set them off globally.
proposed change to implement 2-line widow/orphans by default at https://gerrit.libreoffice.org/19794
-only affects new documents.
-widow/orphan setting is saved in the .odt styles setting.
Existing documents can easily be affected by this change, so care is needed. Up to now, ODT files do not contain ANY widow/orphan style information IF the defaults were not modified. So the true "default setting" still needs to be disabled widow/orphans in order to properly render old documents. (sw/source/core/bastyp/init.cxx seems to be where the default is defined.)
Ensuring that widow/orphan settings are always included in the document's saved .odt styles ensures backward compatibility.
Widow/Orphans are default in MS Word since at least 2003. The number of lines is hard-coded to 2/not-user-adjustable in that version. So definitely 2 is the best number to choose.
From the ESC minutes:
* Widow / Orphan controls on by default (Justin)
"I would like to request that someone give official endorsement
to turning on widow/orphan controls by default for new
documents. I expect this probably fits ESC better than UI
+ replied on the list, pretty old feature & stable (Miklos)
+ just a UX decision if it should be on/off.
+ not entirely UX (Bubli)
+ changes ODF export around styles (are they default styles)
+ from the bug report (JMux)
+ default value currently not saved in the doc.
+ all old documents without this would get it on load.
+ he intends that only new docs get it (Lionel)
+ Can we store this 'on/off' setting for Microsoft docs ? (Michael S)
+ by default on since MS Word 2003 - so improves interop (Lionel)
+ all for it in general; no opinion on implementation.
+ not necessary for UX to discuss it (Kendy)
=> as long as it doesn't break old docs - happy for it to go in
with the new more interoperable default.
Justin Luth committed a patch related to this issue.
It has been pushed to "master":
tdf#89714 - enable Widow/Orphan in default style
It will be available in 5.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:
Affected users are encouraged to test the fix and report feedback.
Well, I'm sorry, but I cannot agree with this decision.
I suppose it is alright to prettify documents for "ignorant" users by turning widows/orphans on as the default; however, for someone like me who uses LibreOffice for typesetting print and PDF documents it is now something that I must always remember to turn off when starting a new document.
The reason why widows/orphans must be off is because the algorithm just frankly doesn't work as it should be working. Basically all it does now is to move a single line between pages. This is lazily wrong, as one then most times end up with a blank line at the bottom of the page from which the line was moved.
The correct way to prevent widows/orphans is to space the preceding text accordingly to either add or remove a line of text. Unfortunately this functionality is completely beyond computers (at this stage) and must be done manually. Thus keep it off by default.