ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: nice friends-book with ConText - quite ready
@ 2011-10-14 17:13 Jan Heinen
  2011-10-14 18:28 ` Marco
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Heinen @ 2011-10-14 17:13 UTC (permalink / raw)
  To: ntg-context

Hello it was a ConText-night,

and as a newby I learned a lot about ConText :-)

Here is what I wanted to get: 
http://www.imagebanana.com/view/f4o3un2c/Entwurffriends.png

And here are my results: 
http://www.imagebanana.com/view/8vq30irn/ContextLayers.png

There are only little things which could be improved: How??
1. where comes the frame around the foto from? How can I 
switch it off?
2. There is a thin white line between layer A and the 
Infobox. How to rid of it?
3. How can I get padding into the Infobox? top, botttom, 
right and left


And here is my code for everyone who likes the layout of my 
friends-book ;-)


\definelayer[Kontaktdaten][x=20mm,y=30mm,width=65mm,height=30mm,state=start]
\setupbackgrounds[paper][setups=ALayer,background=Kontaktdaten,state=start]

\starttext
\strut

\setlayerframed[Kontaktdaten][background=color,backgroundcolor=lightgreen,width=10mm,height=130mm,frame=off,hoffset=-20mm,voffset=145mm,align=right]{A}
\setlayerframed[Kontaktdaten][background=color,backgroundcolor=darkgreen,width=10mm,height=60mm,frame=off,hoffset=-20mm,voffset=85mm,align=right]{B}
\setlayerframed[Kontaktdaten][background=color,backgroundcolor=lightgreen,width=60mm,height=175mm,frame=off,hoffset=-10mm,voffset=100mm,align=right]%
{Infobox:\crlf
Peter\crlf
New York\crlf
0171/782801\crlf
test@test.de}
\setlayerframed[Kontaktdaten][width=30mm,height=40mm,frame=\LayoutTest,hoffset=-10mm,voffset=60mm][strut=no,offset=overlay]%
  {\externalfigure[niceImage][width=30mm,height=40mm]}

\page
\stoptext



Regards
Jannis

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: nice friends-book with ConText - quite ready
  2011-10-14 17:13 nice friends-book with ConText - quite ready Jan Heinen
@ 2011-10-14 18:28 ` Marco
  0 siblings, 0 replies; 2+ messages in thread
From: Marco @ 2011-10-14 18:28 UTC (permalink / raw)
  To: ntg-context

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

On 2011-10-14 Jan Heinen <JaHeinen@gmx.de> wrote:

> And here are my results: 
> http://www.imagebanana.com/view/8vq30irn/ContextLayers.png
> 
> There are only little things which could be improved: How??
> 1. where comes the frame around the foto from? How can I 
> switch it off?

You introduced one pair on brackets too much.

> 2. There is a thin white line between layer A and the 
> Infobox. How to rid of it?

I don't see a white line, neither on the image you
provided, nor when I compile it.

> 3. How can I get padding into the Infobox? top, botttom, 
> right and left

Maybe there's a cleaner solution, but I misuse the frame
itself for that (see example).

> And here is my code for everyone who likes the layout of my 
> friends-book ;-)

The layout is a matter of taste, but the code is
improvable. Here are some tips:

- Don't write everything in one line! Use indentation. If
  your code is ugly to read, it lowers the change of
  getting a response.

- Make the code compile. At least on my context (not
  really up-to-date) it throws an error.

- There are some images and text files included in the
  ConTeXt distribution. Check
  …texmf-context/tex/context/sample
  Use them (e.g. “cow”).


Regards

Marco Patzer

[-- Attachment #2: friendbook.tex --]
[-- Type: text/x-tex, Size: 1262 bytes --]

\definelayer [Kontaktdaten]
  [
    x=20mm,
    y=30mm,
    width=65mm,
    height=30mm,
    state=start
  ]

\setupbackgrounds [paper]
  [
    %setups=ALayer,
    % The setup ALayer is never defined
    background=Kontaktdaten,
    state=start
  ]

\starttext
\strut

\setlayerframed [Kontaktdaten]
  [
    background=color,
    backgroundcolor=lightgreen,
    width=10mm,
    height=130mm,
    frame=off,
    hoffset=-20mm,
    voffset=145mm,
    align=right
  ]{A}

\setlayerframed [Kontaktdaten]
  [
    background=color,
    backgroundcolor=darkgreen,
    width=10mm,
    height=60mm,
    frame=off,
    hoffset=-20mm,
    voffset=85mm,
    align=right
  ]{B}

\setlayerframed [Kontaktdaten]
  [
    background=color,
    backgroundcolor=lightgreen,
    width=60mm,
    height=175mm,
    frame=off,
    leftframe=on,
    framecolor=green,
    rulethickness=.5cm,
    hoffset=-10mm,
    voffset=100mm,
    align=right
  ]{%
\startlines
  Infobox:
  Peter
  New York
  0171/782801
  test@test.de
\stoplines}

\setlayerframed [Kontaktdaten]
  [
    width=30mm,
    height=40mm,
    %frame=\LayoutTest,
    frame=off,
    hoffset=-10mm,
    voffset=60mm,
    strut=no,
    %offset=overlay
  ]{%
  \externalfigure[cow][width=30mm,height=40mm]}

\page
\stoptext


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

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2011-10-14 18:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-14 17:13 nice friends-book with ConText - quite ready Jan Heinen
2011-10-14 18:28 ` Marco

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