ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Wolfgang Schuster" <schuster.wolfgang@googlemail.com>
To: "mailing list for ConTeXt users" <ntg-context@ntg.nl>
Cc: Hans Hagen <pragma@wxs.nl>
Subject: Re: Feature Request: \startitemize[text]
Date: Fri, 17 Oct 2008 08:27:18 +0200	[thread overview]
Message-ID: <115224fb0810162327j41395473l1fe35369585b23d3@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.0.9999.0801131632040.601@nqv-yncgbc>

On Sun, Jan 13, 2008 at 11:41 PM, Aditya Mahajan <adityam@umich.edu> wrote:
> Hi Hans,
>
> I have always found the space at the beginning of each item in
> \startitemize[text] to be too large. Currently, this is hard coded to be
> \emwidth plus \intertwordstretch minus \interwordshrink (line 1132 of
> core-itm.tex with the comment "new per 2006/10/20"). I always end of
> copying the definition of complexdoitemgroupitem to my private modules and
> changing the emwidth in the definition to 0.5\emwidth. Can you please keep
> this key to be configurable with a key (textinbetween)?
>
> BTW, any particular reason not to simply say
> \removeunwantedspaces\space\ignorespaces instead of
> \removeunwantedspaces\hskip\emwidth\!!plus\interwordstretch\!!minus\interwordshrink\relax
> \stopitemgroup uses just the first variant.
>
> Thanks,
> Aditya

Hi Aditya,

what do you about the following solution, the space between each
item is configurable with the "space" key, the fourth parameter
\dostartitemgroup gobbles we get from \startitemize if we use two
parameters.

\unprotect

\def\complexdoitemgroupitem[#1]%
  {\ifconditional\textlistitem
     % begin of item
   \else
     \par
   \fi
%    \ignorespaces
   \ifconditional\concatnextitem % new, concat
     \doitembreak\nobreak        % new, concat
   \fi                           % new, concat
   \doadvanceitem
   \ifcase\itemcolumndepth \ifnum\noflistelements>0\relax
     % wrong, but why was this here in the first place, probably some
     % mistaken change when cleaning up: \doitembreak\nobreak
   \fi\fi
   \ifconditional\firstlistitem
     \setfalse\firstlistitem
     \begingroup
     \ifcase\currentitemlevel
     \or % 1
       \ifcase\itemcolumndepth
         \ifconditional\introlistitem\doitembreak\nobreak\fi
         \itembeforecommand % \getitemparameter\currentitemlevel\c!before
         \ifconditional\introlistitem\doitembreak\nobreak\fi
       \fi
     \else % 2 en hoger
       \ifconditional\paragraphlistitem \else
         \let\previtemlevel\currentitemlevel
         \decrement\previtemlevel
         \ifcase\autoitemgroupspacing\relax % nieuw
           \itembeforecommand
         \or
            \doifelsenothing{\itembeforecommand}
              {\itembeforecommand}
              {\getitemparameter\previtemlevel\c!inbetween}%
         \else
           \getitemparameter\previtemlevel\c!inbetween % == itemlevel-1
         \fi
       \fi
     \fi
   \else
\ifconditional\textlistitem % was bugged: \inlinelistitem
\removeunwantedspaces
%     \removeunwantedspaces\hskip\interwordspace\!!plus\emwidth\relax
% new per 2006/10/20
%    \removeunwantedspaces\hskip\emwidth\!!plus\interwordstretch\!!minus\interwordshrink\relax
% new per 2006/10/20
% begin wolf
\doifsomethingelse{\getitemparameter\currentitemlevel\c!space}
  {\hskip\getitemparameter\currentitemlevel\c!space\relax}
  {\hskip\emwidth\!!plus\interwordstretch\!!minus\interwordshrink\relax}%
% end wolf
\else
     \iteminbetweencommand
\fi
   \fi
   \ifconditional\concatnextitem % new, concat
     \vskip-\lastskip            % new, concat
     \vskip-\lineheight          % new, concat
     \nobreak                    % new, concat
   \fi                           % new, concat
%    \ignorespaces
   \dolistitem
   \relax
   \ifconditional\packlistitem
     \setupwhitespace[\v!none]%
   \fi
   \getitemparameter\currentitemlevel\c!inner
   \marsymbol
   \let\marsymbol\relax
   \doifsomething{#1}
     {\doifnot\itemreference\unknownitemreference
        {\bgroup
         \protectconversion
         \rawreference\s!lst{#1}\itemreference
         \egroup}}%
   \strut % added 11-08-99
   \setfalse\concatnextitem % new, concat
   \nobreak % else problems with intext items
   \hskip\itemsignal        % new, concat
   \getitemparameter\currentitemlevel\c!command} % \defaultitemcommand

\def\startitemgroup
  {\doquadrupleempty\dostartitemgroup}

\def\dostartitemgroup[#1][#2][#3][]%
  {\bgroup
   \ifnum\currentitemlevel=\zerocount
     \def\currentitemgroup{#1}% no nested mixing of itemgroups
   \fi
   \ifthirdargument
     \dodostartitemgroup[#2][#3]%
   \else
     \doifassignmentelse{#2}
       {\dodostartitemgroup[][#2]}
       {\dodostartitemgroup[#2][]}%
   \fi}

\setupitemgroups
  [\c!space=]

\protect

\showframe

\starttext

before
\startitemize[text][space=\interwordspace]
\item text
\item text
\item text
\stopitemize
after

\stoptext

Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


  reply	other threads:[~2008-10-17  6:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-13 21:41 Aditya Mahajan
2008-10-17  6:27 ` Wolfgang Schuster [this message]
2008-10-17 17:01   ` Aditya Mahajan
2008-10-21  7:11     ` Wolfgang Schuster
2008-10-21 17:37     ` Hans Hagen

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=115224fb0810162327j41395473l1fe35369585b23d3@mail.gmail.com \
    --to=schuster.wolfgang@googlemail.com \
    --cc=ntg-context@ntg.nl \
    --cc=pragma@wxs.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).