Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Say, that you have a footnote which is printed in page 1 and 2. How can you put a mark, say $\rightarrow$ at the end of the footnote text in page 1 and at the start of the footnote text on page 2, automatically.

share|improve this question
5  
It's quite hard. It's very hard to change the line breaking around a page break so the decorations would need to be added outside the normal text block, you can't really add the continuation marker within the existing lines. Probably the easiest way is to add a special strut 1sp larger than a normal strut into the end of the footnote, then if the footnote box does not have that depth you know it was split so can add the markers. –  David Carlisle Oct 22 '12 at 9:26
    
@David: can you make this into an answer with some code so that I can accept it? –  Vafa Oct 22 '12 at 10:12
    
I made it an answer, it probably requires more code than I can really do during working hours. I won't be offended if you accept someone else's answer if they actually code it up:-) –  David Carlisle Oct 22 '12 at 10:17
1  
While this does not answer your question, you might want to have a look at the fnbreak package, which "detects footnotes that are split over several pages, and writes a warning to the log file" (ibid.). –  Stephen Oct 25 '12 at 18:10

1 Answer 1

up vote 6 down vote accepted
+50

It's quite hard. It's very hard to change the line breaking around a page break so the decorations would need to be added outside the normal text block, you can't really add the continuation marker within the existing lines. Probably the easiest way is to add a special strut 1sp larger than a normal strut into the end of the footnote, then if the footnote box does not have that depth you know it was split so can add the markers

enter image description here

\documentclass{article}
\makeatletter

\newdimen\ftnflag
\AtBeginDocument{{\footnotesize\selectfont\global\ftnflag\dp\strutbox\global\advance\ftnflag1sp\relax}}


\let\old@makefntext\@makefntext
\def\@makefntext#1{\old@makefntext
#1%
\dp\strutbox\ftnflag
\@finalstrut\strutbox}%


\gdef \@makecol {%
   \ifvoid\footins
     \setbox\@outputbox \box\@cclv
   \else
     \setbox\@outputbox \vbox {%
       \boxmaxdepth \@maxdepth
       \unvbox \@cclv
       \vskip \skip\footins
       \color@begingroup
         \normalcolor
         \footnoterule
\ifx\splitftn\vbox
\hbox{\smash{\raise-\baselineskip\hbox{\llap{$\rightarrow$}}}}%
\fi
\global\let\splitftn=\null\relax
\typeout{dp \the\dp\footins, dpstrut \the \dp\strutbox}%
  \ifdim\dp\footins<\ftnflag
  \global\let\splitftn=\vbox
  \fi
         \unvbox \footins
    \ifx\splitftn\vbox
\nobreak
\vskip-\ftnflag
       \hbox{\rlap{\kern\textwidth$\rightarrow$}}%
\else
\fi
\color@endgroup
       }%
   \fi
   \let\@elt\relax
   \xdef\@freelist{\@freelist\@midlist}%
   \global \let \@midlist \@empty
   \@combinefloats
   \ifvbox\@kludgeins
     \@makespecialcolbox
   \else
     \setbox\@outputbox \vbox to\@colht {%
       \@texttop
       \dimen@ \dp\@outputbox
       \unvbox \@outputbox
       \vskip -\dimen@
       \@textbottom
       }%
   \fi
   \global \maxdepth \@maxdepth
}

\makeatother


\addtolength\textheight{-10\baselineskip}

\def\a{One two three four five six. }
\def\b{\a\a Red green blue}
\def\c{\b\b\b\footnote{\itshape\b \roman{footnote}\b\a\b\b\b}\a\b\par A B C D \b\a\a\a\a\a\a\b}
\begin{document}

\c\c\c\a\b\c\c\c\b\a\c

\end{document}
share|improve this answer
    
Can you please add an example in your answer? –  Vafa Oct 25 '12 at 0:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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