ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Table of contents, alternative d
@ 2004-11-28 15:46 Dirar BOUGATEF
  2004-11-29 17:10 ` Dirar BOUGATEF
  2004-11-29 19:35 ` Willi Egger
  0 siblings, 2 replies; 10+ messages in thread
From: Dirar BOUGATEF @ 2004-11-28 15:46 UTC (permalink / raw)


Hi all,

Am using the alternative d for my table of contents, i know how to align my 
elements left (from the left margin) but can't manage to do that at the 
right side (from the right margin).

This is how i configure things:

\definelist[part]
\setuplist[part][before={\blank[big]},after=\blank]
%
\definelist[chapter]
\setuplist[chapter][alternative=d,margin=2cm,left=(,right=),depth=2cm,before=\blank,after=\blank,style=Opulent]

\placecontent[level=chapter]

Any help .. Thanks.

Dirar.

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

* RE: Table of contents, alternative d
  2004-11-28 15:46 Table of contents, alternative d Dirar BOUGATEF
@ 2004-11-29 17:10 ` Dirar BOUGATEF
  2004-11-29 17:25   ` Hans Hagen
  2004-11-29 18:00   ` Patrick Gundlach
  2004-11-29 19:35 ` Willi Egger
  1 sibling, 2 replies; 10+ messages in thread
From: Dirar BOUGATEF @ 2004-11-29 17:10 UTC (permalink / raw)


>From the whole batch of answers i have received i could assume that there is 
no solution to this problem.
Am trying to produce the same table of contents as the one for the "Context 
the manual".
Hans, have you used your own alternative for that ?

Thanks in advance.

Dirar.

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

* Re: Table of contents, alternative d
  2004-11-29 17:10 ` Dirar BOUGATEF
@ 2004-11-29 17:25   ` Hans Hagen
  2004-11-29 21:02     ` Dirar BOUGATEF
  2004-11-29 18:00   ` Patrick Gundlach
  1 sibling, 1 reply; 10+ messages in thread
From: Hans Hagen @ 2004-11-29 17:25 UTC (permalink / raw)


Dirar BOUGATEF wrote:
>> From the whole batch of answers i have received i could assume that 
>> there is 
> 
> no solution to this problem.
> Am trying to produce the same table of contents as the one for the 
> "Context the manual".
> Hans, have you used your own alternative for that ?
> 
> Thanks in advance.

i lost track a bit (been away a few days) .. can you summarize the problem and 
make a minimal file to patch

Hans

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

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

* Re: Table of contents, alternative d
  2004-11-29 17:10 ` Dirar BOUGATEF
  2004-11-29 17:25   ` Hans Hagen
@ 2004-11-29 18:00   ` Patrick Gundlach
  1 sibling, 0 replies; 10+ messages in thread
From: Patrick Gundlach @ 2004-11-29 18:00 UTC (permalink / raw)


"Dirar BOUGATEF" <chabah5@hotmail.com> writes:

>> From the whole batch of answers i have received i could assume that
>> there is 
> no solution to this problem.

You could also conclude from the lack of answers that nobody feels to
make a working example of what you wanted to achieve.

You (and others, of course) can increase the chance of someone looking
into your problem by creating a complete and minimal example of what
you tried. It is of course not a guarantee to an answer, but let's say
the least thing that a person seeking help should do.

It is absolutely no use to publish only a few lines in case of a
problem. What the problem-solvers want is code that they can cut and
paste to their editor and run it. Then they look at the output and
then at the code and sometimes they know where the problem is. One
thing that a problem-solver will not want to do is fill in the
missing parts of posted code like in a high school exam.

I don't try to be smart here, it is just the fact how the community
works.

Patrick
-- 
ConTeXt wiki: http://contextgarden.net

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

* Re: Table of contents, alternative d
  2004-11-28 15:46 Table of contents, alternative d Dirar BOUGATEF
  2004-11-29 17:10 ` Dirar BOUGATEF
