12

One is taught that \\* is an alternative to the line-breaking \\ that tries (often unsuccessfully) to inhibit a page break. Normally \\* would be used in ordinary ("body") text.

(And I hereby acknowledge user egreg's admonition that "\\* should not be used".)

What about footnotes? Does the use of \\* instead of \\ have any effect within footnotes? (And what about \nopagebreak?)

The justification for asking whether \\* works in footnotes like it does in body text is that under a naive but sensible understanding of LaTeX, someone might think that "one page has exactly one pagebreak, so that's probably the pagebreak in the body text and not anything within some footnote".

In the following code

\documentclass{article}
\usepackage{lipsum}


\begin{document}

\lipsum[1-4]\footnote{
  no asterisk \\ asterisk \\*
  no asterisk \\ asterisk \\*
  no asterisk \\ asterisk \\*
  no asterisk \\ asterisk \\*
  no asterisk \\ asterisk \\*
  % the pagebreak happens here
  last line}
\lipsum[5]

\end{document}

the use of \\* seems to have no effect (it's the same as if I had used \\ in all five places; note that keeping only the fifth \\* doesn't prevent that particular page break either)

pagebreak within footnote

but who knows why. (I am showing the bottom left of the first page of the 2 output pages.)

  • While \\* issues \nobreak, it also issues \break, so I don't think really there's any concrete attempt to not keep subsequent text together. – Werner Apr 20 '14 at 5:26
  • @Werner The \break you refer to is issued in horizontal mode and is essntial for \\ to work; \nobreak, on the other hand, is issued in vertical mode. – egreg May 6 '14 at 21:16
8

The problem is not related to footnotes. This is explained in the beginning of my answer to a derived question. What follows is a shortened version of that answer; it's a fix that works in body text as well as footnotes:

The problem is the automatically inserted \interlinepenalty. It is usually smaller than 10000 and allows a page break even if it is preceded by a \nobreak (= \penalty10000).

The following uses a workaround. Instead of ending the line, the paragraph is ended. Then the effects of \parskip and \parindent need to be reversed and avoided:

\documentclass{article}
\usepackage{lipsum}

\newcommand*{\NLS}{%
  \par
  \nobreak
  \vspace{-\parskip}%
  \noindent
  \ignorespaces
}

\begin{document}

\lipsum[1-4]\footnote{
  no asterisk \\ asterisk \NLS
  no asterisk \\ asterisk \NLS
  no asterisk \\ asterisk \NLS
  no asterisk \\ asterisk \NLS
  no asterisk \\ asterisk \NLS
  last line}
\lipsum[5]  

\end{document}

page1 page2

  • As \NL can easily be read as "newline", perhaps rename the macro to something suggestive of a pagebreak prohibition? I am not sure what may be best; if verbosity doesn't matter, \linebreaknopagebreak would work. – Lover of Structure May 11 '14 at 8:25
  • @LoverofStructure: I have renamed it to \NLS (New Line with Star). Something like \SimulatedLineBreakWithNoPageBreak is a little long, isn't it? – Heiko Oberdiek May 11 '14 at 9:52
  • 1
    @LoverofStructure: The problem is not related to footnotes. – Heiko Oberdiek May 11 '14 at 9:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.