Tag Info

Hot answers tagged

22

LaTeX is set up to avoid this if possible but sometimes there just isn't a good alternative. You can suppress widow lines entirely with \widowpenalty=10000 but you'll want to have \raggedbottom enabled. Avoiding widow words isn't as directly straightforward. You cannot automatically suppress them but you can specify that you want a final line of at least ...


18

this was addressed by Knuth in a q&a session in st. petersburg, florida, published in tugboat: - TUG'95: Questions and Answers with Prof. Donald E. Knuth, pp.18 (bottom of column 2) - 20; the session was republished in Digital Typography, with the relevant question starting on p.594. the page-breaking problem was also the subject of Michael Plass' ...


12

Yes, this is possible if you are prepared to accept a certain level of false positives. Basically for both cases special penalties are used by TeX and those can be recognized in the output routine. So my code below sets the value for \widowpenalty to 151 and \clubpenalty (orphans) to 152 (the LaTeX default is 150). The we use the following code: ...


12

In a book like the one you are writing that primarily deals with textual information, the TeX engine has to balance two conflicting constraints. Achieving a flushbottom layout Avoiding widows and orphans If the baselineskip is set at a fixed size - which is the norm - the page can only contain so many multiples of this, say 30 lines of text. Depending ...


12

TeX assigns a badness to each line. Widows and orphans are bad and TeX tries to avoid them whenever possible. However, if avoiding the widow or orphan causes something else to be even more bad, TeX will insert the widow or orphan. You can tell TeX that these are infinitely bad by using \widowpenalty=10000 \clubpenalty=10000 TeX still might insert these ...


11

The Memoir manual, in section 3.5 "Sloppybottom" discusses this in some detail, which I won't reproduce here. Be prepared even to re-word in the most intractable cases. Update: I think the specific commands like \enlargethispage and \sloppybottom are exclusively for the memoir package, but here's a snippet extracted from the aforementioned that you may ...


11

The geometry package has nothing to do with widows and orphans. In your example a widow is created because of the display. Some remedy can be applied, but only when the text of your document is in final form. For example, adding a line to an "almost full" long paragraph may avoid an orphan or a widow Some long paragraph that ends almost flush ...


10

I fear the answer is that with 2e's \marginpar this is the expected behavior. The reason for this is that LaTeX2e implements marginal notes by calling the output routine after the current line. Then in the OR it will look at the current status of the page and attach the marginal accordingly, i.e., on the left or right. It then returns the constructed ...


10

As Brent points out, you cannot always do this. The best you can do is to tell TeX that it's infinitely bad for these to appear: \widowpenalty10000 \clubpenalty10000 One thing to keep in mind is that when presented with multiple infinitely bad options, TeX just picks one of them so you can still get widows or orphans.


9

Using \leaders you can define a rule that will "disappear" at the beginning of a page: \documentclass{article} \usepackage[paperheight=7cm,textwidth=18cm]{geometry}% just for the example \newcommand\Myrule{% \par\leaders\vrule width \textwidth\vskip0.4pt\par\nobreak } \begin{document} \vspace*{3.64cm} % Adjust as necessary ...


9

