ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* How to use layers or other methods for precise positioning of items
@ 2005-11-01  0:19 Kári Hreinsson
  2005-11-01 12:06 ` Patrick Gundlach
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Kári Hreinsson @ 2005-11-01  0:19 UTC (permalink / raw)


Hello,

I have been trying to use ConTeXt for setting up a book with a list of
students in my school, with pictures of them, phone numbers, emails
and such.

I thought I could use ConTeXt for the job since LaTeX gave me much
trouble in trying to alter the layout and look of the page.

I found the "layer" feature in ConTeXt which I found very interesting
and thought I could use it to position items (such as text info,
images and the layout) within these layers since they offer very
precise positioning with a x-y grid like system.

When I was trying to use this feature for multipage document it cut of
all of the pages except the first.  I found out that the layers
weren't thought to be part of the content of the file but more like a
background and I can't figure out how to use them on many pages
without placing something like a dot on every page.  Is there any way
to do this?
I discovered that the layers were "inserted" into the document via
"\setupbackgrounds[page]" so I understand why it acts like this but I
am asking if there is some way of getting layers working like I want?

Maybe I am going in completely wrong way?  Is there any other good way
to do this, that is positioning items with x-y coordinates or
something totally different that I am missing?

Another thing I was wondering about is how to make items like images
bleed (that is to go over the edge of the paper, to avoid white lines
at the margin).  Can I use negative values for positioning to achive
that?

All help is greatly appreciated since I am not understanding this and
I haven't found much help on the internet regarding this subject
(contextgarden had only one example page that had layers).

I hope you understand my question, it's a bit complicated to explain. :/

Thanks in advance,
Kári Hreinsson

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

* Re: How to use layers or other methods for precise positioning of items
  2005-11-01  0:19 How to use layers or other methods for precise positioning of items Kári Hreinsson
@ 2005-11-01 12:06 ` Patrick Gundlach
  2005-11-03 19:40 ` Mojca Miklavec
  2005-11-09 12:28 ` Hans Hagen
  2 siblings, 0 replies; 5+ messages in thread
From: Patrick Gundlach @ 2005-11-01 12:06 UTC (permalink / raw)


Hello Kari,

did you consider looking through the published articles for \layer
etc? Goto http://articles.contextgarden.net/ and search for "layer".

Patrick

-- 
ConTeXt wiki and more: http://contextgarden.net

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

* Re: How to use layers or other methods for precise positioning of items
  2005-11-01  0:19 How to use layers or other methods for precise positioning of items Kári Hreinsson
  2005-11-01 12:06 ` Patrick Gundlach
@ 2005-11-03 19:40 ` Mojca Miklavec
  2005-11-03 21:45   ` Kári Hreinsson
  2005-11-09 12:28 ` Hans Hagen
  2 siblings, 1 reply; 5+ messages in thread
From: Mojca Miklavec @ 2005-11-03 19:40 UTC (permalink / raw)


Kári Hreinsson wrote:
> Hello,
>
> I have been trying to use ConTeXt for setting up a book with a list of
> students in my school, with pictures of them, phone numbers, emails
> and such.
>
> I thought I could use ConTeXt for the job since LaTeX gave me much
> trouble in trying to alter the layout and look of the page.
>
> I found the "layer" feature in ConTeXt which I found very interesting
> and thought I could use it to position items (such as text info,
> images and the layout) within these layers since they offer very
> precise positioning with a x-y grid like system.
>
> When I was trying to use this feature for multipage document it cut of
> all of the pages except the first.  I found out that the layers
> weren't thought to be part of the content of the file but more like a
> background and I can't figure out how to use them on many pages
> without placing something like a dot on every page.  Is there any way
> to do this?

If "a dot" is the source of all your problems, you can easily solve
this by placing a \strut instead of a dot at the top of the page.
(Perhaps even \null would do.) \strut is an empty box with width zero
and height of "one line" (generally speaking).

I was confused for a long time since there are at least five different
ways to achieve the desired results, each one with its advantages and
drawbacks, so you may have to be even more specific about the layout.

You can do the whole page with layers if you are sure that you want to
provite all the coordinates by hand. If you use an alternative way (if
you place a figure at the left or right side of text for example),
space will be reserved and text will flow around the figure. If you
place a figure in a layer, you'll have to manually adjust text
width/height/hole, so that it won't overlap with the figure.

Some alternatives to layers that come to my mind in the first moment are:
1. tables (http://wiki.contextgarden.net/Tables_Overview)
with \bTABLE ... \eTABLE you can manully specify widths and heights of
table cells and put photos in the left cell with specified width. The
rest of data can go to the remaining cells on the right with
automatically determined widths and heights.

2. grid typesetting
http://pragma-ade.nl/general/manuals/details.pdf
you can position the stuff on the grid (still precise, but in other
units than centimeters)

3. http://wiki.contextgarden.net/Chromatograms uses \startpositioning
... \stoppositioning, which is probably something similar to layers. I
never used it, but perhaps you can take a look if you find it useful.

4. many other ways for sure (depending on your needs), in worst case
even plain TeX ;)

