Advertisement
Guest User

Untitled

a guest
Oct 26th, 2012
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 1.72 KB | None | 0 0
  1. \documentclass{article}
  2. \textheight.3\textheight
  3. \paperheight.5\paperheight
  4. \pdfpageheight\paperheight
  5.  
  6. \usepackage{longtable}
  7. \makeatletter
  8. \def\foopage#1#2{\global\expandafter\let\csname foopage-#1-#2\endcsname\@empty}
  9.  
  10. \let\foolist\@empty
  11. \def\foodef#1#2{%
  12. \g@addto@macro\foolist{{#1}}%
  13. \@namedef{foo-#1}{#2}}
  14.  
  15. \def\foocite#1{%
  16. \textsuperscript{#1}%
  17. \let\reserved@a\relax
  18. \protected@write\@auxout{}{\string\foopage{#1}{\thepage}}%
  19. }
  20.  
  21. \def\fooloop{%
  22. \expandafter\@tfor\expandafter\tmp\expandafter:\expandafter=\foolist\do{%
  23. \expandafter\ifx\csname foopage-\tmp-\thepage\endcsname\@empty
  24. \insert\footins{%
  25.     \reset@font\footnotesize
  26.     \interlinepenalty\interfootnotelinepenalty
  27.     \splittopskip\footnotesep
  28.     \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
  29.     \hsize\columnwidth \@parboxrestore
  30.     \textsuperscript{\tmp}\csname foo-\tmp\endcsname}%
  31. \fi
  32. }}
  33.  
  34.  
  35. % add the insert loop
  36. \def\foopatch#1\output#2{%
  37. \def\LT@start{#1\fooloop\output{\LT@output}}}
  38. \expandafter\foopatch\LT@start
  39.  
  40.  
  41. \def\foopatch#1\copy\LT@head\nobreak#2{%
  42. \def\LT@output{#1\copy\LT@head\nobreak\fooloop#2}}
  43. \expandafter\foopatch\LT@output
  44.  
  45.  
  46. \begin{document}
  47.  
  48.  
  49. \foodef{A}{Something about A.}
  50. \foodef{i}{Something equally dull about i.}
  51. \foodef{w}{In case you missed $x$ $y$ and $z$, here's $w$. I repeat, here's $w$. Actually, forget about $y$, $w$ seems to be the key. And, to tell You the truth, I don't really like $x$. }
  52.  
  53.  
  54. \begin{longtable}{ll}
  55. aaaa&bbb\\
  56. aaaa&bbb\\
  57. aaaa&bbb\foocite{A}\\
  58. aaaa&bbb\\
  59. aaaa&bbb\\
  60. aaaa&bbb\foocite{i}\\
  61. aaaa&bbb\\
  62. aaaa&bbb\\
  63. aaaa&bbb\\
  64. aaaa&bbb\\
  65. aaaa&bbb\foocite{w}\\
  66. aaaa&bbb\\
  67. aaaa&bbb\\
  68. aaaa&bbb\\
  69. aaaa&bbb\\
  70. aaaa&bbb\\
  71. aaaa&bbb\\
  72. \end{longtable}
  73.  
  74.  
  75. \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement