ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \placelist disturbs grid?
@ 2005-08-03 21:30 Vit Zyka
  2005-08-03 22:16 ` Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: Vit Zyka @ 2005-08-03 21:30 UTC (permalink / raw)


Hello Hans, Taco, and the next gurus,

sorry for bother with another thing I can not understand. Very high 
glyphs like \v S disturb grid in the \placelist. The same glyph in the 
common paragraph with the same (intentionally) interline setting 
preserves grid:

---------------------------------------
\setupbodyfont[10pt,rm]
\setupinterlinespace[line=12pt]
\setuplayout[grid=yes,width=8cm]
\showgrid

\writetolist[section]{}{See the next line:}
\writetolist[section]{}{\v Sejba}
\writetolist[section]{}{Another list line}

\starttext
\v Sejba\par
Here grid is OK, but in \type{placelist}:

\placelist[section]

no!
\stoptext
------------------------------------------
I was looking in definitions for some font-size dependent line setting, 
I also tried to
\setuplist[section]{style=\baselineskip=12pt\lineskiplimit=-10pt}
but without success to lounging on the grid.

Can somebody help me, please?
vit

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

* Re: \placelist disturbs grid?
  2005-08-03 21:30 \placelist disturbs grid? Vit Zyka
@ 2005-08-03 22:16 ` Hans Hagen
  2005-08-04 22:30   ` Vit Zyka
  0 siblings, 1 reply; 5+ messages in thread
From: Hans Hagen @ 2005-08-03 22:16 UTC (permalink / raw)


Vit Zyka wrote:

> Hello Hans, Taco, and the next gurus,
>
> sorry for bother with another thing I can not understand. Very high 
> glyphs like \v S disturb grid in the \placelist. The same glyph in the 
> common paragraph with the same (intentionally) interline setting 
> preserves grid:
>
> ---------------------------------------
> \setupbodyfont[10pt,rm]
> \setupinterlinespace[line=12pt]
> \setuplayout[grid=yes,width=8cm]
> \showgrid
>
> \writetolist[section]{}{See the next line:}
> \writetolist[section]{}{\v Sejba}
> \writetolist[section]{}{Another list line}
>
> \starttext
> \v Sejba\par
> Here grid is OK, but in \type{placelist}:
>
> \placelist[section]
>
> no!
> \stoptext
> ------------------------------------------
> I was looking in definitions for some font-size dependent line 
> setting, I also tried to
> \setuplist[section]{style=\baselineskip=12pt\lineskiplimit=-10pt}
> but without success to lounging on the grid.


this is the default ratio:

\setupinterlinespace
  [height=.72,
   depth=.28]

you can change that (as long as it adds up to 1.0) 

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] 5+ messages in thread

* Re: \placelist disturbs grid?
  2005-08-03 22:16 ` Hans Hagen
@ 2005-08-04 22:30   ` Vit Zyka
  2005-08-05  9:01     ` Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: Vit Zyka @ 2005-08-04 22:30 UTC (permalink / raw)


Hans Hagen wrote:
> Vit Zyka wrote:
> 
>> Hello Hans, Taco, and the next gurus,
>>
>> sorry for bother with another thing I can not understand. Very high 
>> glyphs like \v S disturb grid in the \placelist. The same glyph in the 
>> common paragraph with the same (intentionally) interline setting 
>> preserves grid:
>>
>> ---------------------------------------
>> \setupbodyfont[10pt,rm]
>> \setupinterlinespace[line=12pt]
>> \setuplayout[grid=yes,width=8cm]
>> \showgrid
>>
>> \writetolist[section]{}{See the next line:}
>> \writetolist[section]{}{\v Sejba}
>> \writetolist[section]{}{Another list line}
>>
>> \starttext
>> \v Sejba\par
>> Here grid is OK, but in \type{placelist}:
>>
>> \placelist[section]
>>
>> no!
>> \stoptext
>> ------------------------------------------
>> I was looking in definitions for some font-size dependent line 
>> setting, I also tried to
>> \setuplist[section]{style=\baselineskip=12pt\lineskiplimit=-10pt}
>> but without success to lounging on the grid.
> 
> 
> 
> this is the default ratio:
> 
> \setupinterlinespace
>  [height=.72,
>   depth=.28]

Thank you Hans; after some experimenting I understood:
- height and depth in \setupinterlinespace are baseline-ratio/size of 
struts (add description to tex-show)
- some my chars (/,\v S, \tfa, ...) oversized \strut size of any ratio
- list items are typeset with struts (perhaps all alternative)
- only alternative without strut is 'none' with command=\Mycommand def

So I do know how to preserve grid. But I do not know HOW TO TYPESET 
\Mycommand TO FIT THE PARAGRAPH WIDTH. It seem it is not in the 
restricted horizontal mode and continue on one long line. And another 
question/request: can the list distance param (alternative d,...) be 
glue instead of skip? For better line fitting.