@ 2004-11-29 19:35 ` Willi Egger
  1 sibling, 0 replies; 10+ messages in thread
From: Willi Egger @ 2004-11-29 19:35 UTC (permalink / raw)


Hi Dirar,

As mentioned by Patrick, live would be easier to help, if you would 
provide a complete test-code ...

% Table of contents Dirar Bougatef

\setupoutput[pdftex]

% \definelist[part]
\setuplist[part][before={\blank[big]},after=\blank]

% \definelist[chapter]
\setuplist
	[chapter]
	[alternative=d,
	margin=2cm,
	left=(,
	right=),
	depth=2cm,
	before=\blank,
	after=\blank,
	style=bold]

\starttext
	\placecontent[level=chapter]
	\part{Dirar - part 1}
		\dorecurse{3}{\chapter{Dirar - chapter}}
	\part{Dirar - part 2}
		\dorecurse{3}{\chapter{Dirar - chapter}}
\stoptext

Fisrt of alle you do do not need to redefine commands which are already 
defined within context (Commented rows above).
Secondly, afaik the style option in the setuplist command has a 
predefined list of possibilities. So context will not understand "Opulent".

Kind regards Willi

Dirar BOUGATEF wrote:
> Hi all,
> 
> Am using the alternative d for my table of contents, i know how to align 
> my elements left (from the left margin) but can't manage to do that at 
> the right side (from the right margin).
> 
> This is how i configure things:
> 
> \definelist[part]
> \setuplist[part][before={\blank[big]},after=\blank]
> %
> \definelist[chapter]
> \setuplist[chapter][alternative=d,margin=2cm,left=(,right=),depth=2cm,before=\blank,after=\blank,style=Opulent] 
> 
> 
> \placecontent[level=chapter]
> 
> Any help .. Thanks.
> 
> Dirar.
> 
> 
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context

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

* Re: Table of contents, alternative d
  2004-11-29 17:25   ` Hans Hagen
@ 2004-11-29 21:02     ` Dirar BOUGATEF
  2004-11-30  0:53       ` Patrick Gundlach
  0 siblings, 1 reply; 10+ messages in thread
From: Dirar BOUGATEF @ 2004-11-29 21:02 UTC (permalink / raw)


Hi all,

Great idea, i now have a working sample (What i want is to control the right 
margin distance for both parts and chapters - Here i can control only the 
left margin distance which is 1.7cm for chapters)

\setupoutput[pdftex]

\setuphead [part]   
[align=left,page=right,placehead=yes,before={\hbox{}\vfill},after={\vfill}]
\setuphead [chapter][before=,after=\blank]

\setuplist 
[chapter][alternative=d,margin=1.7cm,left=(,right=),pagestyle=slanted,depth=2cm,before=\blank,after=\blank]
\setuplist [part]   [before={\blank[big]},after=\blank]


\starttext
\placecontent

\part{first part}
\chapter{Chapter one}
\chapter{Chapter two}
\chapter{Chapter three}
\chapter{Chapter four}
\chapter{Chapter five}

\part{second part}
\chapter{Chapter one}
\chapter{Chapter two}
\chapter{Chapter three}
\chapter{Chapter four}
\chapter{Chapter five}

\part{Third part}
\chapter{Chapter one}
\chapter{Chapter two}
\chapter{Chapter three}
\chapter{Chapter four}
\chapter{Chapter five}
\stoptext

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

* Re: Table of contents, alternative d
  2004-11-29 21:02     ` Dirar BOUGATEF
@ 2004-11-30  0:53       ` Patrick Gundlach
  2004-11-30  8:56         ` Dirar BOUGATEF
  0 siblings, 1 reply; 10+ messages in thread
From: Patrick Gundlach @ 2004-11-30  0:53 UTC (permalink / raw)


Hello Dirar,

> Great idea, i now have a working sample (What i want is to control the
> right margin distance for both parts and chapters - Here i can control
> only the left margin distance which is 1.7cm for chapters)

Where exactly do you want to control the distance? In the list?

You know about the distance=... parameter?

\setuplist
    [chapter]
    [alternative=d,
     margin=1.7cm,
     distance=2cm,
     left=(,
     right=),
     pagestyle=slanted,
     depth=2cm,
     before=\blank,
     after=\blank]


Patrick
-- 
ConTeXt wiki: http://contextgarden.net

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

* RE: Re: Table of contents, alternative d
  2004-11-30  0:53       ` Patrick Gundlach
@ 2004-11-30  8:56         ` Dirar BOUGATEF
  2004-11-30  9:56           ` Hans Hagen
  0 siblings, 1 reply; 10+ messages in thread
