ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* itemize / text indent
@ 2009-11-15  9:46 Wolfgang Schuster
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Schuster @ 2009-11-15  9:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: 1.tex --]
[-- Type: application/octet-stream, Size: 6136 bytes --]

\unprotected\def\complexdoitemgroupitem[#1]%
  {\def\currentitemreference{#1}%
   \ifconditional\textlistitem
     % begin of item
   \else
     \par
   \fi
   \ifconditional\concatnextitem % new, concat
     \noitembreak                % new, concat
   \fi                           % new, concat
   \doadvanceitem
   \ifconditional\firstlistitem
     \setfalse\firstlistitem
     \begingroup
     \ifcase\currentitemlevel
     \or % 1
       \ifcase\itemcolumndepth
         \ifconditional\introlistitem\noitembreak\fi
         \itembeforecommand
         \ifconditional\introlistitem\noitembreak\fi
       \fi
     \else % 2 en hoger
       \ifconditional\paragraphlistitem \else
         \edef\previtemlevel{\the\numexpr\currentitemlevel-1}%
         \ifcase\autoitemgroupspacing\relax % nieuw
           \itembeforecommand
         \or
            \doifelsenothing\itembeforecommand\itembeforecommand{\getitemparameter\previtemlevel\c!inbetween}%
         \else
           \getitemparameter\previtemlevel\c!inbetween
         \fi
       \fi
     \fi
   \else
     \ifconditional\textlistitem % was bugged: \inlinelistitem
       \ifhmode
         \removeunwantedspaces\hskip\emwidth\!!plus\interwordstretch\!!minus\interwordshrink\relax
       \fi % new per 2006/10/20
     \else
       \iteminbetweencommand
     \fi
   \fi
   \ifconditional\concatnextitem
     \vskip-\dimexpr\lastskip+\lineheight\relax
     \nobreak
   \fi
   \dolistitem
   \relax
   \ifconditional\packlistitem
     \setupwhitespace[\v!none]%
   \fi
   \getitemparameter\currentitemlevel\c!inner
   \marsymbol
   \let\marsymbol\relax
   \strut % added 11-08-99
   \setfalse\concatnextitem % new, concat
   \nobreak % else problems with intext items
   \hskip\itemsignal        % new, concat
   \getitemparameter\currentitemlevel\c!command} % \defaultitemcommand

\unprotected\def\dolistitem % evt aantal items opslaan per niveau, scheelt zoeken
  {\ifconditional\textlistitem
    % begin of item
   \else
     \par
   \fi
   \advance\noflistelements\plusone
   \optimizelistitemsbreak
   \checkindentation\ifindentation\indent\else\noindent\fi
   %\noindent
   \setbox\itemgroupitembox\hbox
     {\ifconditional\headlistitem
        \ifconditional\symbollistitem
          \dosetitemattributes\currentitemlevel\c!symstyle\c!symcolor{\symsymbol}%
        \else
          \dosetitemattributes\currentitemlevel\c!headstyle\c!headcolor{\listitem}%
        \fi
      \else
        \ifconditional\symbollistitem
          \dosetitemattributes\currentitemlevel\c!symstyle\c!symcolor{\symsymbol}%
        \else
          \dosetitemattributes\currentitemlevel\c!style\c!color{\listitem}%
        \fi
      \fi}%
    \ifconditional\fittinglistitems
      \ifdim\wd\itemgroupitembox>\getitemparameter\currentitemlevel\c!maxwidth sp\relax
        \xsetitemparameter\currentitemlevel\c!maxwidth{\number\wd\itemgroupitembox}%
      \fi
      \ifdim\currentitemmaxwidth>\zeropoint
        \setbox\itemgroupitembox\simplealignedbox{\getitemparameter\currentitemlevel\c!itemalign}{\currentitemmaxwidth}{\box\itemgroupitembox}%
      \fi
   \fi
   \doifsomething\doitemdestination
     {\setbox\itemgroupitembox\hbox{\directgotobox{\box\itemgroupitembox}[\doitemdestination]}}%
   \globallet\doitemdestination\empty
   \itemgroupaskedwidth\getitemparameter\currentitemlevel\c!width\relax
   % new, prevents loops when symbol is (not yet found) graphic
   \ht\itemgroupitembox\strutheight
   \dp\itemgroupitembox\strutdepth
   % so that content differs per run (esp mp graphics afterwards)
   \checkforrepeatedlistitem
   \ifdim\itemgroupaskedwidth<\zeropoint\relax
     \llap{\ifconditional\sublistitem\llap{+\enspace}\fi\box\itemgroupitembox\hskip\leftmargindistance}%
   \else
     \ifdim\itemgroupaskedwidth=\zeropoint\relax
       \calculatelistwidth1%
     \else
       \calculatelistwidth\currentitemlevel
     \fi
     \ifconditional\textlistitem
       \hbox{\ifconditional\sublistitem+\enspace\fi\box\itemgroupitembox\hskip\interwordspace}\nobreak
     \else\ifconditional\inlinelistitem
       \hbox to \itemgrouplistwidth{\ifconditional\sublistitem\llap{+\enspace}\fi\box\itemgroupitembox\hss}% was: \hfill
     \else\ifconditional\txtlistitem
       \dodotxtitem
     \else
       % todo: align+marge binnen de hbox
       \llap{\hbox to \itemgrouplistwidth{\ifconditional\sublistitem\llap{+\enspace}\fi
                              \symalignleft
                              \box\itemgroupitembox\hfil
                              \hskip\getitemparameter\currentitemlevel\c!distance% T h
                              }}%
     \fi\fi\fi
   \fi
   \forceunexpanded % needed for m conversion (\os) / i need to look into this
   \setevalue{\@@currentitemsymbol\currentitemlevel}%
     {\getvalue{\@@localitemsymbol\currentitemlevel}}% still problems with \uchar ?
    %{\noexpand\getvalue{\@@localitemsymbol\currentitemlevel}}% no, spoils subrefs
   \resetunexpanded
   \setfalse\headlistitem
   \setfalse\sublistitem
   \setfalse\symbollistitem
   \EveryPar{\ignorespaces}% needed ?
   \ignorespaces}

\setupindenting[yes,big]

\starttext

text text text text text text text text text text text text text text text text text text text text text text text text

\startitemize[text]\indentationfalse

\item text text text text text text text text text text text text text text text text text text text text text text text text

\item text text text text text text text text text text text text text text text text text text text text text text text text

\stopitemize

text text text text text text text text text text text text text text text text text text text text text text text text

\startitemize[joinedup,intext][indenting={yes,first,big}]\indentationfalse

\item text text text text text text text text text text text text text text text text text text text text text text text text

\item text text text text text text text text text text text text text text text text text text text text text text text text

\stopitemize

text text text text text text text text text text text text text text text text text text text text text text text text

\stoptext

[-- Attachment #2: Type: text/plain, Size: 4622 bytes --]


Hi,

there had been a question on the list from Vyatcheslav Yatskovsky how to get indented text
inside of itemize and after i spent a few hours on this problem the answer is it's not possible.

His example (simplified from me) was:

\setupindenting[yes,big]

\starttext

text text text text text text text text text text text text text text text text text text text text text text text text

\startitemize[text][indenting={yes,first,big}]

\item text text text text text text text text text text text text text text text text text text text text text text text text

\item text text text text text text text text text text text text text text text text text text text text text text text text

\item text text text text text text text text text text text text text text text text text text text text text text text text

\stopitemize

text text text text text text text text text text text text text text text text text text text text text text text text

\stoptext

and as you can see the second and all following items are indented but this has nothing to do with
indenting and is a side effect of the 'text' option which is meant for inline items where no blank
line is expected between the '\item'’s because the should be all in the same paragraph as in:

\setupindenting[yes,big]

\starttext

text text text text text text text text text text text text text text text text text text text text text text text text
\startitemize[text]
\item text text text text text text text text text text text text text text text text text text text text text text text text
\item text text text text text text text text text text text text text text text text text text text text text text text text
\item text text text text text text text text text text text text text text text text text text text text text text text text
\stopitemize
text text text text text text text text text text text text text text text text text text text text text text text text

\stoptext

Even tough the 'text' option is wrong here (because 'joinedup' gives the same output but without indentation) we should
take care of this and insert the distance between the items only in horizontal mode.

To do so change in the definition for \complexdoitemgroupitem the following line:

   \else
     \ifconditional\textlistitem % was bugged: \inlinelistitem
       \removeunwantedspaces\hskip\emwidth\!!plus\interwordstretch\!!minus\interwordshrink\relax % new per 2006/10/20
     \else
       \iteminbetweencommand
     \fi
   \fi

to

   \else
     \ifconditional\textlistitem % was bugged: \inlinelistitem
       \ifhmode
         \removeunwantedspaces\hskip\emwidth\!!plus\interwordstretch\!!minus\interwordshrink\relax % new per 2006/10/20
       \fi
     \else
       \iteminbetweencommand
     \fi
   \fi

and while we already change this make the space between the items changeable, e.g. with (old feature request in the list archive)

   \else
     \ifconditional\textlistitem % was bugged: \inlinelistitem
       \ifhmode
         \processaction
           [\getitemparameter\currentitemlevel\c!space]
           [   \v!none=>\let\textitemdistance\zeropoint,
            \s!unknown=>\assignvalue\commalistelement\textitemdistance{.5\interwordspace\!!plus.5\emwidth}{\interwordspace\!!plus\emwidth}{\emwidth\!!plus\interwordstretch\!!minus\interwordshrink}]%
         \removeunwantedspaces\hskip\textitemdistance\relax
       \fi % new per 2006/10/20
     \else
       \iteminbetweencommand
     \fi
   \fi


The next point is to enable the indenting parameter which isn't functioning at all because at the start of each
item command (\dolistitem) a \noindent command prevents it from working. One way to fix is to replace \noitem
with \checkindentation\ifindentation\indent\else\noindent\fi and \indentationfalse to startitemgroup.

When these changes are done one could indent the text in itemize with:

\setupindenting[yes,big]

\starttext

text text text text text text text text text text text text text text text text text text text text text text text text

\startitemize[joinedup,intext][indenting={yes,first,big}]

\item text text text text text text text text text text text text text text text text text text text text text text text text

\item text text text text text text text text text text text text text text text text text text text text text text text text

\stopitemize

text text text text text text text text text text text text text text text text text text text text text text text text

\stoptext

Wolfgang


[-- Attachment #3: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: itemize / text indent
       [not found] <mailman.441.1258297736.22155.ntg-context@ntg.nl>
@ 2009-11-15 17:35 ` Vyatcheslav Yatskovsky
  0 siblings, 0 replies; 4+ messages in thread
From: Vyatcheslav Yatskovsky @ 2009-11-15 17:35 UTC (permalink / raw)
  To: ntg-context

On 15.11.2009 17:08, ntg-context-request@ntg.nl wrote:
>> 2) How can I control the distance between the mark and item text? The space seems too big.
>>      
> Use the 'width' and 'distance' keys.
>
> Wolfgang
>
>
>    
Thank you! Actually, "n*serried" works excellent, as in my final setup:

\setupitemize[each][1,joinedup,intext,1*serried][indenting={yes,first,big}]


Regards,
Vyatcheslav
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: itemize / text indent
  2009-11-15 14:27 ` Vyatcheslav Yatskovsky
@ 2009-11-15 14:33   ` Wolfgang Schuster
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Schuster @ 2009-11-15 14:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 15.11.2009 um 15:27 schrieb Vyatcheslav Yatskovsky:

> 2) How can I control the distance between the mark and item text? The space seems too big.

Use the 'width' and 'distance' keys.

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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: itemize / text indent
       [not found] <mailman.438.1258278267.22155.ntg-context@ntg.nl>
@ 2009-11-15 14:27 ` Vyatcheslav Yatskovsky
  2009-11-15 14:33   ` Wolfgang Schuster
  0 siblings, 1 reply; 4+ messages in thread
From: Vyatcheslav Yatskovsky @ 2009-11-15 14:27 UTC (permalink / raw)
  To: ntg-context, Wolfgang Schuster

Hello Wolfgang
> there had been a question on the list from Vyatcheslav Yatskovsky how to get indented text
> inside of itemize
Thank you very much! It works like charm now.

1) Will this fix be applied to core files?

2) How can I control the distance between the mark and item text? The 
space seems too big.

Thankfully,
Vyatcheslav


___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-11-15 17:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-15  9:46 itemize / text indent Wolfgang Schuster
     [not found] <mailman.438.1258278267.22155.ntg-context@ntg.nl>
2009-11-15 14:27 ` Vyatcheslav Yatskovsky
2009-11-15 14:33   ` Wolfgang Schuster
     [not found] <mailman.441.1258297736.22155.ntg-context@ntg.nl>
2009-11-15 17:35 ` Vyatcheslav Yatskovsky

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).