ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Help with \setuplayout[grid=yes]
@ 2005-08-30 22:44 Randall Skelton
  2005-08-31  7:55 ` Vit Zyka
  0 siblings, 1 reply; 8+ messages in thread
From: Randall Skelton @ 2005-08-30 22:44 UTC (permalink / raw)



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

Hi all,

Attached is an example showing my misunderstanding about grid alignment. The 
attached works as expected when \setuplayout[grid=no] is used or the 'Author 
table' is commented out. The inclusion of the little table in the text is 
really just to convince myself that I can have a table with the grid 
enabled.

Any and all suggestions are greatly appreciated.

Cheers,
Randall

----
\showframe
%\showmakeup
%\showgrid

%%% Dimensions
\newdimen\PaperWidth \PaperWidth=8.5in
\newdimen\PaperHeight \PaperHeight=11.0in
\newdimen\TextWidth \TextWidth=5.5in
\newdimen\TextHeight \TextHeight=10.0in

\setuppapersize[letter][letter] % paper size
\definepapersize[width=\PaperWidth,height=\PaperHeight]

\setuplayout
[location=doublesided, % double-sided printing
grid=yes, %%%% WHY DOES THIS CAUSE AN ERROR?
topspace=0.50in, % the space at the very top of the page
backspace=1.5in, % the space in the gutter 
header=0.75in, % the space for headers
footer=0.50in, % the space for footers
leftmargin=1in, % the space for margin notes
rightmargin=1in, % the space for right margin notes
width=\TextWidth, % the width of the body text
height=\TextHeight] % the height of the body text

%%% Authors and Approvals
\def\AuthorsTitle{\midaligned{\sc{Authors and Approvals}}}

\def\startAuthors{%
\blank[2*big]\AuthorsTitle\\\blank[2*big]%
\hbox to \hsize\bgroup\hss\SetTableToWidth{6.5in}%
\starttable[|c|c|c|c|c|]
\HL
\VL \VL Function\VL Name\VL Signature\VL Date\VL\SR\HL}

\def\stopAuthors{\stoptable\hss\egroup}

def\Author[#1]{%
\getgparameters[Author][#1]%
\doifundefined{AuthorRole}{\gdef\AuthorRole{Prepared by:}}%
\doifundefined{AuthorFunction}{\gdef\AuthorFunction{-}}%
\doifundefined{AuthorName}{\gdef\AuthorName{-}}%
\doifundefined{AuthorSignature}{\gdef\AuthorSignature{}}%
\doifundefined{AuthorDate}{\gdef\AuthorDate{-}}%
\VL\AuthorRole \VL\AuthorFunction%
\VL\AuthorName \VL\AuthorSignature%
\VL\AuthorDate%
\VL\SR\HL%
\gdef\AuthorFunction{ }\gdef\AuthorName{ }%
\gdef\AuthorSignature{ }\gdef\AuthorDate{ }%
}

\starttext

%%% Start: Front 
\startfrontmatter

\startAuthors
\Author
[Role={Prepared by:},
Function={Scientist},
Name={John Smith},
Date={2005-08-24}]
\Author
[Role={Checked by}:,
Date={2005-08-24}]
\Author
[Role={Approved by:},
Date={2005-08-24}]
\stopAuthors

%%% Stop: Front
\stopfrontmatter

%%% Start: Body 
\startbodymatter

\section{One}

\dorecurse{3}{\input knuth}

\starttable[|c|c|]
\HL
\VL One \VL Two \VL\FR
\VL Three \VL Four \VL\LR
\HL
\stoptable

\section{Two}

\dorecurse{4}{\input knuth}

%%% Stop: Body part
\stopbodymatter

\stoptext

[-- Attachment #1.2: Type: text/html, Size: 4144 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] 8+ messages in thread

* Re: Help with \setuplayout[grid=yes]
  2005-08-30 22:44 Help with \setuplayout[grid=yes] Randall Skelton
@ 2005-08-31  7:55 ` Vit Zyka
  2005-08-31 13:19   ` Randall Skelton
  0 siblings, 1 reply; 8+ messages in thread
From: Vit Zyka @ 2005-08-31  7:55 UTC (permalink / raw)


Randall Skelton wrote:
> Hi all,
> 
> Attached is an example showing my misunderstanding about grid 
> alignment.  The attached works as expected when \setuplayout[grid=no] is 
> used or the 'Author table' is commented out.   The inclusion of the 
> little table in the text is really just to convince myself that I can 
> have a table with the grid enabled.

\placeongrid{%    or e.g. \placeongrid[{broad,high}]{%
   your table
}

vit

> 
> Any and all suggestions are greatly appreciated.
> 
> Cheers,
> Randall
> 
> ----
> \showframe
> %\showmakeup
> %\showgrid
> 
> %%% Dimensions
> \newdimen\PaperWidth  \PaperWidth=8.5in
> \newdimen\PaperHeight \PaperHeight=11.0in
> \newdimen\TextWidth   \TextWidth=5.5in
> \newdimen\TextHeight  \TextHeight=10.0in
> 
> \setuppapersize[letter][letter]                  % paper size
> \definepapersize[width=\PaperWidth,height=\PaperHeight]
> 
> \setuplayout
>     [location=doublesided, % double-sided printing
>      grid=yes,             %%%% WHY DOES THIS CAUSE AN ERROR?
>      topspace=0.50in,      % the space at the very top of the page
>      backspace=1.5in,      % the space in the gutter
>      header=0.75in,        % the space for headers
>      footer=0.50in,        % the space for footers
>      leftmargin=1in,       % the space for margin notes
>      rightmargin=1in,      % the space for right margin notes
>      width=\TextWidth,     % the width of the body text
>      height=\TextHeight]   % the height of the body text
> 
> %%% Authors and Approvals
> \def\AuthorsTitle{\midaligned{\sc{Authors and Approvals}}}
> 
> \def\startAuthors{%
>   \blank[2*big]\AuthorsTitle\\\blank[2*big]%
>   \hbox to \hsize\bgroup\hss\SetTableToWidth{6.5in}%
>   \starttable[|c|c|c|c|c|]
>   \HL
>   \VL \VL Function\VL Name\VL Signature\VL Date\VL\SR\HL}
> 
> \def\stopAuthors{\stoptable\hss\egroup}
> 
> def\Author[#1]{%
>   \getgparameters[Author][#1]%
>   \doifundefined{AuthorRole}{\gdef\AuthorRole{Prepared by:}}%
>   \doifundefined{AuthorFunction}{\gdef\AuthorFunction{-}}%
>   \doifundefined{AuthorName}{\gdef\AuthorName{-}}%
>   \doifundefined{AuthorSignature}{\gdef\AuthorSignature{}}%
>   \doifundefined{AuthorDate}{\gdef\AuthorDate{-}}%
>   \VL\AuthorRole \VL\AuthorFunction%
>   \VL\AuthorName \VL\AuthorSignature%
>   \VL\AuthorDate%
>   \VL\SR\HL%
>   \gdef\AuthorFunction{ }\gdef\AuthorName{ }%
>   \gdef\AuthorSignature{ }\gdef\AuthorDate{ }%
>   }
> 
> \starttext
> 
> %%% Start: Front
> \startfrontmatter
> 
> \startAuthors
>   \Author
>     [Role={Prepared by:},
>      Function={Scientist},
>      Name={John Smith},
>      Date={2005-08-24}]
>   \Author
>     [Role={Checked by}:,
>      Date={2005-08-24}]
>   \Author
>     [Role={Approved by:},
>      Date={2005-08-24}]
> \stopAuthors
> 
> %%% Stop: Front
> \stopfrontmatter
> 
> %%% Start: Body
> \startbodymatter
> 
> \section{One}
> 
> \dorecurse{3}{\input knuth}
> 
> \starttable[|c|c|]
> \HL
> \VL One \VL Two \VL\FR
> \VL Three \VL Four \VL\LR
> \HL
> \stoptable
> 
> \section{Two}
> 
> \dorecurse{4}{\input knuth}
> 
> %%% Stop: Body part
> \stopbodymatter
> 
> \stoptext
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> 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] 8+ messages in thread

* Re: Help with \setuplayout[grid=yes]
  2005-08-31  7:55 ` Vit Zyka
