ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Grid-keeping list (again)
@ 2007-04-12  9:21 Johannes Kuester
  2007-04-12 10:10 ` luigi scarso
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Johannes Kuester @ 2007-04-12  9:21 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 1479 bytes --]

Hello,

I'm still trying to typeset a "grid-keeping" list (or table).
Wolfgang Schuster supplied me off-list with the attached module.
This works fine except for one problem:

Only the first few lines are placed on the grid, then the grid is lost.

After the next pass (i.e. after the next "texmfstart texexec testfile"),
some more lines are placed on the grid.
(So I need many passes to typeset the complete list correctly).

Why? Any idea?

(I fiddled around with \synchronizegrid, \placeongrid, \moveongrid, and
\startlinecorrection \stoplinecorrection, but none of these seems to work.)

You could try the effect with the following example:

%%%%%%%%%%

\setuplayout[grid=yes, columns=2]
\showgrid
%\showstruts

\usemodule[gridlist]

\starttext

\startcolumns[n=2, balance=no]
%% (columns are not necessary to show the effect)

\dorecurse{20}{
  \zeichen{0001}{a}{first letter}{}%
  \zeichen{0002}{b}{second letter}{}%
  \zeichen{0002}{c}{third letter, this one has a longer entry
                    which needs more than one line}{}%
}

\stopcolumns

\stoptext

%%%%%%%%%%


(This should result in an annotated list of mathematical symbols,
showing the Unicode number, the math symbol, and some explanation (and
where the explanation could need more than one line); quite similar to
the list I published in "Detailtypografie" (2nd ed. 2004), but for
another -- quite pressing -- project.)


Johannes

-- 
Johannes Kuester
typoma

mailto:jk@typoma.com
http://www.typoma.com

[-- Attachment #2: t-gridlist.tex --]
[-- Type: text/x-tex, Size: 2271 bytes --]

\startmodule[gridlist]

\unprotect

\def\????ze{@@@@ze} % ZEichen

\newcount\zeichencolumn

\def\setupzeichen
  {\dodoubleempty\dosetupzeichen}

\def\dosetupzeichen[#1][#2]%
  {\ifsecondargument
     \dodosetupzeichen[#1][#2]
   \else
     \dodosetupzeichen[\v!line][#1]
   \fi}

\def\dodosetupzeichen[#1][#2]%
  {\def\docommand##1%
    {\getparameters[\????ze##1][#2]}
   \processcommalist[#1]\docommand}

\def\zeichenparameter#1%
  {\csname
     \ifcsname\????ze\number\zeichencolumn#1\endcsname
       \????ze\number\zeichencolumn
     \else
       \????ze\v!line
     \fi
   #1\endcsname}

\definehspace[myindent][10pt]

\def\startunisym%
  {\bgroup%
   \setbox\scratchbox\hbox\bgroup}

\def\stopunisym%
  {\egroup%
   \raise.3ex\hbox{\box\scratchbox}
   \egroup}

\def\zeichen%
  {\ignorespaces\permitspacesbetweengroups
   \doquadruplegroupempty\dozeichen}

\def\dozeichen#1#2#3#4%
  {\begingroup
   \zeichenparameter\c!before
   \zeichencolumn\zerocount
   \hbox\!!to\zeichenparameter\c!textwidth
     {\zeichenzelle{#1}%
      \zeichenzelle{#2}%
      \hfill
      \zeichenzelle{#3}}%
   \zeichenparameter\c!after
   \endgroup}


\def\zeichenzelle#1%
  {\advance\zeichencolumn\plusone
   \hbox
     {\vtop
        {\hsize\zeichenparameter\c!width
         \zeichenparameter\c!before
         \begstrut
           \dostartattributes{\????ze\number\zeichencolumn}\c!style\c!color
           \zeichenparameter\c!left
             #1
           \zeichenparameter\c!right
           \dostopattributes
         \endstrut
         \zeichenparameter\c!after}}}

\setupzeichen
  [\c!textwidth=63.8833mm,%
   \c!before=\noindenting\synchronizegrid,%
   \c!after=\synchronizegrid,%
  ]

\setupzeichen
  [1,2,3,4]
  [\c!before=,
   \c!after=,
   \c!left=,
   \c!right=]

\setupzeichen
  [1]
  [\c!width=6.5mm,
   \c!left=\startunisym,
   \c!right=\stopunisym,
   \c!align=right,
   \c!before=\raggedright,
   \c!after=,   
   \c!style={\switchtobodyfont[6.8pt]\tt\bf}]

\setupzeichen
  [2]
  [\c!width=7.5mm,
   \c!left=$,
   \c!right=$,
   \c!before=\raggedcenter,
   \c!style={\switchtobodyfont[9.6pt]}]

\setupzeichen
  [3]
  [\c!width=49.883mm,
   \c!style={\switchtobodyfont[8.4pt]},
   \c!before=\hangindent10pt\hangafter1\raggedright]

\protect 
\stopmodule
\endinput

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

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

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

* Re: Grid-keeping list (again)
  2007-04-12  9:21 Grid-keeping list (again) Johannes Kuester
@ 2007-04-12 10:10 ` luigi scarso
  2007-04-12 11:53   ` Johannes Kuester
  2007-04-12 11:46 ` Wolfgang Schuster
  2007-04-12 22:06 ` luigi scarso
  2 siblings, 1 reply; 14+ messages in thread
From: luigi scarso @ 2007-04-12 10:10 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 4/12/07, Johannes Kuester <jk@typoma.com> wrote:
> Hello,
>
> I'm still trying to typeset a "grid-keeping" list (or table).
Sorry, no answer.
Only to say that I'm following this subject, and I'm doing some private tests.

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

* Re: Grid-keeping list (again)
  2007-04-12  9:21 Grid-keeping list (again) Johannes Kuester
  2007-04-12 10:10 ` luigi scarso
