3

I am asked to not break sentences so that they are on two pages. Is there a way to globally and automatically prevent sentences to be split into two pages? It should look like it would be a new paragraph. Of course, I could manually enter a blank line in front of each sentence that is split but this would be inconvenient as it has to be adapted each time new text is inserted before that sentence.

EDIT: Example code:

\documentclass{article}
\usepackage{lipsum}% MWE only

\begin{document}
%\raggedbottom
%\interlinepenalty=10000

%This is the current text:

\lipsum[1-5]

Here is a new paragraph with a sentence that is split. This is the sentence which should be completely on the next page. Here is a new paragraph with a sentence that is split. Here is a new paragraph with a sentence that is split. Here is a new paragraph with a sentence that is split. Here is a new paragraph with a sentence that is split.

\lipsum[6-7]

\clearpage

%The layout which is asked for could be produced with the following commands. However, I would like to have it automated because there are a lot of these split sentences and in addition, I would have to always recheck all these sentences if I enter new text above.

\lipsum[1-5]

Here is a new paragraph with a sentence that is split. 

\noindent This is the sentence which should be completely on the next page. Here is a new paragraph with a sentence that is split. Here is a new paragraph with a sentence that is split. Here is a new paragraph with a sentence that is split. Here is a new paragraph with a sentence that is split.

\lipsum[6-7]

\clearpage

% or:

\lipsum[1-5]

Here is a new paragraph with a sentence that is split. \linebreak This is the sentence which should be completely on the next page. Here is a new paragraph with a sentence that is split. Here is a new paragraph with a sentence that is split. Here is a new paragraph with a sentence that is split. Here is a new paragraph with a sentence that is split.

\lipsum[6-7]

\clearpage

%or

\lipsum[1-5]

Here is a new paragraph with a sentence that is split. \clearpage \noindent This is the sentence which should be completely on the next page. Here is a new paragraph with a sentence that is split. Here is a new paragraph with a sentence that is split. Here is a new paragraph with a sentence that is split. Here is a new paragraph with a sentence that is split.

\lipsum[6-7]

\end{document}
aquila
  • 149
  • I am not sure what you have to do. What do you mean by sentences on two pages? You can use \ for a line break, and \newpage for a new page. Or do you mean to prevent a sentence being split across pages? – LonLon Jan 26 '19 at 15:01
  • 1
    @FLonLon Thanks for your question. I mean to prevent a sentence being split across pages. – aquila Jan 26 '19 at 15:06
  • how to typeset Proust with such a constraint? if the whole page is part of a single sentence? if a sentence would be split across pages one has to go back to first word of sentence and insert a page break there, do I get this right? –  Jan 26 '19 at 15:06
  • @jfbu Yes, you would have to insert a page break before the first word of the sentence or begin a new paragraph which would hopefully be automatically placed at the next page. Luckily, my sentences are generally not so long. – aquila Jan 26 '19 at 15:11
  • @John_Kormylo For me, at this point, it is not important how it is achieved. Whatever is easier, reliable and more comfortable so that it can be adapted to the whole document automatically (without setting a command in front of each sentence that would otherwise be split). – aquila Jan 26 '19 at 15:30
  • The main problem is that LaTeX (TeX) formats paragraphs first, then splits them. If I understand you correctly, you want to add a paragraph break at the end of the page. – John Kormylo Jan 26 '19 at 15:31
  • Just to prevent confusion. When I write paragraph here I do not mean the command paragraph but the thing you achieve by adding a blank line with the first line indented. Such a new paragraph would be one possible solution to prevent the line to be split. But I am open to other solutions. – aquila Jan 26 '19 at 15:37
  • The TeXbook says that TeX doesn't distinguish between abbr. and a sentence ending period, and I couldn't find anything in source2e to say that LaTeX is any different. – John Kormylo Jan 27 '19 at 20:53

1 Answers1

2

This will prevent paragraphs from being split across pages.

\documentclass{article}
\usepackage{lipsum}% MWE only

\begin{document}
\raggedbottom
\interlinepenalty=10000

\lipsum[1-20]
\end{document}
John Kormylo
  • 79,712
  • 3
  • 50
  • 120
  • Thanks for your answer. This produces a lot of white space and I would prefer just to split paragraphs at the position of a page break. Also, this produced text outside of the page margins if the paragraphs were too long. Is there a possibility to automatically insert a new paragraph (i.e. split the paragraph) at the position of the page break. – aquila Jan 26 '19 at 17:13
  • your requirements are so specific, you HAVE to provide us with some of the code you are using. Johns answer is a valid answer to your [broad] question. Alternatively, check : https://tex.stackexchange.com/questions/21983/how-to-avoid-page-breaks-inside-paragraphs – LonLon Jan 27 '19 at 11:50
  • @FLoanLon I have updated the question and entered an example. – aquila Jan 27 '19 at 13:29
  • It occurred to me that adding an equation will split a sentence into 2 or more paragraphs. – John Kormylo Jan 27 '19 at 20:25
  • Can you please explain what you mean with an equation? Do you mean a mathematical expression? Probably, I still would have to add the equation manually to the page breaks, rigth? – aquila Jan 27 '19 at 23:22
  • I mean \begin{equation} ... \end{equation} or \[ ... \] or even $$ ... $$. There is no penalty for breaking a page between paragraphs, so you cannot stop it short of putting the entire thing into a box (e.g. \parbox). – John Kormylo Jan 28 '19 at 03:25
  • @JohnKormylo Thanks for clarification and help! I would need a penalty of breaking a sentence. I am fine with breaking a paragraph as long as the "breakpoint" is the ending of a sentence ".". – aquila Jan 28 '19 at 14:05
  • What I am saying is that LaTeX doesn't know what a sentence is. It only knows paragraphs and lines of text, You would first have to tell LaTeX where each sentence ends, which does not fit the "automatic" requirement. – John Kormylo Jan 28 '19 at 14:53