From: Dirar BOUGATEF @ 2004-11-30  8:56 UTC (permalink / raw)


Hi Patrick,

This is how my toc appears:

Part 1 first part 1–1
(1) Chapter one 1–2 (2) Chapter two 1–3 (3) Chapter three 1–4
(4) Chapter four 1–5 (5) Chapter five 1–6
Part 2 second part 2–1
(1) Chapter one 2–2 (2) Chapter two 2–3 (3) Chapter three 2–4
(4) Chapter four 2–5 (5) Chapter five 2–6
Part 3 Third part 3–1
(1) Chapter one 3–2 (2) Chapter two 3–3 (3) Chapter three 3–4
(4) Chapter four 3–5 (5) Chapter five 3–6

I want to control the distance for instance in the second and third line to 
the right margin (This means chapters indeed => Line5,6,8,9 too). This could 
result in the fact that my chapters will appear on 3 lines instead of 2 
here.

To my knowledge there is no parameter such as "distance" to change this. 
Here "distance" changes only the distance between chapter elements for 
instance: the element (1) Chapter one 1–2 and the element Chapter two 1–3 
(3). This how alternative d works (with elements).

This is how the result i want could be:

Part 1 first part                                                        1–1
(1) Chapter one 1–2 (2) Chapter two 1–3 (3) Chapter
three 1–4 (4) Chapter four 1–5 (5) Chapter five 1–6
Part 2 second part                                                   2–1
(1) Chapter one 2–2 (2) Chapter two 2–3 (3) Chapter
three 2–4 (4) Chapter four 2–5 (5) Chapter five 2–6
Part 3 Third part                                                      3–1
(1) Chapter one 3–2 (2) Chapter two 3–3 (3) Chapter
three 3–4 (4) Chapter four 3–5 (5) Chapter five 3–6

Thanks.

Dirar.

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