example:
------------------
\setupbodyfont[10pt,rm]
\setupinterlinespace[line=12pt,height=.77,depth=.23]
\setuplayout[grid=yes,width=8cm]
\showgrid

\setuplist[section]
   [style=\tfd,alternative=none,command=\MyListItem]
\def\MyListItem#1#2#3{{\tfb (#1-#2-#3) }}

\starttext
\writetolist[section]{}{See the next line}
\writetolist[section]{}{\v Sejba}
\writetolist[section]{}{Another list line}
\writetolist[section]{}{And the last one}

\lineskiplimit=-10pt
Line\par
Anothet line of \v Sejba\par

\placelist[section]

\strut  %% should be! why?
After list line.

\stoptext
------------------

Vit

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

* Re: \placelist disturbs grid?
  2005-08-04 22:30   ` Vit Zyka
@ 2005-08-05  9:01     ` Hans Hagen
  2005-08-09 15:50       ` Vit Zyka
  0 siblings, 1 reply; 5+ messages in thread
From: Hans Hagen @ 2005-08-05  9:01 UTC (permalink / raw)


Vit Zyka wrote:

> Hans Hagen wrote:
>
>> Vit Zyka wrote:
>>
>>> Hello Hans, Taco, and the next gurus,
>>>
>>> sorry for bother with another thing I can not understand. Very high 
>>> glyphs like \v S disturb grid in the \placelist. The same glyph in 
>>> the common paragraph with the same (intentionally) interline setting 
>>> preserves grid:
>>>
>>> ---------------------------------------
>>> \setupbodyfont[10pt,rm]
>>> \setupinterlinespace[line=12pt]
>>> \setuplayout[grid=yes,width=8cm]
>>> \showgrid
>>>
>>> \writetolist[section]{}{See the next line:}
>>> \writetolist[section]{}{\v Sejba}
>>> \writetolist[section]{}{Another list line}
>>>
>>> \starttext
>>> \v Sejba\par
>>> Here grid is OK, but in \type{placelist}:
>>>
>>> \placelist[section]
>>>
>>> no!
>>> \stoptext
>>> ------------------------------------------
>>> I was looking in definitions for some font-size dependent line 
>>> setting, I also tried to
>>> \setuplist[section]{style=\baselineskip=12pt\lineskiplimit=-10pt}
>>> but without success to lounging on the grid.
>>
>>
>>
>>
>> this is the default ratio:
>>
>> \setupinterlinespace
>>  [height=.72,
>>   depth=.28]
>
>
> Thank you Hans; after some experimenting I understood:
> - height and depth in \setupinterlinespace are baseline-ratio/size of 
> struts (add description to tex-show)
> - some my chars (/,\v S, \tfa, ...) oversized \strut size of any ratio
> - list items are typeset with struts (perhaps all alternative)
> - only alternative without strut is 'none' with command=\Mycommand def
>
> So I do know how to preserve grid. But I do not know HOW TO TYPESET 
> \Mycommand TO FIT THE PARAGRAPH WIDTH. It seem it is not in the 
> restricted horizontal mode and continue on one long line. And another 
> question/request: can the list distance param (alternative d,...) be 
> glue instead of skip? For better line fitting.
>
> example:
> ------------------
> \setupbodyfont[10pt,rm]
> \setupinterlinespace[line=12pt,height=.77,depth=.23]
> \setuplayout[grid=yes,width=8cm]
> \showgrid
>
> \setuplist[section]
>   [style=\tfd,alternative=none,command=\MyListItem]
> \def\MyListItem#1#2#3{{\tfb (#1-#2-#3) }}
>
> \starttext
> \writetolist[section]{}{See the next line}
> \writetolist[section]{}{\v Sejba}
> \writetolist[section]{}{Another list line}
> \writetolist[section]{}{And the last one}
>
> \lineskiplimit=-10pt
> Line\par
> Anothet line of \v Sejba\par
>
> \placelist[section]
>
> \strut  %% should be! why?
> After list line.
>
> \stoptext
> ------------------
>
> Vit

\setuplist
  [section]
  [style=\tfd,
   alternative=none,
   after=\blank,
   before=\blank,
   command=\MyListItem]

\setuplist
  [section]
  [style=\tfd,
   alternative=command
   command=\MyListItem]

in core-lst you can see how the alternatives are defined 

ok, let's give you a bonus (goes in cont-new): 

\unprotect 

\def\definelistplacement
  {\dodoubleempty\dodefinelistplacement}

\def\dodefinelistplacement[#1][#2]%
  {\setvalue{\@@dodolistelement#1}%
     {\doifelsenothing{#2}
        {\getvalue{\@@dodolistelement\v!command}}%
        {\executeifdefined{\@@dodolistelement#2}
           {\getvalue{\@@dodolistelement\v!command}}}%
     \setvalue{\??li\currentlist\c!command}%
       {\getvalue{\@@dodolistelement::#1}}}%
   \setvalue{\@@dodolistelement::#1}}

\definelistplacement[MyListItem][none]#1#2#3%
  {\listparameter{style} (#1 - #2 - #3) }

\protect 

now you can say: 

\definelistplacement[MyListItem][none]#1#2#3%
  {\listparameter{style} (#1 - #2 - #3) }

\setuplist
  [section]
  [style=\tfd,
   alternative=MyListItem,
   after=\blank,
   before=\blank]

(btw, watch how one can ask for listparameters)  

\definelistplacement[MyListItem][none]#1#2#3%
  {\listparameter{style} (#1 - #2 - #3) }

\setuplist
  [section]
  [style=\tfd,
   alternative=MyListItem,
   after=\blank,
   before=\blank]

\definelistplacement[MyListItem][none]#1#2#3%
  {\listparameter{before}
   \listparameter{style} (#1 - #2 - #3) 
   \listparameter{after}}



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] 5+ messages in thread

* Re: \placelist disturbs grid?
  2005-08-05  9:01     ` Hans Hagen