@ 2005-08-31 13:19   ` Randall Skelton
  2005-08-31 13:31     ` Taco Hoekwater
  2005-08-31 13:42     ` Vit Zyka
  0 siblings, 2 replies; 8+ messages in thread
From: Randall Skelton @ 2005-08-31 13:19 UTC (permalink / raw)



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

Many thanks for the suggestion Vit. In this case, however, I've split the 
\starttable and \stoptable commands in the \startAuthors and \stopAuthors 
definitions which may well be the root of my problem. This means that I 
cannot easily wrap the whole table with \placeongrid{ }. I cannot see a way 
of getting the \domoveongrid and/or \snaptogrid\vbox to work either.

Does anyone have any suggestions on how I can clean this up so that 
\starttable and \stoptable are not in separate definitions but I can still 
use variables to define the table elements as is done in the \Authors 
definition?

Cheers,
Randall

> \placeongrid{% or e.g. \placeongrid[{broad,high}]{%
> your table
> }
> > %%% Authors and Approvals
> > \def\AuthorsTitle{\midaligned{\sc{Authors and Approvals}}}
> >
> > \def\startAuthors{%
> > \blank[2*big]\AuthorsTitle\\\blank[2*big]%
> > \hbox to \hsize\bgroup\hss\SetTableToWidth{6.5in}%
> > \starttable[|c|c|c|c|c|]
> > \HL
> > \VL \VL Function\VL Name\VL Signature\VL Date\VL\SR\HL}
> >
> > \def\stopAuthors{\stoptable\hss\egroup}
> >
> > def\Author[#1]{%
> > \getgparameters[Author][#1]%
> > \doifundefined{AuthorRole}{\gdef\AuthorRole{Prepared by:}}%
> > \doifundefined{AuthorFunction}{\gdef\AuthorFunction{-}}%
> > \doifundefined{AuthorName}{\gdef\AuthorName{-}}%
> > \doifundefined{AuthorSignature}{\gdef\AuthorSignature{}}%
> > \doifundefined{AuthorDate}{\gdef\AuthorDate{-}}%
> > \VL\AuthorRole \VL\AuthorFunction%
> > \VL\AuthorName \VL\AuthorSignature%
> > \VL\AuthorDate%
> > \VL\SR\HL%
> > \gdef\AuthorFunction{ }\gdef\AuthorName{ }%
> > \gdef\AuthorSignature{ }\gdef\AuthorDate{ }%
> > }
>

[-- Attachment #1.2: Type: text/html, Size: 2207 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] 8+ messages in thread

* Re: Help with \setuplayout[grid=yes]
  2005-08-31 13:19   ` Randall Skelton