* Re: Re: Table of contents, alternative d
  2004-11-30  8:56         ` Dirar BOUGATEF
@ 2004-11-30  9:56           ` Hans Hagen
  2004-11-30 10:59             ` Dirar BOUGATEF
  0 siblings, 1 reply; 10+ messages in thread
From: Hans Hagen @ 2004-11-30  9:56 UTC (permalink / raw)


Dirar BOUGATEF wrote:
> Hi Patrick,
> 
> This is how my toc appears:
> 
> Part 1 first part 1–1
> (1) Chapter one 1–2 (2) Chapter two 1–3 (3) Chapter three 1–4
> (4) Chapter four 1–5 (5) Chapter five 1–6
> Part 2 second part 2–1
> (1) Chapter one 2–2 (2) Chapter two 2–3 (3) Chapter three 2–4
> (4) Chapter four 2–5 (5) Chapter five 2–6
> Part 3 Third part 3–1
> (1) Chapter one 3–2 (2) Chapter two 3–3 (3) Chapter three 3–4
> (4) Chapter four 3–5 (5) Chapter five 3–6
> 
> I want to control the distance for instance in the second and third line 
> to the right margin (This means chapters indeed => Line5,6,8,9 too). 
> This could result in the fact that my chapters will appear on 3 lines 
> instead of 2 here.
> 
> To my knowledge there is no parameter such as "distance" to change this. 
> Here "distance" changes only the distance between chapter elements for 
> instance: the element (1) Chapter one 1–2 and the element Chapter two 
> 1–3 (3). This how alternative d works (with elements).
> 
> This is how the result i want could be:
> 
> Part 1 first part                                                        
> 1–1
> (1) Chapter one 1–2 (2) Chapter two 1–3 (3) Chapter
> three 1–4 (4) Chapter four 1–5 (5) Chapter five 1–6
> Part 2 second part                                                   2–1
> (1) Chapter one 2–2 (2) Chapter two 2–3 (3) Chapter
> three 2–4 (4) Chapter four 2–5 (5) Chapter five 2–6
> Part 3 Third part                                                      3–1
> (1) Chapter one 3–2 (2) Chapter two 3–3 (3) Chapter
> three 3–4 (4) Chapter four 3–5 (5) Chapter five 3–6

An option is to use the narrower mechanism; unfortunately abc placement does not 
listen that so we need a patch (not sure if this is not breaking other things).

% this goes into core-sec or cont-new

\unprotect

\def\dodofixdlijstelementABC#1#2#3#4#5#6% weeden
   {\endgraf
    \leftskip\getvalue{\??li#1\c!margin}% na de \endgraf !
    \getvalue{\??li#1\c!before}%
    \!!widthc\getvalue{\??li#1\c!distance}%
    \doifelsevalue{\??li#1\c!width}\v!fit
      {\!!widtha\zeropoint}
      {\doifelsenothing{#3}
         {\doifelsevalue{\??li#1\c!aligntitle}\v!yes
            {\!!widtha\zeropoint
             \!!widthc\zeropoint}
            {\!!widtha\getvalue{\??li#1\c!width}}}
         {\!!widtha\getvalue{\??li#1\c!width}}}%
    \getvalue{\??li\c!alternative\getvalue{\??li#1\c!alternative}}%
    \endgraf
    \def\makelijstelement##1##2%
      {\doifelsevalue{\??li#1\c!interaction}{##1}
         {\setbox0\hbox{\showcontrastlocation\??ia{#6}{##2}}%
          \linklisttoelement{#1}{#2}{#5}{#6}{\box0}}%{\copy0}}%
         {\hbox{##2}}}%
    \doifvalue{\??li#1\c!interaction}\v!text % not supported
      {\setlistparameter{#1}\c!interaction\v!all}%
%    \makelijstelement\v!all
%      {\hbox to \hsize
    \makelijstelement\v!all
      {\setlocalhsize \hsize\localhsize \hbox to \hsize
         {\forgetall
          \dostartattributes{\??li#1}\c!style\c!color\empty
          \!!widthb\hsize
          \setbox2\hbox \ifdim\!!widtha>\zeropoint to \!!widtha \fi
            {\makelijstelement\v!sectionnumber
               {\dolistattributes{#1}\c!numberstyle\c!numbercolor
                  {\getvalue{\??li#1\c!numbercommand}{\currentlistsymbol}}%
             \hfill}}%
          \setbox4\hbox
            {\doifvalue{\??li#1\c!pagenumber}\v!yes
               {\doifsomething{#5}    % \lijstwidth is new ; temp hack
                  {\hbox \ifdim\lijstwidth>\zeropoint to \lijstwidth\fi
                     {\hfill
                      \makelijstelement\v!pagenumber
                        {\dolistattributes{#1}\c!pagestyle\c!pagecolor
                           {\getvalue{\??li#1\c!pagecommand}%
                              {\pageprefix\??li#1[#5]%
                               \translatednumber[#5]}}}}}}}%
          \vbox
            {\hsize\!!widthb
             \setupalign[\getvalue{\??li#1\c!align}]%
             \ifdim\!!widtha<\hsize
               \hangindent=\wd2
               \dimen2=\!!widthc % \getvalue{\??li#1\c!distance}%
               \advance\hangindent \dimen2
               \hangafter=1
               \doifvalue{\??li#1\c!hang}\v!no{\hangafter\zerocount}%
               \ifdim\wd4=\zeropoint % \ifvoid4
                 % we kunnen gewoon afbreken aan het eind
               \else
                 \ifdim\lijstskip>\zeropoint\relax
                   \rightskip=\lijstskip\!!plus10em\relax
                   \parfillskip=-\rightskip
                 \fi
               \fi
             \else
               \dimen2\zeropoint
             \fi
             \parindent\zeropoint\relax
             \leavevmode
             \box2\relax
             \hskip\dimen2
             \bgroup
             \dolistattributes{#1}\c!textstyle\c!textcolor
               {\let\\=\newlineinlist
                \dontconvertfont
               %\getvalue{\??li#1\c!textcommand}{#4}}%
                \limitatedlistentry{#1}{#4}}%
               %\carryoverpar % new otherwise wrong linespacing
             \egroup
             \ifdim\wd4=\zeropoint\relax % \ifvoid4
               % \ifdim\!!widtha<\hsize \hfill\strut \fi % spoils align
             \else
               \nobreak\lijstfill
               \box4\relax
               \relax
             \fi}%
          \hss
          \dostopattributes}}% new
    \nointerlineskip % anders verkeerde spatiering bij multi-line
    \endgraf
    \allowbreak
    \getvalue{\??li#1\c!after}}

\protect

\setuphead [part] 
[align=left,page=right,placehead=yes,before={\null\vfill},after={\vfill}]
\setuphead [chapter][before=,after=\blank]

\setuplist 
[chapter][alternative=d,left=(,right=),pagestyle=slanted,before=\blank,after=\blank]
\setuplist [part]   [before={\blank[big]},after=\blank]

\starttext

\startnarrower[2*right] \placecontent \stopnarrower \blank[4*big]

\startsetups chapter
   \blank \startnarrower[3*middle] \placecontent[criterium=local] \stopnarrower
\stopsetups

\placelist[part][criterium=text,after=\setups{chapter}]

\part{First part}       \chapter{Chapter one}  \chapter{Chapter two}
\chapter{Chapter three} \chapter{Chapter four} \chapter{Chapter five}

\part{Second part}      \chapter{Chapter one}  \chapter{Chapter two}
\chapter{Chapter three} \chapter{Chapter four} \chapter{Chapter five}

\part{Third part}       \chapter{Chapter one}  \chapter{Chapter two}
\chapter{Chapter three} \chapter{Chapter four} \chapter{Chapter five}

\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
-----------------------------------------------------------------

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

* Re: Re: Table of contents, alternative d
  2004-11-30  9:56           ` Hans Hagen