@ 2007-04-12 11:46 ` Wolfgang Schuster
  2007-04-12 12:44   ` Johannes Kuester
  2007-04-12 22:06 ` luigi scarso
  2 siblings, 1 reply; 14+ messages in thread
From: Wolfgang Schuster @ 2007-04-12 11:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2309 bytes --]

2007/4/12, Johannes Kuester <jk@typoma.com>:
>
> Hello,
>
> I'm still trying to typeset a "grid-keeping" list (or table).
> Wolfgang Schuster supplied me off-list with the attached module.
> This works fine except for one problem:
>
> Only the first few lines are placed on the grid, then the grid is lost.
>
> After the next pass (i.e. after the next "texmfstart texexec testfile"),
> some more lines are placed on the grid.
> (So I need many passes to typeset the complete list correctly).
>
> Why? Any idea?
>
> (I fiddled around with \synchronizegrid, \placeongrid, \moveongrid, and
> \startlinecorrection \stoplinecorrection, but none of these seems to
> work.)
>
> You could try the effect with the following example:
>
> %%%%%%%%%%
>
> \setuplayout[grid=yes, columns=2]
> \showgrid
> %\showstruts
>
> \usemodule[gridlist]
>
> \starttext
>
> \startcolumns[n=2, balance=no]
> %% (columns are not necessary to show the effect)
>
> \dorecurse{20}{
>   \zeichen{0001}{a}{first letter}{}%
>   \zeichen{0002}{b}{second letter}{}%
>   \zeichen{0002}{c}{third letter, this one has a longer entry
>                     which needs more than one line}{}%
> }
>
> \stopcolumns
>
> \stoptext


Hi Johannes,

replace the current definition of \zeichenzelle with the following:

\def\zeichenzelle#1%
  {\advance\zeichencolumn\plusone
   \hbox
     {\vtop
        {\hsize\zeichenparameter\c!width
         \normalbaselines
         \zeichenparameter\c!before
         \begstrut
           \dostartattributes{\????ze\number\zeichencolumn}\c!style\c!color
           \zeichenparameter\c!left
             #1
           \zeichenparameter\c!right
           \dostopattributes
         \endstrut
         \zeichenparameter\c!after}}}

\synchronizegrid in \setupzeichen is not neccessary

\setupzeichen
  [\c!textwidth=63.8833mm,
   \c!before=\noindenting, %\synchronizegrid,
   \c!after=, %\synchronizegrid
  ]

add the next two commands to your module

\def\startzeichen{\begingroup\offinterlineskip}
\def\stopzeichen{\endgroup}

a alternative version

%\def\startzeichen{\offinterlineskip}
%\def\stopzeichen{\oninterlineskip}

and put \startzeichen and \stopzeichen before and after your lines
with all \zeichen commands

\startzeichen
\zeichen
...
\zeichen
\stopzeichen

and everything should work as expected

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 3486 bytes --]

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

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

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

* Re: Grid-keeping list (again)
  2007-04-12 10:10 ` luigi scarso
