ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: problems with indented columnized itemization
Date: Fri, 15 Oct 2004 11:18:26 +0200	[thread overview]
Message-ID: <416F95E2.2060002@wxs.nl> (raw)
In-Reply-To: <416D586D.400@gmx.de>

Stefan Wachter wrote:
> Hi all,
> 
> I try to generate the following output:
> 
> Some Label          * item 1      * item 2   * item 3
>                                 * item 4      * item 4   * item 5
> 
> i.e. I want to have a label followed by an itemization that is set in 
> columns.
> 
> I tried several things but did not succeede
> 
> 1. Variant - a tabulate environment
> 
> \starttabulate[|l|p|]
> \NC
> \inframed[width=\LabelWidth,align=left]{Teilnehmer}\hskip\SepWidth
> \NC
> \startitemize[columns,three]
> \item Bauherr
> \item Architekt
> \item Bauleiter
> \stopitemize
> \NC\NR
> \stoptabulate

this is beyond the tabulate handler; i guess i can implement support for 
that but it's not that trivial (using simplecolumns and collecting lines 
and such)

> There the following problems: a) the itemization introduces an 
> additional empty line and b) the [columns,three] parameter is not 
> considered.
> 
> 2. Variant - using a narrower
> 
> \startnarrower[left]
> \startitemize[columns,three]
> \item Bauherr
> \item Architekt
> \item Bauleiter
> \stopitemize
> \stopnarrower
> 
> The problem with this variant is that the coluns do not respect the 
> right margin, i.e. the items reach beyond the paper.
> 
> 
> Has anyone a solution for this problem?

see end of mail; the third one only works with the patched macro:

\unprotect

\def\redostartitemgroup[#1][#2]%
   {\setfalse\inlinelistitem % new, no indent (leftskip)
    \setfalse\concatnextitem % new, concat
    \ifhmode
      \ifconditional\autoconcatnextitem % new, concat
        \ifdim\lastskip=\itemsignal     % new, concat
          \settrue\concatnextitem       % new, concat
        \fi                             % new, concat
      \fi                               % new, concat
      \iftextitems\else\doifnotinset\v!text{#1}\par\fi % suboptimal
    \fi
    \begingroup
    \ifnum\itemlevel=\plusone % NIEUW
      \doadaptleftskip {\getitemparameter1\c!margin}%
      \doadaptleftskip {\getitemparameter1\c!leftmargin}%
      \doadaptrightskip{\getitemparameter1\c!rightmargin}%
    \fi
   \dosetraggedcommand{\getitemparameter\itemlevel\c!align}\raggedcommand
    \doifsomething{\getitemparameter\itemlevel\c!indenting}
      {% is \expanded needed?
    \expanded{\setupindenting[\getitemparameter\itemlevel\c!indenting]}}%
    \doifinset\v!columns{#1}%
      {\ifinsidecolumns\else\ifnum\itemcolumndepth=\zerocount
         \globallet\itemcolumndepth\itemlevel
         \getitemparameter\itemlevel\c!before
         \processfirstactioninset
           [#1]
           [  \v!one=>\!!counta1\relax,
              \v!two=>\!!counta2\relax,
            \v!three=>\!!counta3\relax,
             \v!four=>\!!counta4\relax,
             \v!five=>\!!counta5\relax,
          \s!unknown=>\@EA\!!counta\getitemparameter\itemlevel\c!n]%
         % new
%         \edef\columneditemleftskip{\the\leftskip}%
%         \def\postprocesscolumnbox##1%
%           {\scratchdimen\columneditemleftskip
%            \divide\scratchdimen \nofcolumns
%            \hbox{\hskip\columneditemleftskip\hbox{\box##1}}}%
%         \scratchdimen-\columneditemleftskip
%         \multiply\scratchdimen \nofcolumns
%         \advance\scratchdimen \columneditemleftskip
%         \advance\scratchdimen \hsize
%         \edef\columntextwidth{\the\scratchdimen}%
%         \leftskip\zeropoint
         % so far
         \startcolumns
           [\c!n=\!!counta, % netter \??op\itemlevel\c!n
            \c!height=,
            \c!rule=\v!off,
            \c!balance=\v!yes,
            \c!align=\v!no]%
       \fi\fi}%
    \doifinsetelse\v!intro{#1}\itemintrotrue\itemintrofalse
    \doglobal\increment\noflists
    \let\currentlist\noflists
    \newcounter\noflistelements
    \headitemfalse
    \subitemfalse
    \symbolitemfalse
    \let\marsymbol\relax
    \globallet\somdestination\empty
    \let\symsymbol\empty
    \the\itemgroupcommands
    \setitemlevel{#1}%
   %\getitemparameter\itemlevel\empty
    \let\listitem\empty % ** start value
    \doifelsenothing{#1} % iffirstargument
      {\edef\@@opsymbol{\getitemparameter\itemlevel\c!symbol}%
       \letgvalueempty{\@@globalitemsymbol\itemlevel}%
       \global\letitemparameter\itemlevel\v!continue\empty
     % \setitemmark\@@opsymbol % ** default value
       \dosetupitemgroupvariable[\itemlevel][#2]}
      {\dosetupitemgroupconstant[\itemlevel][#1]%
       \dosetupitemgroupvariable[\itemlevel][#2]%
       \doifinsetelse\v!continue{#1}% 
{\edef\@@opsymbol{\noexpand\getvalue{\@@globalitemsymbol\itemlevel}}%
          \getitemparameter\itemlevel\v!continue} 
{\edef\@@opsymbol{\noexpand\getitemparameter{\itemlevel}{\c!symbol}}%
          \global\setitemparameter\itemlevel\v!continue
            {\dosetupitemgroupconstant[\itemlevel][#1]%
             \dosetupitemgroupvariable[\itemlevel][#2]}}%
       \def\docommando##1% \setitemmark resets \docommando
         {\doifnot{##1}{0}{\setitemmark{##1}}}%
     % \processcommalist[#1,\@@opsymbol]\docommando
       \processcommalist[#1]\docommando}%
    \ifx\listitem\empty
      \setitemmark\@@opsymbol
      \ifx\listitem\empty
        \edef\currentitemsymbol{\itemlevel}%
      \fi
    \fi
    \ifautoitemintro\ifnum\prevgraf<3
      \itemintrotrue
    \fi\fi
    \ifparagraphitems
      \ifnum\itemlevel>\plusone
        \letitemparameter\itemlevel\c!inbetween\empty
      \fi
    \else\ifpackeditems
      \letitemparameter\itemlevel\c!inbetween\empty
    \fi\fi
    \calculatelistwidth\itemlevel{\dimen0}%
    \ifdim\dimen0>\zeropoint\relax
      \ifconditional\inlinelistitem\else
        \advance\leftskip \dimen0\relax
      \fi
    \fi}

\protect

\starttext

\setupbodyfont[small]

\showframe

\startnarrower[left]
\startcolumns[n=3]
\startitemize
\item \input ward
\item \input ward
\item \input ward
\stopitemize
\stopcolumns
\stopnarrower

\blank

\startnarrower[left]
\startitemize[columns,three]
\item \input ward
\item \input ward
\item \input ward
\stopitemize
\stopnarrower

\blank

\setupitemize[leftmargin=1.5em]

\startitemize[columns,three]
\item \input ward
\item \input ward
\item \input ward
\stopitemize

\stoptext



-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------

      reply	other threads:[~2004-10-15  9:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-13 16:31 Stefan Wachter
2004-10-15  9:18 ` Hans Hagen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=416F95E2.2060002@wxs.nl \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).