> I discovered that the layers were "inserted" into the document via
> "\setupbackgrounds[page]" so I understand why it acts like this but I
> am asking if there is some way of getting layers working like I want?

How is that? You can place layers in other ways than on the whole page
(you can say that a layer has to be two centimeters from the bottom
and three centimeters from the left edge or that it has to be 1cm
wider than the text area of the page), you can put them in the
backgrond or on the top of text, but you can't prevent them from being
invisible to the rest of the page content (you can't place a layer and
expect a text portion to flow around that layer).

> Maybe I am going in completely wrong way?  Is there any other good way
> to do this, that is positioning items with x-y coordinates or
> something totally different that I am missing?

see above (tables, grid, ...)

> Another thing I was wondering about is how to make items like images
> bleed (that is to go over the edge of the paper, to avoid white lines
> at the margin).  Can I use negative values for positioning to achive
> that?

You have a couple of examples in the official documentation (page 32
of details.pdf for example). google.com: "bleeding
site:pragma-ade.com"
If you position using frames, you can use negative values, yes. (See
the example below.)

> All help is greatly appreciated since I am not understanding this and
> I haven't found much help on the internet regarding this subject
> (contextgarden had only one example page that had layers).

Patrick already mentioned the new "search engine ;)" through articles.
I often use google.com and "layers site:contextgarden.net" for
example. You can find a lot in old mailing list archives.






\setuppapersize
  [A4][A4]
\definelayer
	[page]
	[width=\paperwidth,
	 height=\paperheight]
\setupbackgrounds
	[page]
	[background=page]
\setupexternalfigures
	[location={local,global,default}]
\setupframed
	[align=middle,
	 frame=on]

\starttext
\startstandardmakeup
	\setlayerframed
		[page]
		[voffset=1cm,
		 hoffset=-2cm,
		 preset=lefttop]
		%[width=xxx]
		{\externalfigure[cow]}
	\setlayerframed
		[page]
		[voffset=10cm,
		 preset=lefttop,
		 width=\paperwidth,
		 frame=off,
		 align=middle]
		{\bfc Cut the head!}
\stopstandardmakeup
\stoptext

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

* Re: How to use layers or other methods for precise positioning of items
  2005-11-03 19:40 ` Mojca Miklavec
@ 2005-11-03 21:45   ` Kári Hreinsson
  0 siblings, 0 replies; 5+ messages in thread
From: Kári Hreinsson @ 2005-11-03 21:45 UTC (permalink / raw)


Thank you for your replies.  This reading material you pointed me to
should answer all my questions, else, I might drop a question here
again later :).

Thanks again, this was really helpful!

- Kári Hreinsson