@ 2005-08-31 13:31     ` Taco Hoekwater
  2005-08-31 13:42     ` Vit Zyka
  1 sibling, 0 replies; 8+ messages in thread
From: Taco Hoekwater @ 2005-08-31 13:31 UTC (permalink / raw)



This should do the trick:

  \def\startAuthors{%
     \placeongrid\bgroup
      ...<>...
   }

  \def\stopAuthors{%
     ...<>...
     \egroup
   }


Taco

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

* Re: Help with \setuplayout[grid=yes]
  2005-08-31 13:19   ` Randall Skelton
  2005-08-31 13:31     ` Taco Hoekwater
@ 2005-08-31 13:42     ` Vit Zyka
  2005-08-31 15:06       ` Randall Skelton
  1 sibling, 1 reply; 8+ messages in thread
From: Vit Zyka @ 2005-08-31 13:42 UTC (permalink / raw)


Randall Skelton wrote:
> Many thanks for the suggestion Vit.  In this case, however, I've split 
> the \starttable and \stoptable commands in the \startAuthors and 
> \stopAuthors definitions which may well be the root of my problem.  This 
> means that I cannot easily wrap the whole table with \placeongrid{ }.  I 
> cannot see a way of getting the \domoveongrid and/or \snaptogrid\vbox to 
> work either.

OK, in this case use in \startAuthor

   \placeongrid[...]\bgroup

and in \stopAuthor

   \egroup

cheers
vit


