diff options
author | Karl Berry <karl@freefriends.org> | 2009-03-31 00:24:45 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-03-31 00:24:45 +0000 |
commit | 088ae35fa451f7492dec5997ba5f8d53df17f47e (patch) | |
tree | 318666da7317036fe66f06b9f0c6a845a5f97cf4 /Master/texmf-dist/doc/latex/calctab | |
parent | 4054ed60df3fdb5816ce59388b4c291c570e0b8c (diff) |
calctab 0.6 (30mar09)
git-svn-id: svn://tug.org/texlive/trunk@12578 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/calctab')
-rw-r--r-- | Master/texmf-dist/doc/latex/calctab/README | 27 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/calctab/calctab_manual.pdf | bin | 430027 -> 470403 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/calctab/calctab_manual.tex | 450 |
3 files changed, 327 insertions, 150 deletions
diff --git a/Master/texmf-dist/doc/latex/calctab/README b/Master/texmf-dist/doc/latex/calctab/README index ef4decb138d..03c5f9946b0 100644 --- a/Master/texmf-dist/doc/latex/calctab/README +++ b/Master/texmf-dist/doc/latex/calctab/README @@ -1,20 +1,27 @@ -calctab package - Autocalc table environment -experimental version 0.5 2009/02/20 +calctab package - A language for numeric tables +version 0.6 2009/03/28 -The calctab package help the user to typeset a kind of economic table such as invoices, expense notes and liquidation, or other tabular material with a values column. -The code compute sum and percentage with floating point numeric method (with fltpoint package by Eckhart Guthoehrlein) and formatting table action. +1 - Introduction +The calctab package helps the user to typeset a kind of economic table such as invoices, expense notes and liquidation, or other tabular material with a values columns. +The code computes sum and percentage with floating point numeric method (with the fltpoint package by Eckhart Guthoehrlein) and builds the render table task. +Economics items may be are independent values or not like sums and percentage on previous values. The language must be expressive concerning together data and its relationships. -A standard tabular environment works well but force the user to write in a generic LaTeX language without a conceptual relation among the economic items. In addition a lot of formatting command takes the same relevance of the document main data. +2 - Calctab and xcalctab environments +The calctab environment allow you to typesetting a table with only one values column beside a label and a description columns. +In the xcalctab environment the values of two columns are multiplied and the result is printed in a third column. +Please read the calctab user manual for more information and example. -So, the priority is to add a new language element. +3 - Language +A standard tabular environment works well but force the user to think in a generic LaTeX language without a conceptual relation among the items. In addition a lot of formatting commands takes the same relevance of the main data. -Economics items may be are independent values or not like sums and percentage on previous values. The language must be expressive concerning together data and its relations. +4 - Feedback and language enhancements +This version waiting for the user help and feedback and somehow a powerful implemented language to adjust all the view property such as row numbering, label type, coloring, etc. +Finally, I hope in a new infrastructure design which allow to building table with an object oriented language (ool). -This experimental version waiting for the user help and feedback and somehow a powerful implemented language to adjust all the view property such as row numbering, label operation, coloring, etc. +5 - Package license +This program can be redistributed and/or modified under the terms of the LaTeX Project Public License Distributed from CTAN archives in directory macros/latex/base/lppl.txt; either version 1 of the License, or any later version. Happy TeXing! Copyright (C) 2009 Roberto Giacomelli -- giaconet at tin dot it -This program can be redistributed and/or modified under the terms of the LaTeX Project Public License Distributed from CTAN archives in directory macros/latex/base/lppl.txt; either version 1 of the License, or any later version. - diff --git a/Master/texmf-dist/doc/latex/calctab/calctab_manual.pdf b/Master/texmf-dist/doc/latex/calctab/calctab_manual.pdf Binary files differindex a76f2f1b304..28897a1323a 100644 --- a/Master/texmf-dist/doc/latex/calctab/calctab_manual.pdf +++ b/Master/texmf-dist/doc/latex/calctab/calctab_manual.pdf diff --git a/Master/texmf-dist/doc/latex/calctab/calctab_manual.tex b/Master/texmf-dist/doc/latex/calctab/calctab_manual.tex index 2a816b9ff3f..054afcb4277 100644 --- a/Master/texmf-dist/doc/latex/calctab/calctab_manual.tex +++ b/Master/texmf-dist/doc/latex/calctab/calctab_manual.tex @@ -2,10 +2,10 @@ \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} -\usepackage[left=32mm, - right=45mm, - top=32mm, - bottom=28mm]{geometry} +\usepackage[ left=32mm, + right=45mm, + top=32mm, + bottom=28mm]{geometry} \usepackage[english]{babel} @@ -14,6 +14,13 @@ \usepackage{microtype} \usepackage{url} \usepackage{fancyvrb} +\usepackage{caption} +\usepackage[ pdfauthor={Roberto Giacomelli}, + pdfsubject={Calctab package user manual}, + pdfkeywords={table, invoice, expense note, report}, + pdftitle={Calctab user manual}, + colorlinks, + linkcolor=blue]{hyperref} % set the Verbatim environment \fvset{numbers=left,numbersep=7pt} @@ -27,130 +34,146 @@ \newcommand{\env}[1]{\textsf{#1}} \newcommand{\cmd}[1]{\texttt{\char`\\#1}} \newcommand{\meta}[1]{\ensuremath{\langle}\emph{#1}\ensuremath{\rangle}} -\newcommand{\graffe}[1]{\texttt{\{}\meta{#1}\texttt{\}}} -\newcommand{\quadre}[1]{\texttt{[}\meta{#1}\texttt{]}} +\newcommand{\curlyp}[1]{\texttt{\{}\meta{#1}\texttt{\}}} +\newcommand{\squarep}[1]{\texttt{[}\meta{#1}\texttt{]}} \author{Roberto Giacomelli\\e-mail: \texttt{giaconet at tin dot it}} -\date{2009/02/20} -\title{\ct{} package\\Experimental version\\0.5} +\date{2009/03/28} +\title{\ct{} package\\version 0.6} \begin{document} \maketitle \bigskip -\hspace*{238pt}\begin{minipage}{125pt} -\em -``The table compute the sum\\ +\hspace*{238pt}\begin{minipage}{125pt}\em +``The table computes the sum\\ not because is useful,\\ but because the result\\ -is not an user essential data.'' +is not an user essential data'' \end{minipage} -\bigskip +\vfill \begin{center} -\begin{minipage}{96mm}%.8\textwidth +\begin{minipage}{112mm}%.8\textwidth \tableofcontents \end{minipage} \end{center} - - -\bigskip +\vfill +\newpage +% +% +% \section{Introduction} -The \pkg{calctab} package help the user to typeset a kind of economic table such as invoices, expense notes and liquidation, or other tabular material with a values column. +The \pkg{calctab} package helps user to typeset a kind of economic table such as invoices, expence notes and liquidation, or other tabular material with numeric columns. -A normal \env{tabular} environment works well but force the user to write in a generic \LaTeX{} language without a conceptual relation among the economic items. In addition a lot of formatting command takes the same relevance of the document main data. - -So, the priority is to add a new language element. - -Economics items may be are independent values or not like sums and percentage on previous values. The language must be expressive concerning together data and its relations. - -\section{ToDo} -I don't know if in the future this package will merge into another or became under further development. I hope in user discussion on the language issues and implementation too. +A normal \env{tabular} environment works well but force user to \emph{think} in a generic \LaTeX{} language to reference the object of his work and without a conceptual relation among these. In addition a lot of formatting commands takes the same relevance of the main user data. -The code have a good level of stability, nevertheless the package is considered experimental because some essential tasks are in \emph{ToDo} status as result in the following list: - -\begin{itemize} - \item write in good english the package documentation; - \item internationalization of the table fixed description string; - \item internationalization of the currency unit; - \item inner commands language development; - \item language development to manage the table view; - \item \dots -\end{itemize} - -The enthusiasm raised during GuITmeeting2008 in Pisa (Italy)\footnote{For information please visit the site \url{www.guit.sssup.it/guitmeeting/2008/2008.it.php}} by the talk \emph{``Una tabella che fa calcoli''} and the tip by Norbert Preining (Vienna University of Technology) to upload on CTAN the code in experimental section, finally persuade me to publish it. - -Thanks GuITmeeting2008 people, thanks Norbert. +Economic items maybe are independent values or not like sums and percentages on previous values. The language must be expressive concerning together data and its relations. So, the priority is to add a new language element. +% +% +% \section{User manual} -In this section will be explain the use of the environment \pkg{calctab}, first through several examples and later showing its formal syntax. +In this section will be explain the use of the two \ct{} environments \env{calctab} and \env{xcalctab}, first through several examples and then showing its formal syntax. -\subsection{\pkg{calctab} by examples} -\subsubsection{Simple table} -Well, starting with a simple case, consider a list of three entries with a final sum as showed in the next table: +% +% +\subsection{\env{calctab} and \env{xcalctab} by examples} +% +\subsubsection{A simple table} +Well, starting with a simple case, consider a list of three entries, a 10\% tax apply on it, and the final sum as showed in the next table: \begin{calctab} - \amount{First cost}{12500,9} - \amount{Second cost}{8560,03} - \amount{Third cost}{9200,45} - \add{Final sum} + \amount{First cost}{12500,9} + \amount{Second cost}{8560,03} + \amount{Third cost}{9200,45} + \perc{Tax}{10} + \add{Total cost} \end{calctab} -\bigskip +The user can typesetting the example table with the followed code (obviously, the directive \verb=\usepackage{calctab}= must be present in the document preamble). -To mark items as independent value we can use the \verb=\amount= command, which needs two mandatory arguments: an item description text and its economic consistency. - -In the last row, the \verb=\add= command have care to execute the sum of the previous amount, thus only a description text needs as input. - -So, the user can typesetting the table with the \LaTeX{} source code show next. Obviously, the directive \verb=\usepackage{calctab}= must be present in the document preamble. +{\color{blue} +\begin{Verbatim}[numbers=none] +% in the document preamble +\usepackage{calctab} +\end{Verbatim} +} \begin{Verbatim} +% in the document body \begin{calctab} - \amount{First cost}{12500,9} - \amount{Second cost}{8560,03} - \amount{Third cost}{9200,45} - \add{Final sum} + \amount{First cost}{12500,9} + \amount{Second cost}{8560,03} + \amount{Third cost}{9200,45} + \perc{Tax}{10} + \add{Total cost} \end{calctab} \end{Verbatim} -The behaviour of the inner commands is based on these rules: +The behaviour of the inner commands is based on these main rules: \begin{itemize} \item Each command typeset one table row; - \item the sequence of commands produce the sequence of the table row; - \item \verb=\add= command sum all previous values (with exception to \verb=\add= values so). + \item the sequence of commands produce the sequence of the table rows; + \item the \verb=\perc= and the \verb=\add= commands computes all previous values (with exception to the \verb=\add= row); + \item optional command argument provides a relation row language to select item or groups of items. \end{itemize} -The environment manages all the formatting elements of table as colored rows, rules, description entry row. The command execute calculation in floating point algorithm and adds description text (a list of uppercase letter to explicate the rows computed). -Also commands execute formatting task as numeric values printing, font family selection and more. +An independent value is not only a numeric data but also it's defined by a description text. This concept is directly express by the \verb=\amount= command which needs two mandatory arguments: the \emph{description text} and the item \emph{economic consistency}. -Potentially all of these \emph{visual} property could be adjust by the \pkg{calctab} user. +No more different is a percentage object structure with its description text and a numeric value this time not an absolute number but a factor multiply by one hundred calculate on some previous data, and still we can easy express this with the \verb=\perc= command. -\subsubsection{Percentage} +Finally, we encountered a sum that only needs a description text. The \pkg{calctab} language provides the \verb=\add= command to cover this concept. -Now we discuss the last inner command of the environment \pkg{calctab} named \verb=\perc= to compute a percentage. +These three commands are available in an environment called \env{calctab} that represents the comprehensive structure of a table. -In this second example we have only three items: an independent value, an its percentage, and the sum of all. +The code implementation of the inner commands computes the numeric results with the floating point algorithm rounded it with a max of two decimal digit (currently the results are truncated at this fixed precision). +The number of the commands mandatory argument can be negative. -\begin{calctab} - \amount{Building costruction}{560000} - \perc{Tax}{10} - \add{Total} -\end{calctab} +The \env{calctab} environment manages all the table format elements such as the rows color, the rules, the columns header description text, etc. +Furthermore, the code executes the data numeric formatting, the font family selection and more. -The \LaTeX{} code to produce the table is show here: +For example, to the rows description text the \verb=\add= and \verb=\perc= commands adds a list of uppercase alphabetical character to explicate the computed rows. + +Potentially all of these \emph{visual} property could be adjust by the \pkg{calctab} user. + +% +\subsubsection{Quantity and price columns} +The \pkg{calctab} package provides another environment called \env{xcalctab} where the \env{x} character suggests a multiply operation and an extension of the base \env{calctab} too. +The inner commands are the same already discussed except the \verb=\amount= command that accepts the description test and two numbers indeed only one. + +The final table will appears with three columns typesetting with the two numeric arguments and their product. The next table clarify this structure: + +\begin{xcalctab} + \amount{Newspapers}{3}{1,30} + \amount{Coloured pencils}{12}{6,00} + \amount{Maths exercise book}{6}{2,50} + \amount{Compass}{1}{9,90} + \amount{Ruler}{1}{5,90} + \amount{Protractor}{1}{6,80} + \perc{Deduction}{-5} + \add{Total} +\end{xcalctab} \begin{Verbatim} -\begin{calctab} - \amount{Building costruction}{560000} - \perc{Tax}{10} +\begin{xcalctab} + \amount{Newspapers}{3}{1,30} + \amount{Coloured pencils}{12}{6,00} + \amount{Maths exercise book}{6}{2,50} + \amount{Compass}{1}{9,90} + \amount{Ruler}{1}{5,90} + \amount{Protractor}{1}{6,80} + \perc{Deduction}{-5} \add{Total} -\end{calctab} +\end{xcalctab} \end{Verbatim} -The number of the second argument of \verb=\perc= command is interpreted as percentage value so not in absolute mode. This number may be negative with a max of two decimal digit (currently number are truncated at this point). - +The help text A+B+C+D+$\cdots$+\meta{LAST}, will be shorted when the items are more than \emph{five} elements, in A+B+$\cdots$+\meta{LAST}. The abbreviation condition is true only if the items in the subgroup are a consecutive sequence. +% +% +% \subsubsection{Items relations} If more complex tables require \emph{relational} information between rows is necessary to assign to it a names and recall these identifier in a list. This simply way can be achieved with the command optional argument. @@ -169,55 +192,96 @@ For example, we want to apply a different discount on each expense or on each gr \add{Grand total} \end{calctab} -The next \LaTeX{} code show rows relation by name: +The next \LaTeX{} code explains language support to the rows relation by naming : \begin{Verbatim} \begin{calctab} - \amount[id=dinner]{Five dinner}{146} + \amount[id=dinner] {Five dinner}{146} \amount[id=breakfast]{Five breakfast}{35} - \perc[dinner]{Discount}{-8} + \perc[dinner] {Discount}{-8} \perc[breakfast]{Discount}{-4} \add{Grand total} \end{calctab} \end{Verbatim} -\subsubsection{Sums in table} -In the table of the last example we will add a subtotal as the sum of discounts (and a short table description paragraph too): +\subsubsection{Subtotals} +To the table of the last example we will add a subtotal as the sum of the discounts row. \begin{calctab}[Hotel bill:\\ Period from 12 october 2008 to 18 october 2008 (room 456)] - \amount[id=dinner] {Five dinner} {146} - \amount[id=breakfast] {Five breakfast}{35} - \perc[id=dis8,dinner] {Discount} {-8} - \perc[id=dis4,breakfast]{Discount} {-4} - \add[dis8,dis4]{Total of discount} - \add{Grand total} + \amount[id=dinner] {Five dinner} {29,2 * 5} + \amount[id=breakfast] {Five breakfast}{ 7 * 5} + \perc[id=dis8,dinner] {Discount} { -8} + \perc[id=dis4,breakfast]{Discount} { -4} + \add[dis8,dis4] {Total of discount} + \add {Grand total} \end{calctab} \bigskip -The table's \LaTeX{} code is this: \begin{Verbatim} \begin{calctab}[Hotel bill:\\ Period from 12 october 2008 to 18 october 2008 (room 456)] - \amount[id=dinner] {Five dinner} {146} - \amount[id=breakfast] {Five breakfast}{35} - \perc[id=dis8,dinner] {Discount} {-8} - \perc[id=dis4,breakfast]{Discount} {-4} - \add[dis8,dis4]{Total of discount} - \add{Grand total} + \amount[id=dinner] {Five dinner} {29,2 * 5} + \amount[id=breakfast] {Five breakfast}{ 7 * 5} + \perc[id=dis8,dinner] {Discount} { -8} + \perc[id=dis4,breakfast]{Discount} { -4} + \add[dis8,dis4] {Total of discount} + \add {Grand total} \end{calctab} \end{Verbatim} -As the reader can be notice, \emph{table description} is typeset as a paragraph having the same (variable) table width. +As the reader can be notice, the optional \emph{table description} is typeset as a paragraph having the same (variable) table width. + +% +% +% +\subsubsection{An arithmetic argument} +The last example silently uses a feature of the \cmd{amount} command (only for \env{calctab} and not for \env{xcalctab}) available from the package version 0.6. The numeric argument can optionally be a binary math expression. The parse algorithm is very simple and the only syntax allowed are show in Tab.~\ref{tabOper} where \meta{a} and \meta{b} are two decimal numbers. + +\begin{table} +\centering +\caption{\env{calctab} \cmd{amount} command optional binary operation} +\label{tabOper} +\begin{tabular}{lrr}\toprule + Floating point & \multicolumn1c{Symbolic} & Numeric \\ + operation & \multicolumn1c{description} & example \\\midrule +% \emph{Addition} & \meta{a} $+$ \meta{b} & $15{,}20 + 41$\\ + \emph{Addition} & $-$\meta{a} $+$ \meta{b} & $-15{,}20 + 41$\\ + \emph{Subtraction} & \meta{a} $-$ \meta{b} & $15{,}20 - 41$\\ + \emph{Subtraction} & $-$\meta{a} $-$ \meta{b} & $-15{,}20 - 41$\\ + \emph{Multiplication} & \meta{a} $\cdot$ \meta{b} & $15{,}20 \cdot 41$\\ + \emph{Multiplication} & $-$\meta{a} $\cdot$ $-$\meta{b} & $-15{,}20 \cdot -41$\\ + \emph{Division} & \meta{a} $/$ \meta{b} & $15{,}20 / 41$\\ + \emph{Division} & $-$\meta{a} $/$ \meta{b} & $-15{,}20 / 41$\\\bottomrule +\end{tabular} +\end{table} + +Sometimes the applied round off number must be show in the table. This is possible because the code report the input user operation. Here is an example. -\subsubsection{Sum of the sum} +\begin{calctab} + \amount{A rounded cost}{4506-6} + \amount{Positive rounded cost}{3598,30+1,70} + \add{Total (rounded)} +\end{calctab} + +\begin{Verbatim} +\begin{calctab} + \amount{A rounded cost}{4506-6} + \amount{Positive rounded cost}{3598,30+1,70} + \add{Total (rounded)} +\end{calctab} +\end{Verbatim} + + +\subsubsection{Sum of the sums} +In this table a 20\% deduction amount must be apply on the total of the first three values. A solution is to assign a name for each rows and write its list in optional argument of \cmd{perc} command. Nevertheless, this sum is just computed in previus row, thus we can assign a name only to this table row \texttt{\cmd{add}[id=total]\{Total amount of the design task\}}, and later recall the result and then apply percentage on it with the line \texttt{\cmd{perc}[total]\{Deduction\}\{-20\}}. \begin{calctab}[Plant project Fee Note:\\ Italian restaurant and pizzeria ``La Margherita''] \amount{Design of the air conditioned plant}{5400} \amount{Design of the electric plant and video surveillance}{8000} - \perc{General expense}{8,55} + \perc{General expence}{8,55} \add[id=total]{Total amount of the design task} \perc{Tax}{2} \perc{VAT}{20} @@ -225,15 +289,14 @@ As the reader can be notice, \emph{table description} is typeset as a paragraph \add{Total} \end{calctab} -In this table a 20\% deduction amount must be apply on the total of the first three values. A solution is to assign a name for each rows and write its list in optional argument of \cmd{perc} command. Nevertheless, this sum is just computed in previus row, thus we can assign a name only to this table row \texttt{\cmd{add}[id=total]\{Total amount of the design task\}}, and later recall the result and then apply percentage on it with the line \texttt{\cmd{perc}[total]\{Deduction\}\{-20\}}. -The complete code is show next: +The complete code is showed here: \begin{Verbatim} \begin{calctab}[Plant project Fee Note:\\ Italian restaurant and pizzeria ``La Margherita''] \amount{Design of the air conditioned plant}{5400} \amount{Design of the electric plant and video surveillance}{8000} - \perc{General expense}{8,55} + \perc{General expence}{8,55} \add[id=total]{Total amount of design task} \perc{Tax}{2} \perc{TVA}{20} @@ -243,12 +306,10 @@ The complete code is show next: \end{Verbatim} \subsubsection{Interval rows selection} -In some particular list of independent values the idea of interval selection is simply a consecutive group selection. So we only need to specify the first and the last element of the series. -If the first element is no explicit information its default is the element one, and similary, the last element of whole dataset became the default if a limit is no available. +In an independent values list the idea of interval selection is simply an identification of consecutive elements. So we only need to specify the first and the last group delimiters rows of the series. +If the first element is not an explicit information the element one becames default and, similary, the last element of whole dataset becames the upper limit if this is not available. -The \ct{} commands \cmd{perc} and \cmd{add} support an interval selection with \texttt{from} and \texttt{until} keys that referenced row name. - -For example in this follow table the first five items and the last four are two separated group. +The \ct{} commands \cmd{perc} and \cmd{add} supports an interval selection with \texttt{from} and \texttt{until} keys that referenced row name. For example in this follow table the first five items and the last four are two separated groups. \begin{calctab}[The interval selection table] \amount{One} {100000000} @@ -256,6 +317,7 @@ For example in this follow table the first five items and the last four are two \amount{Three} {3000000} \amount{Four} {400000} \amount[id=five]{Five}{50000} + \inrule \amount[id=six]{Six} {6000} \amount{Seven} {700} \amount{Eight} {80} @@ -265,8 +327,6 @@ For example in this follow table the first five items and the last four are two \add{As well as total} \end{calctab} -The code needs to render this demo table is explain here: - \begin{Verbatim} \begin{calctab}[The interval selection table] \amount {One}{100000000} @@ -274,6 +334,7 @@ The code needs to render this demo table is explain here: \amount {Three}{3000000} \amount {Four}{400000} \amount[id=five]{Five}{50000} + \inrule \amount[id=six] {Six}{6000} \amount {Seven}{700} \amount {Eight}{80} @@ -284,65 +345,120 @@ The code needs to render this demo table is explain here: \end{calctab} \end{Verbatim} -Is possible to combine the keys \texttt{until} and \texttt{from} in the same optional argument to select a whole inner interval, and a row name list too. -In case of selection overlap, a package warning will be throws at compile time. +An inner rule is adding \emph{manually} with the command \cmd{inrule} (that just sounds \emph{inner rule}). -\subsection{Environment formal syntax} +Is possible to combine the key \texttt{until} with the key \texttt{from} in the same optional argument to select a whole inner interval, and a row name list too. +In case of a selection overlap, a package warning will be throws at compile time. -The environment syntax will be described follow: +\subsection{Environments formal syntax} +\subsubsection{\env{calctab} syntax} +The \env{calctab} environment syntax will be described in succession: \medskip \noindent\fbox{ \parbox{220pt}{ - \noindent\cmd{begin}\texttt{\{calctab\}}\quadre{description paragraph}\smallskip + \noindent\cmd{begin}\texttt{\{calctab\}}\squarep{description paragraph}\smallskip \hspace*{5mm}\meta{calctab commands list}\smallskip \noindent\cmd{end}\texttt{\{calctab\}} } +}\medskip + +The \meta{calctab commands list} is a sequence of the internal commands \cmd{amount}, \cmd{perc}, \cmd{add} and \cmd{inrule}.\medskip + +\noindent\fbox{\cmd{amount}\squarep{key-value list}\curlyp{description}\curlyp{value}}\medskip + +\meta{key-value list} $=$ \texttt{id=}\meta{rowID};\medskip + +\meta{description} $=$ Text line;\medskip + +\meta{value} $=$ \meta{decimal value} or \meta{basic binary operation}.\medskip + +\noindent\fbox{\cmd{perc}\squarep{key-value list}\curlyp{description}\curlyp{percentage}}\medskip + +\meta{key-value list} $=$ \texttt{id=}\meta{rowID}\texttt{,} \texttt{from=}\meta{rowID}\texttt{,} \texttt{until=}\meta{rowID}\texttt{,} \meta{rowID~list};\medskip + +\meta{description} $=$ Text line;\medskip + +\meta{value} $=$ \meta{percentage decimal value}.\medskip + +\noindent\fbox{\cmd{add}\squarep{key-value list}\curlyp{description}}\medskip + +\meta{key-value list} $=$ \texttt{id=}\meta{rowID}\texttt{,} \texttt{from=}\meta{rowID}\texttt{,} \texttt{until=}\meta{rowID}\texttt{,} \meta{rowID~list};\medskip + +\meta{description} $=$ Text line.\medskip + +\noindent\fbox{\cmd{inrule}}\medskip + + +\subsubsection{\env{xcalctab} syntax} +The \pkg{xcalctab} environment syntax will be described in the next paragraph: + +\medskip +\noindent\fbox{ + \parbox{220pt}{ + \noindent\cmd{begin}\texttt{\{xcalctab\}}\squarep{description paragraph}\smallskip + + \hspace*{5mm}\meta{xcalctab commands list}\smallskip + + \noindent\cmd{end}\texttt{\{xcalctab\}} + } } \medskip -where \meta{calctab commands list} is a sequence of the internal commands:\medskip +The \meta{xcalctab commands list} is a sequence of the internal commands \cmd{amount}, \cmd{perc}, \cmd{add} and \cmd{inrule}.\medskip +\noindent\fbox{\cmd{amount}\squarep{key-value list}\curlyp{description}\curlyp{value1}\curlyp{value2}}\medskip -\noindent\fbox{\cmd{amount}\texttt{[id=}\meta{rowID}\texttt{]}\graffe{descr}\graffe{value}}\medskip +\meta{key-value list} $=$ \texttt{id=}\meta{rowID};\medskip -\noindent\fbox{\cmd{perc}\texttt{[id=}\meta{rowID}\texttt{,from=}\meta{rowID}\texttt{,until=}\meta{rowID}\texttt{,}\meta{rowID~list}\texttt{]}\graffe{descr}\graffe{percentage}}\medskip +\meta{description} $=$ Text line;\medskip -\noindent\fbox{\cmd{add}\texttt{[id=}\meta{rowID}\texttt{,from=}\meta{rowID}\texttt{,until=}\meta{rowID}\texttt{,}\meta{rowID~list}\texttt{]}\graffe{descr}} +\meta{value1} $=$ \meta{decimal value};\medskip -\medskip -Please note that the \pkg{calctab} environment is based on the standard \LaTeX{} \env{tabular} environment, so you can manage \pkg{calctab} as a float object all-surrounding it with a \pkg{table} environment. +\meta{value2} $=$ \meta{decimal value}.\medskip + +\noindent\fbox{\cmd{perc}\squarep{key-value list}\curlyp{description}\curlyp{percentage}}\medskip + +\meta{key-value list} $=$ \texttt{id=}\meta{rowID}\texttt{,} \texttt{from=}\meta{rowID}\texttt{,} +\texttt{until=}\meta{rowID}\texttt{,} \meta{rowID~list};\medskip -\subsection{Appearance commands (at the moment)} +\meta{description} $=$ Text line;\medskip + +\meta{value} $=$ \meta{percentage decimal value}.\medskip + +\noindent\fbox{\cmd{add}\squarep{key-value list}\curlyp{description}}\medskip + +\meta{key-value list} $=$ \texttt{id=}\meta{rowID}\texttt{,} \texttt{from=}\meta{rowID}\texttt{,} \texttt{until=}\meta{rowID}\texttt{,} \meta{rowID~list};\medskip + +\meta{description} $=$ Text line.\medskip + +\noindent\fbox{\cmd{inrule}}\medskip + +Please note that the \pkg{calctab} and \pkg{xcalctab} environments are based on the standard \LaTeX{} \env{tabular} environment, so you can manage your table as a float object all-surrounding it with a \pkg{table} environment. + +\subsection{The table appearance commands (at the moment)} The first row of the table typeset by \pkg{calctab} environment contains a pair of texts. The title of description column, that can be modify by the user with the command \cmd{ctdescription}, and the title of economic column that describe currency, set by the command \cmd{ctcurrency}. Default values are ``\texttt{Items description}'' and \cmd{euro}. These command save the argument in defined internal macro, in the same way of the common \cmd{title} and \cmd{author} command of the \pkg{article} class. Insert these commands before the \pkg{calctab} environment to change it. \bigskip -\noindent\fbox{\cmd{ctcurrency}\graffe{user text}} +\noindent\fbox{\cmd{ctcurrency}\curlyp{user text}} \smallskip -\noindent\fbox{\cmd{ctdescription}\graffe{user text}} +\noindent\fbox{\cmd{ctdescription}\curlyp{user text}} \bigskip -An example show explicit assignment of the description text and currency unit: +A table example show explicit assignment of the description text and currency unit after this commands: +\begin{Verbatim} \ctdescription{Your bill, thanks a lot.} \ctcurrency{USD} +\end{Verbatim} -\begin{calctab} - \amount[id=dinner]{Five dinner}{146} - \amount[id=breakfast]{Five breakfast}{35} - \perc[dinner]{Discount}{-8} - \perc[breakfast]{Discount}{-4} - \add{Grand total} -\end{calctab} - -\begin{Verbatim} \ctdescription{Your bill, thanks a lot.} \ctcurrency{USD} @@ -353,14 +469,22 @@ An example show explicit assignment of the description text and currency unit: \perc[breakfast]{Discount}{-4} \add{Grand total} \end{calctab} -\end{Verbatim} -The default english text in percentage row can be change in the same way with the command \cmd{ctontranslation}. +The default english text in percentage row can be changed in the same way with the command \cmd{ctontranslation} \bigskip -\noindent\fbox{\cmd{ctontranslation}\graffe{on traslation}} +\noindent\fbox{\cmd{ctontranslation}\curlyp{on traslation}} +\bigskip -\subsection{Table width} +and the headers of the two \env{xcalctab} numeric columns can be setting with + +\bigskip +\noindent\fbox{\cmd{ctheaderone}\curlyp{first col text header}} +\noindent\fbox{\cmd{ctheadertwo}\curlyp{second col text header}} +% +% +% +\subsection{Increment the table width} The width of the \ct{} table can be adjust via a standard \LaTeX{} length called \cmd{ctsep} (default value is 8mm). The horizontal space will be add to the central column of the table. The next line is an example: \medskip @@ -371,6 +495,20 @@ The language efficacy is particularly important for the \LaTeX{} user. The \ct{} So one \emph{model} of structured data, can have more and more presentation \emph{view}. For example, a text with tabular structure can became a report or a graphic plot image. +\section{ToDo} +A big work remain to do until the release 1.0 version: a language design and implementation too of a new user interface that make easy modify the view paramenter of the table such as the type of label row (number, letter and so on), or to define the description text in the header column. + + +This list report tasks: + +\begin{itemize} + \item write in good english the package documentation; + \item internationalization of the fixed text in table and the currency unit; + \item data input and inner commands language development; + \item new infrastructure to manage the table view property; + \item \dots +\end{itemize} + \section{Package License} This work may be distributed and/or modified under the conditions of the \LaTeX{} Project Public License, either version 1.3 @@ -380,14 +518,46 @@ The latest version of this license is in and version 1.3 or later is part of all distributions of \LaTeX{} version 2005/12/01 or later. -\section{Thanks} -Thanks a lot to Professor Enrico Gregorio for help me to resolve some code problem: balance the table description paragraph width to the table variable width, save in a tokens registry the material of table so as over the implicit group barrier of tabular cell, and solve consequent \verb=\expandafter= \emph{jungle}. + +\section{Thanks and acknowledgments} + +The enthusiasm raised during GuIT\emph{meeting}2008 in Pisa (Italy)\footnote{For information please visit the site \url{www.guit.sssup.it/guitmeeting/2008/2008.it.php}} by the talk \emph{``Una tabella che fa calcoli''} and the tip suggest me by Norbert Preining (Vienna University of Technology) to upload on CTAN the code in experimental section, finally persuade me to publish this work. + +Thanks GuIT\emph{meeting}2008 people, thanks Norbert. + +Thanks a lot to Professor Enrico Gregorio for help me to resolve some code problem: balance the table description paragraph width to the table variable width, save in a tokens registry the material of table so as over the implicit group barrier of the tabular cells, and solve consequent \verb=\expandafter= \emph{jungle}. Thanks a lot to the authors of packages used by \pkg{calctab}. And finally, thanks to my family. Every comment are welcome as well as any language discussion, so don't esitate to send to the author an e-mail message with your opinion, suggestion or desiderata. Thank you. + + +\section{Change history} + +\begin{tabular}{lcp{257pt}}\toprule + Number & Date & Improvement description\\\midrule + 0.5 & 2009/02/23 & first \ct{} CTAN release\\\midrule + 0.6.1 & 2009/03/03 & New \cmd{inrule} command to manual draw a rule among + the table rows\\ + 0.6.2 & 2009/03/03 & Fixed bug: the absense of a rule after an add row\\ + 0.6.3 & 2009/03/05 & New \env{xcalctab} environment (extended environment + with the ``quantity'' and ``price'' columns)\\ + 0.6.4 & 2009/03/10 & New feature: automatic short of the description + string (A+B+C+$\cdots$) if it's long than more five items\\ + 0.6.5 & 2009/03/10 & Substituted the standard \LaTeX{} command \cmd{Alph} + with \cmd{AlphAlph} by Heiko Oberdiek to eliminate the 26 rows limit in + label column\\ + 0.6.6 & 2009/03/12 & New feature for \cmd{amount} command: basic binary + operation with two numbers thanks to \pkg{xstring} package\\ + 0.6.7 & 2009/03/12 & Some minor internal code adjustments\\\bottomrule +\end{tabular} + + + + + \end{document} |