On 11/3/05, Mojca Miklavec <mojca.miklavec.lists@gmail.com> wrote:
> Kári Hreinsson wrote:
> > Hello,
> >
> > I have been trying to use ConTeXt for setting up a book with a list of
> > students in my school, with pictures of them, phone numbers, emails
> > and such.
> >
> > I thought I could use ConTeXt for the job since LaTeX gave me much
> > trouble in trying to alter the layout and look of the page.
> >
> > I found the "layer" feature in ConTeXt which I found very interesting
> > and thought I could use it to position items (such as text info,
> > images and the layout) within these layers since they offer very
> > precise positioning with a x-y grid like system.
> >
> > When I was trying to use this feature for multipage document it cut of
> > all of the pages except the first.  I found out that the layers
> > weren't thought to be part of the content of the file but more like a
> > background and I can't figure out how to use them on many pages
> > without placing something like a dot on every page.  Is there any way
> > to do this?
>
> If "a dot" is the source of all your problems, you can easily solve
> this by placing a \strut instead of a dot at the top of the page.
> (Perhaps even \null would do.) \strut is an empty box with width zero
> and height of "one line" (generally speaking).
>
> I was confused for a long time since there are at least five different
> ways to achieve the desired results, each one with its advantages and
> drawbacks, so you may have to be even more specific about the layout.
>
> You can do the whole page with layers if you are sure that you want to
> provite all the coordinates by hand. If you use an alternative way (if
> you place a figure at the left or right side of text for example),
> space will be reserved and text will flow around the figure. If you
> place a figure in a layer, you'll have to manually adjust text
> width/height/hole, so that it won't overlap with the figure.
>
> Some alternatives to layers that come to my mind in the first moment are:
> 1. tables (http://wiki.contextgarden.net/Tables_Overview)
> with \bTABLE ... \eTABLE you can manully specify widths and heights of
> table cells and put photos in the left cell with specified width. The
> rest of data can go to the remaining cells on the right with
> automatically determined widths and heights.
>
> 2. grid typesetting
> http://pragma-ade.nl/general/manuals/details.pdf
> you can position the stuff on the grid (still precise, but in other
> units than centimeters)
>
> 3. http://wiki.contextgarden.net/Chromatograms uses \startpositioning
> ... \stoppositioning, which is probably something similar to layers. I
> never used it, but perhaps you can take a look if you find it useful.
>
> 4. many other ways for sure (depending on your needs), in worst case
> even plain TeX ;)
>
> > I discovered that the layers were "inserted" into the document via
> > "\setupbackgrounds[page]" so I understand why it acts like this but I
> > am asking if there is some way of getting layers working like I want?
>
> How is that? You can place layers in other ways than on the whole page
> (you can say that a layer has to be two centimeters from the bottom
> and three centimeters from the left edge or that it has to be 1cm
> wider than the text area of the page), you can put them in the
> backgrond or on the top of text, but you can't prevent them from being
> invisible to the rest of the page content (you can't place a layer and
> expect a text portion to flow around that layer).
>
> > Maybe I am going in completely wrong way?  Is there any other good way
> > to do this, that is positioning items with x-y coordinates or
> > something totally different that I am missing?
>
> see above (tables, grid, ...)
>
> > Another thing I was wondering about is how to make items like images
> > bleed (that is to go over the edge of the paper, to avoid white lines
> > at the margin).  Can I use negative values for positioning to achive
> > that?
>
> You have a couple of examples in the official documentation (page 32
> of details.pdf for example). google.com: "bleeding
> site:pragma-ade.com"
> If you position using frames, you can use negative values, yes. (See
> the example below.)
>
> > All help is greatly appreciated since I am not understanding this and
> > I haven't found much help on the internet regarding this subject
> > (contextgarden had only one example page that had layers).
>
> Patrick already mentioned the new "search engine ;)" through articles.
> I often use google.com and "layers site:contextgarden.net" for
> example. You can find a lot in old mailing list archives.
>
>
>
>
>
>
> \setuppapersize
>   [A4][A4]
> \definelayer
>         [page]
>         [width=\paperwidth,
>          height=\paperheight]
> \setupbackgrounds
>         [page]
>         [background=page]
> \setupexternalfigures
>         [location={local,global,default}]
> \setupframed
>         [align=middle,
>          frame=on]
>
> \starttext
> \startstandardmakeup
>         \setlayerframed
>                 [page]
>                 [voffset=1cm,
>                  hoffset=-2cm,
>                  preset=lefttop]
>                 %[width=xxx]
>                 {\externalfigure[cow]}
>         \setlayerframed
>                 [page]
>                 [voffset=10cm,
>                  preset=lefttop,
>                  width=\paperwidth,
>                  frame=off,
>                  align=middle]
>                 {\bfc Cut the head!}
> \stopstandardmakeup
> \stoptext
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
>

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

* Re: How to use layers or other methods for precise positioning of items
  2005-11-01  0:19 How to use layers or other methods for precise positioning of items Kári Hreinsson
  2005-11-01 12:06 ` Patrick Gundlach
  2005-11-03 19:40 ` Mojca Miklavec
@ 2005-11-09 12:28 ` Hans Hagen
  2 siblings, 0 replies; 5+ messages in thread
From: Hans Hagen @ 2005-11-09 12:28 UTC (permalink / raw)


� wrote:

>When I was trying to use this feature for multipage document it cut of
>all of the pages except the first.  I found out that the layers
>weren't thought to be part of the content of the file but more like a
>background and I can't figure out how to use them on many pages
>without placing something like a dot on every page.  Is there any way
>to do this?
>I discovered that the layers were "inserted" into the document via
>"\setupbackgrounds[page]" so I understand why it acts like this but I
>am asking if there is some way of getting layers working like I want?
>  
>
was this solved?

(btw, if you are positioning things in a n by n way, an option is to use 
small pages (A7 or so) and ise the page imposition xy feature to collect 
them on a page)

>Another thing I was wondering about is how to make items like images
>bleed (that is to go over the edge of the paper, to avoid white lines
>at the margin).  Can I use negative values for positioning to achive
>that?
>  
>
indeed,

\setposition[...][hoffset=2mm,voffset=-2mm,...]

(in principle h(v)offset and x(y) do similar things but having two keys 
for each makes it possibel to separate the bleed from the positioning)

Hans

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

end of thread, other threads:[~2005-11-09 12:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-01  0:19 How to use layers or other methods for precise positioning of items Kári Hreinsson
2005-11-01 12:06 ` Patrick Gundlach
2005-11-03 19:40 ` Mojca Miklavec
2005-11-03 21:45   ` Kári Hreinsson
2005-11-09 12:28 ` 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).