> 
> Does anyone have any suggestions on how I can clean this up so that 
> \starttable and \stoptable are not in separate definitions but I can 
> still use variables to define the table elements as is done in the 
> \Authors definition?
> 
> Cheers,
> Randall
>  
> 
>     \placeongrid{%    or e.g. \placeongrid[{broad,high}]{%
>        your table
>     }
>      > %%% Authors and Approvals
>      > \def\AuthorsTitle{\midaligned{\sc{Authors and Approvals}}}
>      >
>      > \def\startAuthors{%
>      >   \blank[2*big]\AuthorsTitle\\\blank[2*big]%
>      >   \hbox to \hsize\bgroup\hss\SetTableToWidth{ 6.5in}%
>      >   \starttable[|c|c|c|c|c|]
>      >   \HL
>      >   \VL \VL Function\VL Name\VL Signature\VL Date\VL\SR\HL}
>      >
>      > \def\stopAuthors{\stoptable\hss\egroup}
>      >
>      > def\Author[#1]{%
>      >   \getgparameters[Author][#1]%
>      >   \doifundefined{AuthorRole}{\gdef\AuthorRole{Prepared by:}}%
>      >   \doifundefined{AuthorFunction}{\gdef\AuthorFunction{-}}%
>      >   \doifundefined{AuthorName}{\gdef\AuthorName{-}}%
>      >   \doifundefined{AuthorSignature}{\gdef\AuthorSignature{}}%
>      >   \doifundefined{AuthorDate}{\gdef\AuthorDate{-}}%
>      >   \VL\AuthorRole \VL\AuthorFunction%
>      >   \VL\AuthorName \VL\AuthorSignature%
>      >   \VL\AuthorDate%
>      >   \VL\SR\HL%
>      >   \gdef\AuthorFunction{ }\gdef\AuthorName{ }%
>      >   \gdef\AuthorSignature{ }\gdef\AuthorDate{ }%
>      >   }
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> 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] 8+ messages in thread

* Re: Help with \setuplayout[grid=yes]
  2005-08-31 13:42     ` Vit Zyka
@ 2005-08-31 15:06       ` Randall Skelton
  2005-08-31 15:28         ` Randall Skelton
  0 siblings, 1 reply; 8+ messages in thread
From: Randall Skelton @ 2005-08-31 15:06 UTC (permalink / raw)



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

Absolutely fantastic. Thanks both Taco and Vit for this!

[-- Attachment #1.2: Type: text/html, Size: 68 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] 8+ messages in thread

* Re: Help with \setuplayout[grid=yes]
  2005-08-31 15:06       ` Randall Skelton
@ 2005-08-31 15:28         ` Randall Skelton
  2005-08-31 15:54           ` Hans Hagen
  0 siblings, 1 reply; 8+ messages in thread
From: Randall Skelton @ 2005-08-31 15:28 UTC (permalink / raw)



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

One more quick question. When using a grid, I gather that I should wrap all 
floating content (tables & figures in my case) with \placeongrid to ensure 
\snaptogrid is being used. Does this also apply to formulae? i.e. should I 
be using:

\placeformula
\placeongrid{%
\startformula 
... 
\stopformula
}

Thanks,
Randall

[-- Attachment #1.2: Type: text/html, Size: 475 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] 8+ messages in thread

* Re: Help with \setuplayout[grid=yes]
  2005-08-31 15:28         ` Randall Skelton
@ 2005-08-31 15:54           ` Hans Hagen
  0 siblings, 0 replies; 8+ messages in thread
From: Hans Hagen @ 2005-08-31 15:54 UTC (permalink / raw)


Randall Skelton wrote:

> One more quick question.  When using a grid, I gather that I should 
> wrap all floating content (tables & figures in my case) with 
> \placeongrid to ensure \snaptogrid is being used.  Does this also 
> apply to formulae?  i.e. should I be using:

no, actually most environments hald grids themselves (for math on grid, 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] 8+ messages in thread

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

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-30 22:44 Help with \setuplayout[grid=yes] Randall Skelton
2005-08-31  7:55 ` Vit Zyka
2005-08-31 13:19   ` Randall Skelton
2005-08-31 13:31     ` Taco Hoekwater
2005-08-31 13:42     ` Vit Zyka
2005-08-31 15:06       ` Randall Skelton
2005-08-31 15:28         ` Randall Skelton
2005-08-31 15:54           ` Hans Hagen

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