Skip to content

Commit

Permalink
+
Browse files Browse the repository at this point in the history
  • Loading branch information
maranget committed Feb 3, 2006
1 parent 1eeb2bb commit 573c6ff
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 57 deletions.
25 changes: 13 additions & 12 deletions doc/text.tex
Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion latexcommon.hva
Expand Up @@ -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}}%
Expand Down
8 changes: 5 additions & 3 deletions 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{}
Expand All @@ -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{}
Expand Down
8 changes: 7 additions & 1 deletion package.ml
Expand Up @@ -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

Expand Down Expand Up @@ -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 *)

Expand Down
66 changes: 30 additions & 36 deletions 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]{}
6 changes: 4 additions & 2 deletions tabular.mll
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down
3 changes: 1 addition & 2 deletions verb.mll
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 573c6ff

Please sign in to comment.