summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/Tabbing/Tabbing.dtx
blob: e34bd832d0697ed1a4ddcca624b1cb6ca9ba6f16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
% \iffalse
%% Package `Tabbing' to use with LaTeX 2e
%% Copyright (C) 1996, 1997, 1998, 1999 Jean-Pierre F. Drucbert, all rights reserved
%%
%% You may use and distribute this file freely, provided that
%% you don't pretend that you wrote it.
%%
% It may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.1
% of this license or (at your option) any later version.
% The latest version of this license is in
%    http://www.latex-project.org/lppl.txt
% and version 1.1 or later is part of all distributions of LaTeX 
% version 1999/06/01 or later.
%
%<package>\NeedsTeXFormat{LaTeX2e}[1997/06/01]
%<package>\ProvidesPackage{Tabbing}[1997/12/18 v1.0 Tabbing environment (JPFD)]
%
%<*driver>
\documentclass{ltxdoc}
\GetFileInfo{Tabbong.sty}
\def\filedate{1999/08/03}
\def\fileversion{v1.1}
\EnableCrossrefs         
%\DisableCrossrefs   % Say \DisableCrossrefs if index is ready
\RecordChanges                  % Gather update information
\CodelineIndex                  % Index code by line number
\title{The \pkg{Tabbing} package}
\author{Jean-Pierre F. Drucbert\\\texttt{drucbert@onecert.fr}}%
\date{\filedate}
\def\bs{\texttt{\char'134}}
\let\pkg\textsf
\usepackage{Tabbing}
\begin{document}
\maketitle
\DocInput{Tabbing.dtx}
\end{document}
%</driver>
% \fi
%
% \CheckSum{106}
%
% \changes{v1.0}{18 Dec 97}{First officially released version.}
% \changes{v1.1}{03 Aug 99}{Added LPPL License.}
%
% \DoNotIndex{\@Mii,\@Miv,\@cons,\@currlist,\@dblarg,\@dbldeferlist}
% \DoNotIndex{\@dblfloat,\@dottedtocline,\@eha,\@Esphack,\@float}
% \DoNotIndex{\@floatpenalty,\@ifnextchar,\@ifundefined,\@latexerr}
% \DoNotIndex{\@mkboth,\@namedef,\@nameuse,\@parboxrestore,\@spaces}
% \DoNotIndex{\@starttoc,\@tempa,\@tempboxa,\@tempdima,\@warning}
% \DoNotIndex{\addcontentsline,\addtocounter,\advance,\arabic,\bfseries}
% \DoNotIndex{\bgroup,\box,\chapter,\columnwidth,\csname,\def,\dimen,\docdate}
% \DoNotIndex{\edef,\egroup,\else,\endcsname,\endinput,\expandafter,\fi}
% \DoNotIndex{\filedate,\fileversion,\global,\hbadness,\hbox,\hfil,\hrule}
% \DoNotIndex{\hsize,\ht,\if@twocolumn,\ifdim,\iffalse,\ifnum,\iftrue,\ifvbox}
% \DoNotIndex{\ifx,\ignorespaces,\intextsep,\kern,\let,\long,\moveleft,\newbox}
% \DoNotIndex{\newcommand,\newcounter,\newif,\newsavebox,\noexpand,\normalsize}
% \DoNotIndex{\numberline,\PackageError,\PackageWarning,\par,\parindent}
% \DoNotIndex{\penalty,\prevdepth,\protect,\refstepcounter,\relax}
% \DoNotIndex{\renewcommand,\rmfamily,\section,\setbox,\setcounter,\space}
% \DoNotIndex{\textheight,\the,\typeout,\unvbox,\uppercase,\vadjust,\value}
% \DoNotIndex{\vbox,\vrule,\vskip,\vspace,\wd,\z@}
%
% \begin{abstract}
% This package\footnote{%
% \begin{tabular}[t]{l}
% Copyright \copyright\ 1996, 1997, 1998 by\\
% Jean-Pierre F. Drucbert\vphantom{bp}\\
% ONERA/Centre de Toulouse SRI\vphantom{bp}\\
% Office National d'\'Etudes et de Recherches A\'erospatiales\vphantom{bp}\\
% Centre de Toulouse\vphantom{bp}\\
% Service R\'eseaux et Informatique\vphantom{bp}\\
% Complexe Scientifique de Rangueil\vphantom{bp}\\
% \\
% 2, Avenue \'Edouard Belin\vphantom{bp}\\
% BP 4025 F-31055 TOULOUSE CEDEX\vphantom{bp}\\
% FRANCE\vphantom{bp}\\
% \vphantom{bp}\\
% Email: \texttt{drucbert@onecert.fr}\vphantom{bp}\\
% \end{tabular}}
% provides a `Tabbing' environment, analog to the \LaTeX\ standard
% `tabbing' environment, but allowing accented letters. No more
% |\a'|, |\a`| and |\a=| needed.
% \end{abstract}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \section{The \pkg{Tabbing} package}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% \newcommand{\tabrule}[1]{\makebox[0pt]{\raisebox
%  {0pt}[0pt]{\rule{\fboxrule}{#1\baselineskip}}}}
% \LaTeX\ provides the \texttt{tabbing} environment. But it is not
% user-friendly when you must use accented letters, whith the grave,
% acute and macron accents, |\'a|~\'a, |\`a|~\`a and |\=a|~\=a. Even
% when you use a good input encoding on 8~bits. So the \pkg{Tabbing}
% package offers a \texttt{Tabbing} environment, which is a slightly
% modified copy of the standard \texttt{tabbing} environment. In the
% \texttt{Tabbing} environment, the local commands |\>|, |\<|, |\=|,
% |\+|, |\-|, |\`| and |\'| are replaced by |\TAB>|, |\TAB<|, |\TAB=|,
% |\TAB+|, |\TAB-|, |\TAB`| and |\TAB'| respectively. Hence the conversion 
% is rather easy. Acute and grave accents are very often used in french,
% this environment should be useful. In the example of
% Figure~\ref{f+Tabbing}, the vertical rules mark the tab stops (with
% the macro |\tabrule|, which is not part of the package)
%    
% \begin{figure}
% \begin{footnotesize}
% \begin{verbatim}
% \newcommand{\tabrule}[1]{\makebox[0pt]{\raisebox
%  {0pt}[0pt]{\rule{\fboxrule}{#1\baselineskip}}}}
%
% \begin{Tabbing}
% gnomon \TAB= agn\=ostic \TAB=     arma\TAB= dillo     \TAB= gnash \TAB= \kill
%        \TAB>            \TAB> gnu     \TAB> gneisses  \TAB>       \TAB> gnarl
%  \\*
%        \TAB>            \TAB> \'ecole \TAB> \'el\`eve \TAB>    \TAB> examen
%  \\*
%        \TAB>            \TAB> école   \TAB> élève     \TAB>    \TAB> examen
%  \\*
%        \TAB>            \TAB> u       \TAB> e         \TAB> g     \TAB>
%  \TAB`
% \end{Tabbing}
% \end{verbatim}
% \end{footnotesize}
%
% \begin{minipage}{\textwidth}
% \begin{Tabbing}
% gnomon \TAB= agn\=ostic \TAB= arma\TAB= dillo \TAB= gnash \TAB= \kill
%        \TAB>            \TAB> gnu \TAB> gneisses \TAB>   \TAB> gnarl \\*
%        \TAB> \TAB> \'ecole \TAB> \'el\`eve \TAB>   \TAB> examen \\*
%        \TAB> \TAB> école \TAB> élève \TAB>   \TAB> examen \\*
%        \tabrule{2} \TAB>\tabrule{2} \TAB> \tabrule{2}u   \TAB>
%            \tabrule{2}e
%          \TAB> \tabrule{2}g \TAB>\tabrule{2} \TAB`\tabrule{2}
%  \end{Tabbing}
% \end{minipage}
%
% \caption{A simple \texttt{Tabbing} environment}\label{f+Tabbing}
% \end{figure}
%   
% Note that the markup is more visible than in the \texttt{tabbing}
% environment, and the syntax of accented letters is \emph{the same}
% outside and inside of the new \texttt{Tabbing} environment.
% 
% \StopEventually{\setcounter{IndexColumns}{2}\PrintIndex\PrintChanges}
%
% \clearpage
% \section{Implementation}
%
%    \begin{macrocode}
%<*package>
%    \end{macrocode}
%
% \begin{environment}{Tabbing}
% We just copy the standard \texttt{tabbing} environment, and
% add the local macro |\TAB| who tests its argument.
% An error message has been added.
% \DescribeMacro{\TAB}
%    \begin{macrocode}
\gdef\Tabbing{\lineskip \z@skip
% %     \let\>\@rtab
% %     \let\<\@ltab
% %     \let\=\@settab
% %     \let\+\@tabplus
% %     \let\-\@tabminus
% %     \let\`\@tabrj
% %     \let\'\@tablab
\def\TAB##1{\ifx ##1>\@rtab\else
            \ifx ##1<\@ltab\else
            \ifx ##1=\@settab\else
            \ifx ##1+\@tabplus\else
            \ifx ##1-\@tabminus\else
            \ifx ##1`\@tabrj\else
            \ifx ##1'\@tablab\else
                         \PackageError{Tabbing}%
                         {Bad argument ##1 for Tabbing specification}
            \fi\fi\fi\fi\fi\fi\fi}
     \let\\=\@tabcr
     \global\@hightab\@firsttab
     \global\@nxttabmar\@firsttab
     \dimen\@firsttab\@totalleftmargin
     \global\@tabpush\z@ \global\@rjfieldfalse
     \trivlist \item\relax
     \if@minipage\else\vskip\parskip\fi
     \setbox\@tabfbox\hbox{\rlap{\indent\hskip\@totalleftmargin
       \the\everypar}}\def\@itemfudge{\box\@tabfbox}%
     \@startline\ignorespaces}
\gdef\endTabbing{%
  \@stopline\ifnum\@tabpush >\z@ \@badpoptabs \fi\endtrivlist}
%    \end{macrocode}
% \end{environment}
%
% \Finale
% \end{document}
\endinput