diff --git a/doc/text.tex b/doc/text.tex index 78a48cee..024725de 100644 --- a/doc/text.tex +++ b/doc/text.tex @@ -5974,21 +5974,22 @@ \subsection{Typesetting \label{listings:package}computer languages: the \texttt{ \end{enumerate} -\subsection{(Non-)Multipage tabular material with the -\texttt{longtable} package} -\ttindex{longtable}{package}% -\LaTeX{} \footahref{\ctan/required/tools/longtable.dtx}{source}. - -The \texttt{longtable} package provides \LaTeX{} users with the +\subsection{(Non-)Multipage tabular material} +\ttindex{longtable}{package}\ttindex{supertabular}{package} +\LaTeX{} source +for the +\footahref{\ctan/required/tools/longtable.dtx}{\texttt{longtable}} +and +\footahref{\ctan/contrib/supertabular/}{\texttt{supertabular}} +packages. + +Those two packages provide \LaTeX{} users with the possibility to typeset tabular material over several -pages~\cite[Section~5.4.2]{latexbis}. Of course, \hevea{} -does not care much about physical pages, +pages~\cite[Section~5.4]{latexbis}. Of course, \hevea{} +does not care much about physical pages. +Thus the \texttt{supertabular} and \texttt{longtable} environments are rendered more or less as \texttt{tabular} environments inside \texttt{table} environments. -However, \hevea{} implementation may suffer from discrepancy -with \LaTeX{} implementation, due to strong differences in the -scanning processes. - \subsection{Typesetting inference rules: the \label{mathpartir:package} \aname{mathpartir}{\texttt{mathpartir}} package} diff --git a/latexcommon.hva b/latexcommon.hva index 62289c49..dde271e7 100644 --- a/latexcommon.hva +++ b/latexcommon.hva @@ -92,7 +92,7 @@ \setenvclass{figure}{figure} %%General \caption command: #1 -> env name, #2 -> \caption arg \newcommand{\hva@caption}[2] -{\refstepcounter{#1}\begin{center}\csname #1name\endcsname{} \csname the#1\endcsname: #2\end{center}\par} +{\refstepcounter{#1}\begin{center}\csname #1name\endcsname{} \csname the#1\endcsname: #2\end{center}} \newcommand{\@figrule}{\begin{center}\@hr{.8\linewidth}{2pt}\end{center}} \newenvironment{figure}[1][] {\@forcecommand{\caption}[2][]{\hva@caption{figure}{##2}}% diff --git a/longtable.hva b/longtable.hva index 37948020..11810e35 100644 --- a/longtable.hva +++ b/longtable.hva @@ -1,4 +1,6 @@ -%%From code by Gilles Gregoire. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%From code by Gilles Gregoire. %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \@primitives{longtable} %% Of no interest to hevea \def\setlongtables{} @@ -9,8 +11,8 @@ \newcommand{\lt@save@line}[1] {\appendtokens\lt@lines\@tmp@scanned% \let#1\lt@lines\resettokens{\lt@lines}} -\def\lt@endhead{\lt@save@line{\lt@head}} -\def\lt@endfirsthead{\lt@save@line{\lt@firsthead}} +\def\lt@endhead{\addtokens{\@tmp@scanned}{\\}\lt@save@line{\lt@head}} +\def\lt@endfirsthead{\addtokens{\@tmp@scanned}{\\}\lt@save@line{\lt@firsthead}} \def\lt@endfoot{\lt@save@line{\lt@foot}} \def\lt@endlastfoot{\lt@save@line{\lt@lastfoot}} \def\lt@kill{} diff --git a/package.ml b/package.ml index 0ea381f3..e2252fdc 100644 --- a/package.ml +++ b/package.ml @@ -9,7 +9,7 @@ (* *) (***********************************************************************) -(* $Id: package.ml,v 1.74 2006-02-01 17:34:17 maranget Exp $ *) +(* $Id: package.ml,v 1.75 2006-02-03 12:25:49 maranget Exp $ *) module type S = sig end @@ -126,6 +126,12 @@ def_code "\\appendtokens" end) ;; +def_code "\\typemacro" + (fun lexbuf -> + let name = Scan.get_csname lexbuf in + let pat,body = Latexmacros.find name in + Latexmacros.pretty_macro pat body) +;; (* See also the lrtokens env in latexscan.mll *) diff --git a/supertabular.hva b/supertabular.hva index 1fc1b56a..5a8a0641 100644 --- a/supertabular.hva +++ b/supertabular.hva @@ -1,37 +1,31 @@ -%%% supertabular package, partial implementation %%%% -%%% Headers and trailers -\newcommand{\tablehead}[1]{\def\@tablehead{#1}} -\newcommand{\tablefirsthead}[1]{\def\@firsttablehead{#1}} -\newcommand{\tabletail}[1]{\def\@tabletail{#1}} -\newcommand{\tablelasttail}[1]{\def\@lasttabletail{#1}} -\newcommand{\@st@head} - {\@ifundefined{@firsttablehead}% - {\@ifundefined{@tablehead}{}{\@tablehead}}% - {\@firsttablehead}} -\newcommand{\@st@tail} - {\@ifundefined{@lasttabletail}% - {\@ifundefined{@tabletail}{}{\@tabletail}}% - {\@lasttabletail}} -%%%%% Caption -\newcommand{\topcaption}[1]{\def\@st@topcaption{#1}} -\newcommand{\bottomcaption}[1]{\def\@st@bottomcaption{#1}} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%Supertabular, more or less complete implementation. % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\let\st@tablefirsthead\@empty +\newcommand{\tablefirsthead}[1]{\gdef\st@tablefirsthead{#1}} +\newcommand{\tablehead}[1]{} +\newcommand{\tabletail}[1]{} +\let\st@tablelasttail\@empty +\newcommand{\tablelasttail}[1]{\gdef\st@tablelasttail{#1}} +\let\st@bottomcaption\@empty +\newcommand{\bottomcaption}[1] +{\def\st@bottomcaption{\caption{#1}}} +\let\st@topcaption\@empty +\newcommand{\topcaption}[1] +{\def\st@topcaption{\caption{#1}}} \let\tablecaption\topcaption -\newcommand{\@st@caption}[1] - {\@ifundefined{#1}{}{\caption{\csname #1\endcsname}}} -%%%% An finally supertabular envs -\newenvironment{supertabular}[1] - {\begin{table}% - \@st@caption{@st@topcaption}% - \begin{tabular}{#1}\@st@head} - {\@st@tail% - \end{tabular}% - \@st@caption{@st@bottomcaption}% - \end{table}} -\newenvironment{supertabular*}[2] - {\begin{table}% - \@st@caption{@st@topcaption}% - \begin{tabular*}{#1}{#2}\@st@head} - {\@st@tail% - \end{tabular*}% - \@st@caption{@st@bottomcaption}% - \end{table}} +%%% +\newenvironment{supertabular}[2][] +{\begin{table}\st@topcaption\begin{tabular}[#1]{#2}\st@tablefirsthead} +{\st@tablelasttail\end{tabular}\st@bottomcaption\end{table}} +\newcommand{\st@kont@supertabular*}[2][] +{\begin{tabular*}{\st@arg}[#1]{#2}\st@tablefirsthead} +\newenvironment{supertabular*}[1] +{\def\st@arg{#1}\begin{table}\st@topcaption\st@kont@supertabular*} +{\st@tablelasttail\end{tabular*}\st@bottomcaption\end{table}} +\let\mpsupertabular\supertabular +\let\endmpsupertabular\endsupertabular +\let\mpsupertabular*\supertabular* +\let\endmpsupertabular*\endsupertabular* +%% +\newcommand{\shrinkheight}[1]{} \ No newline at end of file diff --git a/tabular.mll b/tabular.mll index 069c66cf..830dc2f7 100644 --- a/tabular.mll +++ b/tabular.mll @@ -9,7 +9,7 @@ (* *) (***********************************************************************) -(* $Id: tabular.mll,v 1.30 2006-02-01 17:34:17 maranget Exp $ *) +(* $Id: tabular.mll,v 1.31 2006-02-03 12:25:49 maranget Exp $ *) { open Misc open Lexing @@ -142,6 +142,8 @@ and tfmiddle = parse {let lxm = lexeme lexbuf in let i = Char.code (lxm.[1]) - Char.code '1' in Lexstate.scan_arg (scan_this_arg tfmiddle) i} +| '%' [^'\n']* '\n' + {tfmiddle lexbuf} | [^'|' '@' '<' '>' '!' '#'] {let lxm = lexeme lexbuf in let name = column_to_command lxm in @@ -170,7 +172,7 @@ and tfmiddle = parse {let rest = String.sub lexbuf.lex_buffer lexbuf.lex_curr_pos (lexbuf.lex_buffer_len - lexbuf.lex_curr_pos) in - raise (Error ("Syntax bonga of array format near: "^rest))} + raise (Error ("Syntax of array format near: "^rest))} and tfpostlude = parse | [' ''\t''\n''\r'] {tfpostlude lexbuf} diff --git a/verb.mll b/verb.mll index 5862dbc1..596fa123 100644 --- a/verb.mll +++ b/verb.mll @@ -7,7 +7,7 @@ (* Copyright 2001 Institut National de Recherche en Informatique et *) (* Automatique. Distributed only by permission. *) (* *) -(* $Id: verb.mll,v 1.84 2006-02-01 17:34:17 maranget Exp $ *) +(* $Id: verb.mll,v 1.85 2006-02-03 12:25:49 maranget Exp $ *) (***********************************************************************) { exception VError of string @@ -895,7 +895,6 @@ and scan_bycommand out is_cmd = parse | eof {if not (Stack.empty stack_lexbuf) then begin let lexbuf = previous_lexbuf () in - Out.put out "%\n" ; scan_bycommand out is_cmd lexbuf end else begin raise