@ 2007-04-12 11:53   ` Johannes Kuester
  2007-04-12 12:25     ` Hans Hagen
  0 siblings, 1 reply; 14+ messages in thread
From: Johannes Kuester @ 2007-04-12 11:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users

luigi scarso wrote:
> On 4/12/07, Johannes Kuester <jk@typoma.com> wrote:
>> Hello,
>>
>> I'm still trying to typeset a "grid-keeping" list (or table).
> Sorry, no answer.
> Only to say that I'm following this subject, and I'm doing some private tests.

Thank you! I hope you will be more successful than I am.

I do not understand why this is such a problem. Basically, it's just
about "paragraph boxes" and their proper alignment on a grid.

To me, such a list seems like a basic typographic requirement, so it
should be possible to do that in ConTeXt.


Johannes

-- 
Johannes Kuester
typoma

mailto:jk@typoma.com
http://www.typoma.com

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

* Re: Grid-keeping list (again)
  2007-04-12 11:53   ` Johannes Kuester
@ 2007-04-12 12:25     ` Hans Hagen
  2007-04-12 12:50       ` luigi scarso
  0 siblings, 1 reply; 14+ messages in thread
From: Hans Hagen @ 2007-04-12 12:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Johannes Kuester wrote:
> luigi scarso wrote:
>   
>> On 4/12/07, Johannes Kuester <jk@typoma.com> wrote:
>>     
>>> Hello,
>>>
>>> I'm still trying to typeset a "grid-keeping" list (or table).
>>>       
>> Sorry, no answer.
>> Only to say that I'm following this subject, and I'm doing some private tests.
>>     
>
> Thank you! I hope you will be more successful than I am.
>
> I do not understand why this is such a problem. Basically, it's just
> about "paragraph boxes" and their proper alignment on a grid.
>
> To me, such a list seems like a basic typographic requirement, so it
> should be possible to do that in ConTeXt.
>   
the problem with tex is that it does not hav ea way to force consistent height and depth of lines, so here are a few tricks: 
 
\begstrut some text \endstrut \endgraf 

\snaptogrid\vbox{some text} 


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

* Re: Grid-keeping list (again)
  2007-04-12 11:46 ` Wolfgang Schuster
@ 2007-04-12 12:44   ` Johannes Kuester
  0 siblings, 0 replies; 14+ messages in thread
From: Johannes Kuester @ 2007-04-12 12:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Wolfgang,

perfect, now everything works as expected!
Thank you!

Johannes

Wolfgang Schuster wrote:
> Hi Johannes,
> 
> replace the current definition of \zeichenzelle with the following:
> 
> \def\zeichenzelle#1%
>   {\advance\zeichencolumn\plusone
>    \hbox
>      {\vtop
>         {\hsize\zeichenparameter\c!width
>          \normalbaselines
>          \zeichenparameter\c!before
>          \begstrut
>            \dostartattributes{\????ze\number\zeichencolumn}\c!style\c!color
>            \zeichenparameter\c!left
>              #1
>            \zeichenparameter\c!right
>            \dostopattributes
>          \endstrut
>          \zeichenparameter\c!after}}}
> 
> \synchronizegrid in \setupzeichen is not neccessary
> 
> \setupzeichen
>   [\c!textwidth=63.8833mm,
>    \c!before=\noindenting, %\synchronizegrid,
>    \c!after=, %\synchronizegrid
>   ]
> 
> add the next two commands to your module
> 
> \def\startzeichen{\begingroup\offinterlineskip}
> \def\stopzeichen{\endgroup}
> 
> a alternative version
> 
> %\def\startzeichen{\offinterlineskip}
> %\def\stopzeichen{\oninterlineskip}
> 
> and put \startzeichen and \stopzeichen before and after your lines
> with all \zeichen commands
> 
> \startzeichen
> \zeichen
> ...
> \zeichen
> \stopzeichen
> 
> and everything should work as expected
> 
> Wolfgang

-- 
Johannes Kuester
typoma

mailto:jk@typoma.com
http://www.typoma.com

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

* Re: Grid-keeping list (again)
  2007-04-12 12:25     ` Hans Hagen