@ 2004-11-30 10:59             ` Dirar BOUGATEF
  0 siblings, 0 replies; 10+ messages in thread
From: Dirar BOUGATEF @ 2004-11-30 10:59 UTC (permalink / raw)


Whaaaaaaaaa

Thanks a lot to you all.

Hans,

I have tried:

\startnarrower[4*right] \placecontent \stopnarrower \blank[4*big]

This is exactly what i meant.

Unfortunately, there is a problem, which is in my opinion not related to 
TOC, but to Tex (or Context, you'll be able to tell).

i get a result like this:

Part 1 First part 1–1
(1) Chapter one 1–2 (2) Chapter two 1–3 (3) Chapter
                                                                ^^^^^^
three 1–4 (4) Chapter four 1–5 (5) Chapter
five 1–6
Part 2 Second part 2–1
(1) Chapter one 2–2 (2) Chapter two 2–3 (3)
Chapter
three 2–4 (4) Chapter four 2–5 (5) Chapter
five 2–6
Part 3 Third part 3–1
(1) Chapter one 3–2 (2) Chapter two 3–3 (3)
Chapter
three 3–4 (4) Chapter four 3–5 (5) Chapter
five 3–6

Why does Context cut all the lines at the right place, and not that second 
one ?

I got the same error the other day when i was writing a letter.
I had all the paragraphs aligned to the right at the same distance, but the 
last line of my document  didnt align with them, and i got a text like this:

ks dsdjkl fq sqfl  sdlkj f dsld sfjds
s ds sdjklf gfi lkdsjf ig lkdsjf oi fls
sjfskl id fsdl sdi  dsjfu fjs fl lùgdd
ks dsdjkl fq sqfl  sdlkj f dsld sfjds
s ds sdjklf gfi lkdsjf ig lkdsjf oi fls

sjfskl id fsdl sdi  dsjfu fjs fl lùgdd
ks dsdjkl fq sqfl  sdlkj f dsld sfjds
s ds sdjklf gfi lkdsjf ig lkdsjf oi fls
sjfskl id fsdl sdi  dsjfu fjs fl lùgdd

sdksjf dsjklf ds fsdkl fs fkldsf dj dslf dsjk fd.

How can i control this ?

Thanks in advance.

Dirar.

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

end of thread, other threads:[~2004-11-30 10:59 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-28 15:46 Table of contents, alternative d Dirar BOUGATEF
2004-11-29 17:10 ` Dirar BOUGATEF
2004-11-29 17:25   ` Hans Hagen
2004-11-29 21:02     ` Dirar BOUGATEF
2004-11-30  0:53       ` Patrick Gundlach
2004-11-30  8:56         ` Dirar BOUGATEF
2004-11-30  9:56           ` Hans Hagen
2004-11-30 10:59             ` Dirar BOUGATEF
2004-11-29 18:00   ` Patrick Gundlach
2004-11-29 19:35 ` Willi Egger

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