@ 2005-08-09 15:50       ` Vit Zyka
  0 siblings, 0 replies; 5+ messages in thread
From: Vit Zyka @ 2005-08-09 15:50 UTC (permalink / raw)


Hans Hagen wrote:
> Vit Zyka wrote:
> 
>> Hans Hagen wrote:
>>
>>> Vit Zyka wrote:
>>>
>>>> Hello Hans, Taco, and the next gurus,
>>>>
>>>> sorry for bother with another thing I can not understand. Very high 
>>>> glyphs like \v S disturb grid in the \placelist. The same glyph in 
>>>> the common paragraph with the same (intentionally) interline setting 
>>>> preserves grid:
>>>>
>>>> ---------------------------------------
>>>> \setupbodyfont[10pt,rm]
>>>> \setupinterlinespace[line=12pt]
>>>> \setuplayout[grid=yes,width=8cm]
>>>> \showgrid
>>>>
>>>> \writetolist[section]{}{See the next line:}
>>>> \writetolist[section]{}{\v Sejba}
>>>> \writetolist[section]{}{Another list line}
>>>>
>>>> \starttext
>>>> \v Sejba\par
>>>> Here grid is OK, but in \type{placelist}:
>>>>
>>>> \placelist[section]
>>>>
>>>> no!
>>>> \stoptext
>>>> ------------------------------------------
>>>> I was looking in definitions for some font-size dependent line 
>>>> setting, I also tried to
>>>> \setuplist[section]{style=\baselineskip=12pt\lineskiplimit=-10pt}
>>>> but without success to lounging on the grid.
>>>
>>>
>>> this is the default ratio:
>>>
>>> \setupinterlinespace
>>>  [height=.72,
>>>   depth=.28]
>>
>> Thank you Hans; after some experimenting I understood:
>> - height and depth in \setupinterlinespace are baseline-ratio/size of 
>> struts (add description to tex-show)
>> - some my chars (/,\v S, \tfa, ...) oversized \strut size of any ratio
>> - list items are typeset with struts (perhaps all alternative)
>> - only alternative without strut is 'none' with command=\Mycommand def
>>
>> So I do know how to preserve grid. But I do not know HOW TO TYPESET 
>> \Mycommand TO FIT THE PARAGRAPH WIDTH. It seem it is not in the 
>> restricted horizontal mode and continue on one long line. And another 
>> question/request: can the list distance param (alternative d,...) be 
>> glue instead of skip? For better line fitting.
>>
>> example:
>> ------------------
>> \setupbodyfont[10pt,rm]
>> \setupinterlinespace[line=12pt,height=.77,depth=.23]
>> \setuplayout[grid=yes,width=8cm]
>> \showgrid
>>
>> \setuplist[section]
>>   [style=\tfd,alternative=none,command=\MyListItem]
>> \def\MyListItem#1#2#3{{\tfb (#1-#2-#3) }}
>>
>> \starttext
>> \writetolist[section]{}{See the next line}
>> \writetolist[section]{}{\v Sejba}
>> \writetolist[section]{}{Another list line}
>> \writetolist[section]{}{And the last one}
>>
>> \lineskiplimit=-10pt
>> Line\par
>> Anothet line of \v Sejba\par
>>
>> \placelist[section]
>>
>> \strut  %% should be! why?
>> After list line.
>>
>> \stoptext
>> ------------------
>>
>> Vit

Hallo hans, thank you for your code. I find it in my mail box just today 
although it is 4 days old. So apologise me.

Unfortunately it seems to me it
A) does not work
    after successfull
       \definelistplacement[MyListItem][none]#1#2#3%
          {\listparameter{style} (#1 - #2 - #3) }
    \MyListItem is not defined.
B) does not solve the problem with a single long line list alternative.

But. Your example discovered me there are few more alternative in 
\setuplist (except a..f, none):

horizontal
vertical
command

So your example leads me to find the solution. I still do not know how 
to insert interaction to page number inside \MyListCommand. I have tried
\def\MyListCommand#1#2#3{%
   #1-#2-%
   \setbox0\hbox{#3}% \showcontrastlocation\??ia{??}{#3}}%
   \linklisttoelement{subsection}{??}{#3}{\box0}%
   )}
}
but I am puzzled by \linklisttoelement parameters.

Thnak ones more
Vit


Solution:
----------------------
\setupbodyfont[10pt,rm]
\setupinterlinespace[line=12pt,height=.77,depth=.23]
\setuplayout[grid=yes,width=8cm]
\showgrid

\setuplist[part]
 
[style=\bfb,alternative=command,command=\MyListCommand,before=\blank,after=\endgraf]
\setuplist[chapter]
 
[style=\bfb,alternative=command,command=\MyListCommand,before=\blank,after=\endgraf]
\setuplist[section]
   [style=\tfa,alternative=command,command=\MyListCommand]
\def\MyListCommand#1#2#3{%
   \listparameter{before}%
   {\listparameter{style}(#1-#2-#3)}\hskip1em plus.5em minus.5em
   \listparameter{after}%
}

\starttext
\writetolist[part]{1}{Part 1}
\writetolist[chapter]{1}{Chapter 1}
\writetolist[section]{1}{See the next line}
\writetolist[section]{2}{\v Sejba}
\writetolist[section]{3}{Another list line}
\expanded{\writetolist[section]{}{And the last line.}}
\writetolist[chapter]{2}{Chapter 2}
\writetolist[section]{1}{Section 1}

\lineskiplimit=-\maxdimen
Line\par
Another line of \v Sejba\par

\placecontent

\strut
After list.

\stoptext
-------------------------------

> 
> 
> \setuplist
>  [section]
>  [style=\tfd,
>   alternative=none,
>   after=\blank,
>   before=\blank,
>   command=\MyListItem]
> 
> \setuplist
>  [section]
>  [style=\tfd,
>   alternative=command
>   command=\MyListItem]
> 
> in core-lst you can see how the alternatives are defined
> ok, let's give you a bonus (goes in cont-new):
> \unprotect
> \def\definelistplacement
>  {\dodoubleempty\dodefinelistplacement}
> 
> \def\dodefinelistplacement[#1][#2]%
>  {\setvalue{\@@dodolistelement#1}%
>     {\doifelsenothing{#2}
>        {\getvalue{\@@dodolistelement\v!command}}%
>        {\executeifdefined{\@@dodolistelement#2}
>           {\getvalue{\@@dodolistelement\v!command}}}%
>     \setvalue{\??li\currentlist\c!command}%
>       {\getvalue{\@@dodolistelement::#1}}}%
>   \setvalue{\@@dodolistelement::#1}}
> 
> \definelistplacement[MyListItem][none]#1#2#3%
>  {\listparameter{style} (#1 - #2 - #3) }
> 
> \protect
> now you can say:
> \definelistplacement[MyListItem][none]#1#2#3%
>  {\listparameter{style} (#1 - #2 - #3) }
> 
> \setuplist
>  [section]
>  [style=\tfd,
>   alternative=MyListItem,
>   after=\blank,
>   before=\blank]
> 
> (btw, watch how one can ask for listparameters) 
> \definelistplacement[MyListItem][none]#1#2#3%
>  {\listparameter{style} (#1 - #2 - #3) }
> 
> \setuplist
>  [section]
>  [style=\tfd,
>   alternative=MyListItem,
>   after=\blank,
>   before=\blank]
> 
> \definelistplacement[MyListItem][none]#1#2#3%
>  {\listparameter{before}
>   \listparameter{style} (#1 - #2 - #3)   \listparameter{after}}
> 
> 
> 
> 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
> -----------------------------------------------------------------
> 
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
> 

-- 
=======================================================
Ing. Vít Zýka, Ph.D.                         TYPOkvítek

database publishing              databazove publikovani
data maintaining and typesetting in typographic quality
priprava dat a jejich sazba v typograficke kvalite

tel.: (+420) 777 198 189     www: http://typokvitek.com
=======================================================

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

end of thread, other threads:[~2005-08-09 15:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-03 21:30 \placelist disturbs grid? Vit Zyka
2005-08-03 22:16 ` Hans Hagen
2005-08-04 22:30   ` Vit Zyka
2005-08-05  9:01     ` Hans Hagen
2005-08-09 15:50       ` Vit Zyka

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