With the version 2.02 you need the following modification. I can think about a new implementation step to reduce the overlapping. \makeatletter \def\tcb@split@lower@box{% \vfuzz=\maxdimen\vbadness=10000% \setbox\tcb@lowerbox=\vsplit\tcb@totallowerbox to\tcb@split@dim% \setbox\tcb@lowerbox=\vbox{\unvbox\tcb@lowerbox}% ...


8

I would say it is a bug. It also already reported (but neither analyzed nor solved): http://www.latex-project.org/cgi-bin/ltxbugs2html?pr=latex/4065 Rougly I would say that the problem is that in a list (quote is list) the \item doesn't start a paragraph and so the everypar trickery of the list and the section clash.


8

\@nobreaktrue is the correct way to do this. The reason it works is that the quote environment eventually does something like \everypar{% \if@nobreak \@nobreakfalse \clubpenalty=10000 \else \clubpenalty=150 \fi } so your \clubpenalty is being overridden. To answer your other questions, \@nobreaktrue expands to ...


7

It seems you set \widowpenalty=10000 in your class, and this penalty also applies to dblfnotes footnotes. Resetting the penalty to its LaTeX default value of 150 corrects the "problematic" column break. You could also use the etoolbox package to patch the \footnote command and reset widowpenalty only for footnotes. \documentclass[ twocolfnotes, ...


7

As TH wrote, your situation would pick up a \widowpenalty due to being a single line of a paragraph on a new page. It is also penalized as a page break after a hyphenation by \brokenpenalty and by \finalhyphendemerits for being a hyphenated second-to-last line of the paragraph. If any or all of these are set to sufficiently large values, then your bad break ...


7

For a one-off final editing correction rather than changing the setting of all such citations you could use \mbox{\cite{foo,bar}} But I doubt there is enough flexibility in the shown line to find good line and page break in that case. It might be better (if re-wording isn't an option) to allow the line to break there but use ...


7

The widow line is formed in your paragraph text before the signature code really starts so you need to prevent them at that level (I just set widowpenalty to be infinite here) The signature code was making overfull box warnings so I modified it a bit, unrelated to the question. \documentclass{memoir} \usepackage{lipsum} % signature % ~~~~~~~~~ % ...


6

There are possibilities but it is a bit difficult to achieve. The listingspackage contains many hooks but unfortunately none that actually allows implementing this directly (at least I couldn't see one after some quick reading). Problem is that each line in a listing is effectively a single paragraph and so there is some \parskip between the lines that make ...


6

The package bigfoot provides much better footnote breaking facilities than the default. Loading it alone will often fix bad breaking issues. By default it also defines: \newcount\footnotewidowpenalty \footnotewidowpenalty=250 \newcount\footnoteclubpenalty \footnoteclubpenalty=250 \newcount\finalfootnotewidowpenalty \finalfootnotewidowpenalty=4000 ...


6

You really don't want to do this;-) \documentclass{article} \textheight4.5\baselineskip \usepackage{lipsum} \begin{document} \flushbottom \baselineskip=1\baselineskip plus 12pt minus 2pt\relax \showthe\baselineskip \lipsum \end{document} If you remove the plus component and only have the minus component then TeX will only squeeze and never shrink. ...


5

I can't see any problems with setting \postdisplaypenalty globally—if you encounter any problems, they are probably signs of a package bug. The default values are probably fine for Knuth; but these settings are implemented as parameters because you should customize them.


5

If you want to change the value of \widowpenalty in the footnotes only, you can say \patchcmd{\@footnotetext}{\dfn@latex@footnotetext{#1}} {\dfn@latex@footnotetext{\widowpenalty150 #1}}{}{} after having loaded dblfnote (requires etoolbox). Note also that the setting \clubpenalty in your class is not correct, as LaTeX changes the value of this parameter ...


5

In the chatroom David Carlisle and egreg helped me to point out the issue. Thanks for your engagement. After \section normally you don't have any breaks avoiding orphans. Normally implies we have exceptions. To allow colour specification you are buying an unwanted breakpoint. To demonstrate this I use the following example: \documentclass{article} ...


4

Placing the SOURCE in a \parbox[<v-align>]{<width>}{<stuff>} allows you to display it in a paragraph with \raggedleft justification (similar to flushright). It also allows for less of a separation between the QUOTE and SOURCE. Together with \nobreak, the following minimal example hopefully produces what you want: \documentclass{article} ...


4

The normal way to control orphans is to adjust the \clubpenalty variable. Try to set it to an higher value. See http://www.tex.ac.uk/cgi-bin/texfaq2html?label=widows for more information. If you want to use \Needspace*{} I would assume that 4\baselineskip is reasonable for the heading title plus two text rows. I'm simply counting the bigger heading title ...


4

This class file dates back more than 20 years and was written for LaTeX 2.09 and then patched somewhat to run under todays LaTeX. It is a rather good example of how should things not be done these days :-) the power of LaTeX to still be able to somehow deal with really old code If there is any chance to convince the conference organizers to have ...


4

It is surely impossible to have all of the following conditions: No clubs/widows TeX must not change the paragraph Number of lines must be fixed Since TeX breaks paragraphs before looking at pages, it has no chance to redo 2). With LuaTeX you could probably cook your own automatic solution, but this is pretty much the opposite of 'trivial'. In PDFTeX ...


4

I am the author of tcolorbox and I have just uploaded version 2.22 to CTAN. This new version removed (some/most) of the addressed problems. "There are unwanted blank pages" I found the cause of the problem and (hopefully) eliminated it. Since the breaking of the upper part / lower part features of tcolorbox is sometimes a little bit tricky, I may have ...


3

I can't answer why \clubpenalty fails and \@nobreaktrue works, but here an alternative solution: You can use the needspace package to force a pagebreak before the quote if the space isn't enough for two lines: \usepackage{needspace} \newenvironment{noorphanquote}{\Needspace*{3\baselineskip}\begin{quote}}{\end{quote}} Here 3\baselineskip is used for the ...


3

I'm not entirely sure what “pagination” means here. But to encourage page-breaks between paragraphs (instead of, well, lines), and to retain vertical harmony (which isn't grid, per se), one could try: \baselineskip=13pt % or whatever \lineskip=13pt % stretchability removed \raggedbottom % lest one gets bad vboxes \interlinepenalty=1000 % discourage ...



Only top voted, non community-wiki answers of a minimum length are eligible