Wednesday, September 3, 2014

You have a longtable that continues over several pages and you want "continued" or the like on those


You have a longtable that continues over several pages and you want "continued" or the like on those subsequent pages. ccaption doesn't help because it's limited to captions but perhaps you want it in a header or footer. afterpage doesn't work at all inside a longtable. You have to resort to hacking longtable.sty. I don't understand the syntax of .sty files either, but somehow I was lucky. Around 97% there's a bit that says: \else \setbox\@cclv\vbox{\unvbox\@cclv\copy\LT@foot\vss}% \@makecol \@outputpage \global\vsize\@colroom \copy\LT@head\nobreak \fi} which you change to: \else \setbox\@cclv\vbox{\unvbox\@cclv\copy\LT@foot\vss}% \@makecol \@outputpage \ontablecontinued %THE HOOK GOES HERE \global\vsize\@colroom %JUST FIXED THE POINTLESS INDENT \copy\LT@head\nobreak \fi} Then in your main .tex file you write something like: \lhead{My Table} \newcommand{\ontablecontinued}{\lhead{My Table continued}} (or whatever else you want to do) before you start the longtable. Before coolbot any subsequent tables you'd put both of those again but use \renewcommand instead of \newcommand. That's it. Notice I put the hook right after the call to \@outputpage. There's another one about 12 lines above but I'm not sure what it's for. Some folks might need to put the hook there as well or instead. BTW: longtable.sty was somewhere coolbot under /usr/share on my vanilla texlive distro. coolbot
▼  2013 (11) ►  October (2) ►  August (2) ►  June (2) ►  May (2) ►  April (2) ▼  March (1) Latex trick: longtable continuation indication ►  2012 (6) ►  December (1) ►  September (1) ►  coolbot August (1) ►  July (2) ►  June (1) ►  2011 (1) ►  December (1) ►  2010 (1) ►  January (1) ►  2009 (8) ►  September (8)
1 year ago


No comments:

Post a Comment