@ 2007-04-12 12:50       ` luigi scarso
  0 siblings, 0 replies; 14+ messages in thread
From: luigi scarso @ 2007-04-12 12:50 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> the problem with tex is that it does not hav ea way to force consistent height and depth of lines.
yes, it'true.
And this is why I'm so involved.
luigi

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

* Re: Grid-keeping list (again)
  2007-04-12  9:21 Grid-keeping list (again) Johannes Kuester
  2007-04-12 10:10 ` luigi scarso
  2007-04-12 11:46 ` Wolfgang Schuster
@ 2007-04-12 22:06 ` luigi scarso
  2007-04-13  9:13   ` Johannes Kuester
  2 siblings, 1 reply; 14+ messages in thread
From: luigi scarso @ 2007-04-12 22:06 UTC (permalink / raw)
  To: mailing list for ConTeXt users

hmm maibe i have not understand, but
> \startcolumns[n=2, balance=no]
> %% (columns are not necessary to show the effect)
>
> \dorecurse{20}{
>   \zeichen{0001}{a}{first letter}{}%

>   \zeichen{0002}{b}{second letter}{}%
\zeichen{0002}{b}{second letter \vrule width 0.1pt height 1em depth2em }{}%
%% or this
%%  \zeichen{0002}{b}{second letter \blank Mlg() }{}%

>
> \stopcolumns
> the list I published in "Detailtypografie" (2nd ed. 2004), but for

breaks the rule.

Or not ?

luigi

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

* Re: Grid-keeping list (again)
  2007-04-12 22:06 ` luigi scarso
@ 2007-04-13  9:13   ` Johannes Kuester
  2007-04-13  9:33     ` luigi scarso
  2007-04-13 11:25     ` Hans Hagen
  0 siblings, 2 replies; 14+ messages in thread
From: Johannes Kuester @ 2007-04-13  9:13 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear Luigi,

luigi scarso wrote:
> hmm maibe i have not understand, but
>
> \zeichen{0002}{b}{second letter \vrule width 0.1pt height 1em depth2em }{}%
> %% or this
> %%  \zeichen{0002}{b}{second letter \blank Mlg() }{}%
> 
> breaks the rule.
> 
> Or not ?

Yes, it does, definitely. So it's my (or any other user's)
responsibility that the cells contain only "allowed" stuff.

I still have to see how to deal with large symbols (bigops and
integrals). Maybe with "\blank[medium]" in between (and some "\smash"),
so that every second line will be on the grid again.

When I typeset a similar list previously (for Detailtypografie), I still
did that in LaTeX. That required a lot of trickery and manual
correction, but at least I was able to do it (and yes, it was arranged
on a grid, but LaTeX didn't know that).

That is currently my main conceptual problem with ConTeXt: sometimes
it's too high-level and too clever, and it's hard to figure out how to
do the trickery and the tweaking ...


Johannes


-- 
Johannes Kuester
typoma

mailto:jk@typoma.com
http://www.typoma.com

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

* Re: Grid-keeping list (again)
  2007-04-13  9:13   ` Johannes Kuester
@ 2007-04-13  9:33     ` luigi scarso
  2007-04-13 10:04       ` luigi scarso
  2007-04-13 14:12       ` Johannes Kuester
  2007-04-13 11:25     ` Hans Hagen
  1 sibling, 2 replies; 14+ messages in thread
From: luigi scarso @ 2007-04-13  9:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> I still have to see how to deal with large symbols (bigops and
> integrals). Maybe with "\blank[medium]" in between (and some "\smash"),
> so that every second line will be on the grid again.
Maybe a strategy is to use a vbox with ht+dp multiple of a grid space
...but the first line of every page has another height....
I have posted something with bTABLE last days under this topic

> That is currently my main conceptual problem with ConTeXt: sometimes
> it's too high-level and too clever, and it's hard to figure out how to
> do the trickery and the tweaking ...
There are many pdf about context;
I try to have a 'programmer view' of these things.
Among others, see and criticize
http://wiki.contextgarden.net/User:Luigi.scarso/modules.pdf#modules.pdf


luigi

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

