"Fossies" - the Fresh Open Source Software Archive

Member "hevea-2.35/longtable.hva" (16 Jan 2021, 2522 Bytes) of package /linux/www/hevea-2.35.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    2 %%From code by Gilles Gregoire. %%
    3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    4 \@primitives{longtable}
    5 %% Of no interest to hevea
    6 \def\setlongtables{}
    7 %%Those commands are invoked by the special scanner 'scan_bycommand'
    8 %%in verb.mll.
    9 %%They assume that scanned text is in the token command '\@tmp@scanned'
   10 \newtokens{\lt@lines}%
   11 \newcommand{\lt@save@line}[1]
   12 {\appendtokens\lt@lines\@tmp@scanned%
   13 \let#1\lt@lines\resettokens{\lt@lines}}
   14 \def\lt@endhead{\addtokens{\@tmp@scanned}{\\}\lt@save@line{\lt@head}}
   15 \def\lt@endfirsthead{\addtokens{\@tmp@scanned}{\\}\lt@save@line{\lt@firsthead}}
   16 \def\lt@endfoot{\lt@save@line{\lt@foot}}
   17 \def\lt@endlastfoot{\lt@save@line{\lt@lastfoot}}
   18 \def\lt@kill{}
   19 \newcommand{\lt@saveline}[1][]
   20 {\appendtokens\lt@lines\@tmp@scanned%
   21 \addtokens{\lt@lines}{\\[#1]}}
   22 \newcommand{\lt@nosaveline}[1][]{\let\\\lt@saveline}
   23 %%Infamous hack, prepare a '\caption' command for 'table' env
   24 \newcommand{\lt@caption}[2][]
   25 {\ifx\lt@fst@caption\@empty\gdef\lt@fst@caption{\caption[#1]{#2}}\fi%
   26 \let\\\lt@nosaveline}
   27 %%No more than a tabular in a table
   28 %%For interpreting optionnal arg.
   29 \def\lt@fmt@{\begin{center}}
   30 \def\lt@fmt@e{\end{center}}
   31 \def\lt@fmt@c{\begin{center}}
   32 \def\lt@fmt@ec{\end{center}}
   33 \def\lt@fmt@l{\begin{flushleft}}
   34 \def\lt@fmt@el{\end{flushleft}}
   35 \def\lt@fmt@r{\begin{flushright}}
   36 \def\lt@fmt@er{\end{flushright}}
   37 %% Define commands being active during scan_bycommand
   38 \def\lt@let#1#2{\let#1#2\lt@exists{#1}}
   39 %% Invoke comand #1 or command #2 or nothing, if they exist
   40 \def\lt@choose#1#2{\ifu#1\ifu#2\else#2\fi\else#1\fi}
   41 %Table is typeset first in this box (to place caption above it)
   42 \newsavebox{\lt@tabular@box}
   43 %Here we go
   44 \newenvironment{longtable}[2][]
   45 {\def\lt@arg{#2}\def\lt@opt{#1}
   46 \@forcecommand{\pagebreak}[1][]{}%
   47 \@forcecommand{\nopagebreak}[1][]{}%
   48 \@forcecommand{\newpage}{}
   49 \lt@let\endhead\lt@endhead%
   50 \lt@let\endfirsthead\lt@endfirsthead%
   51 \lt@let\endfoot\lt@endfoot%
   52 \lt@let\endlastfoot\lt@endlastfoot%
   53 \lt@let\kill\lt@kill%
   54 \lt@let\\\lt@saveline\lt@let\\*\lt@saveline\lt@let\tabularnewline\lt@saveline%
   55 \global\let\lt@fst@caption\@empty%
   56 \lt@let\caption\lt@caption\lt@let\caption*\lt@caption%
   57 \@longtable}
   58 {\lt@saveline%For the last line
   59 \begin{lrbox}{\lt@tabular@box}%
   60 \begin{tabular}{\lt@arg}%
   61 \lt@choose{\lt@firsthead}{\lt@head}%
   62 \lt@lines%
   63 \lt@choose{\lt@lastfoot}{\lt@foot}%
   64 \end{tabular}
   65 \end{lrbox}
   66 \begin{table}\lt@fst@caption%
   67 \csname lt@fmt@\lt@opt\endcsname%
   68 \usebox{\lt@tabular@box}
   69 \csname lt@fmt@e\lt@opt\endcsname%
   70 \end{table}}
   71 
   72