diff options
author | Karl Berry <karl@freefriends.org> | 2006-01-09 00:49:07 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-01-09 00:49:07 +0000 |
commit | 007f67a693e4d031fd3d792df8e4d5f43e2cb2e7 (patch) | |
tree | 90d17e00e572ecb1e24764b6f29c80e098b08d29 /Master/texmf-dist/doc/latex/ntabbing | |
parent | 950209b26f70aa87ed07c54f82a95b6f03b7c3a0 (diff) |
doc/latex
git-svn-id: svn://tug.org/texlive/trunk@84 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/ntabbing')
-rw-r--r-- | Master/texmf-dist/doc/latex/ntabbing/ntabbing.tex | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/ntabbing/ntabbing.tex b/Master/texmf-dist/doc/latex/ntabbing/ntabbing.tex new file mode 100644 index 00000000000..20efd02190b --- /dev/null +++ b/Master/texmf-dist/doc/latex/ntabbing/ntabbing.tex @@ -0,0 +1,84 @@ +\documentclass{article} +\usepackage{ntabbing,float} +\floatstyle{boxed} +\newfloat{fig}{bt}{fig} +\floatname{fig}{Figure} + +\begin{document} +\title{The {\tt ntabbing} environment\thanks{The latest version of this file and the associated latex style can be found at +{\tt ftp://ftp.math.tau.ac.il/pub/stupp/latex}.}} +\author{Gideon Stupp\\ {\tt stupp@math.tau.ac.il}} + +\date{April 9, 2000} +\maketitle +\begin{abstract} +The {\tt ntabbing} environment is an extension of the {\tt +tabbing} environment that supports automatic line numbering. The +lines can be referenced using the standard {\tt \string\label} +and {\tt\string\ref} mechanism. +\end{abstract} + +\section{Intorduction} + +\begin{fig} +\begin{verbatim} + Recursion example (Function $f$, Line~\ref{rec}). +\begin{ntabbing} +123\=123\=\kill +int $f$(int $i$)\\ +\>if ($i<2$) return($i$); \label{}\\ +\>return $i$*$f$($i-1$); // recurse\label{rec}\\ +\\ +\reset + int main()\\\ + \>for $i$:=1 to 10\label{}\\ + \>\>$s:=s+f(i)$;\label{}\\ + \>return(s);\label{}\\ +\end{ntabbing} + +\end{verbatim} + Recursion example (Function $f$, Line~\ref{rec}). +\begin{ntabbing} +123\=123\=\kill +int $f$(int $i$)\\ +\>if ($i<2$) return($i$); \label{}\\ +\>return $i$*$f$($i-1$); // recurse\label{rec}\\ +\\ +\reset + int main()\\\ + \>for $i$:=1 to 10\label{}\\ + \>\>$s:=s+f(i)$;\label{}\\ + \>return(s);\label{}\\ +\end{ntabbing} +\caption{Simple {\tt ntabbing} example.\label{fig1}} +\end{fig} + +Figure~\ref{fig1} shows an {\tt ntabbing} environment example and +its corresponding latex output. Every line inside the {\tt +ntabbing} environment which is labeled is automatically numbered. +The lines can be referenced from within the environment or from +the outside. If a line just needs to be numbered, {\tt +\string\label\{\}} can be used. Line numbers can be reset back to +one at any point using the {\tt\string\reset} command (line +numbering continues across {\tt ntabbing} environments) + +\section{User Interface} +\reversemarginpar + \marginpar{{\tt\string\begin\{ntabbing\}}\\{\tt\string\end\{ntabbing\}}} + The text that needs to be numbered should start with {\tt\string\begin\{ntabbing\}} + and end with {\tt\string\end\{ntabbing\}}. The {\tt ntabbing} environment is an + extension of the {\tt tabbing} environment and all the tabbing + commands are supported. +\\\\\marginpar{{\tt\string\label\{\}}} + The {\tt\string\label\{\}} command automatically numbers the line with the + current sequence number. It can appear at any point in a line up to the {\tt\string\\}. +\\\\\marginpar{{\tt\string\label\{xxx\}}} + Like {\tt\string\label\{\}} but the line can be referenced using + {\tt\string\ref\{xxx\}}. +\\\\\marginpar{{\tt\string\reset}} + Resets line numbering. Line numbers can be reset several times in + the environment. Notice that line numbers are {\em + not} automatically reset at the beginning of every {\tt + ntabbing} block. + +\end{document} |