* Re: Grid-keeping list (again)
  2007-04-13  9:33     ` luigi scarso
@ 2007-04-13 10:04       ` luigi scarso
  2007-04-13 14:12       ` Johannes Kuester
  1 sibling, 0 replies; 14+ messages in thread
From: luigi scarso @ 2007-04-13 10:04 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> Among others, see and criticize
> http://wiki.contextgarden.net/User:Luigi.scarso/modules.pdf#modules.pdf
Of course, the main starting point is
http://wiki.contextgarden.net
exp.Search wiki

luigi

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

* Re: Grid-keeping list (again)
  2007-04-13  9:13   ` Johannes Kuester
  2007-04-13  9:33     ` luigi scarso
@ 2007-04-13 11:25     ` Hans Hagen
  2007-04-13 14:04       ` Johannes Kuester
  1 sibling, 1 reply; 14+ messages in thread
From: Hans Hagen @ 2007-04-13 11:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Johannes Kuester wrote:
> Dear Luigi,
>
> luigi scarso wrote:
>   
>> hmm maibe i have not understand, but
>>
>> \zeichen{0002}{b}{second letter \vrule width 0.1pt height 1em depth2em }{}%
>> %% or this
>> %%  \zeichen{0002}{b}{second letter \blank Mlg() }{}%
>>
>> breaks the rule.
>>
>> Or not ?
>>     
>
> Yes, it does, definitely. So it's my (or any other user's)
> responsibility that the cells contain only "allowed" stuff.
>
> I still have to see how to deal with large symbols (bigops and
> integrals). Maybe with "\blank[medium]" in between (and some "\smash"),
> so that every second line will be on the grid again.
>
> When I typeset a similar list previously (for Detailtypografie), I still
> did that in LaTeX. That required a lot of trickery and manual
> correction, but at least I was able to do it (and yes, it was arranged
> on a grid, but LaTeX didn't know that).
>
> That is currently my main conceptual problem with ConTeXt: sometimes
> it's too high-level and too clever, and it's hard to figure out how to
> do the trickery and the tweaking ...
>
>   
there is some some gridmath support available; see details.pdf

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

* Re: Grid-keeping list (again)
  2007-04-13 11:25     ` Hans Hagen
@ 2007-04-13 14:04       ` Johannes Kuester
  0 siblings, 0 replies; 14+ messages in thread
From: Johannes Kuester @ 2007-04-13 14:04 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hans Hagen wrote:
> there is some some gridmath support available; see details.pdf
> 
> Hans

Yes, I know, I use that already.
Very helpful for my display formulas.
I didn't try it yet on my symbols list, here the module from Wolfgang
and blanks will do, I think.

Johannes

-- 
Johannes Kuester
typoma

mailto:jk@typoma.com
http://www.typoma.com

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

* Re: Grid-keeping list (again)
  2007-04-13  9:33     ` luigi scarso
  2007-04-13 10:04       ` luigi scarso
@ 2007-04-13 14:12       ` Johannes Kuester
  1 sibling, 0 replies; 14+ messages in thread
From: Johannes Kuester @ 2007-04-13 14:12 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> Maybe a strategy is to use a vbox with ht+dp multiple of a grid space
> ...but the first line of every page has another height....

Each first line will be some heading, so that's not a problem in my case.

My grid-keeping list problem is solved, the module by Wolfgang serves my
purpose very well.

> There are many pdf about context;
> I try to have a 'programmer view' of these things.
> Among others, see and criticize
> http://wiki.contextgarden.net/User:Luigi.scarso/modules.pdf#modules.pdf

Nice and interesting (although I didn't had enough time to look at it
thoroughly).

I'm aware of all the pdf manuals, and I use the wiki, source browser,
mailing list + archive.

Still it's sometimes hard to find one's way through.
But on to my next problems ...


Johannes


-- 
Johannes Kuester
typoma

mailto:jk@typoma.com
http://www.typoma.com

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

end of thread, other threads:[~2007-04-13 14:12 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-12  9:21 Grid-keeping list (again) Johannes Kuester
2007-04-12 10:10 ` luigi scarso
2007-04-12 11:53   ` Johannes Kuester
2007-04-12 12:25     ` Hans Hagen
2007-04-12 12:50       ` luigi scarso
2007-04-12 11:46 ` Wolfgang Schuster
2007-04-12 12:44   ` Johannes Kuester
2007-04-12 22:06 ` luigi scarso
2007-04-13  9:13   ` Johannes Kuester
2007-04-13  9:33     ` luigi scarso
2007-04-13 10:04       ` luigi scarso
2007-04-13 14:12       ` Johannes Kuester
2007-04-13 11:25     ` Hans Hagen
2007-04-13 14:04       ` Johannes Kuester

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