[OS X TeX] Is longtable the environment I should use ?

Ross Moore ross at ics.mq.edu.au
Sun Feb 15 23:43:12 CET 2009


Hello again Ewan,

On 16/02/2009, at 6:26 AM, Ross Moore wrote:

>>   The quarrel I'm having with it is that it always avoids going to  
>> next
>> page when inside a section ; this causes a waste of space, with
>> many pages containing just one or a few sections.
>
> Try the effect of using  \par  instead of \newline
> at the end of items.

You do even better with those \newline s replaced by  \\&
to give more rows, rather than forcing very large cells.

Or use something like my suggestions below.


>>  Pheraps I should use an environment other than "longtable" ?
>>
>>   Also, I could not find out a way to combine the "longtable"  
>> capability
>> with automatic numbering (as with the \theorem environment).
>>   My (somewhat long) example is below.

You can implement a counter this way:

\newcounter{itemcount}
\renewcommand{\theitemcount}{\arabic{itemcount}. }
\newcommand{\myitem}[2][\\&]{#1%
  \stepcounter{itemcount}\textbf{\theitemcount#2} }

  ... where the optional argument '\\&' means that entries
create new rows and cells automatically; e.g. starting with

  \myitem{D\'efinition} ...

but when you don't want the new row use:

   &\myitem[]{G\'en\'eralit\'es} ...


You can even give yourself shorthands, as follows:

\newcommand{\newrow}{\\&}
\newcommand{\Exer}[1][\newrow]{\myitem[#1]{Exercice}}
\newcommand{\Defn}[1][\newrow]{\myitem[#1]{D\'efinition}}
\newcommand{\Gener}[1][\newrow]{\myitem[#1]{G\'en\'eralit\'es}}


Now these are used like:

   ... &\Gener[] .....
   \Exer ....
   \Exer ....
   \Defn ....
etc.


Hope this helps,

	Ross


------------------------------------------------------------------------
Ross Moore                                       ross at maths.mq.edu.au
Mathematics Department                           office: E7A-419
Macquarie University                             tel: +61 (0)2 9850 8955
Sydney, Australia  2109                          fax: +61 (0)2 9850 8114
------------------------------------------------------------------------






More information about the macostex-archives mailing list