ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Peter Park Nelson <peter.park.nelson@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Set a block of content at minimum distance from top of page?
Date: Thu, 2 Feb 2012 18:35:08 -0600	[thread overview]
Message-ID: <CAGfkPGkn3yXYZPkZONnOmLLWSngx_tHOpUiLUypNRLd-sD9ZEw@mail.gmail.com> (raw)
In-Reply-To: <D651DE42-253B-4215-95C9-7D5F8FC29D03@googlemail.com>

On Thu, Feb 2, 2012 at 3:46 PM, Wolfgang Schuster
<schuster.wolfgang@googlemail.com> wrote:
>
> Am 02.02.2012 um 21:51 schrieb Peter Park Nelson:
>
>> Hi ConTeXt list,
>>
>> I have a document with a graphic (logo) in the upper right corner
>> (positioned on a layer and placed as a background). To the left of
>> this graphic are several text elements (Title, Author List, etc.) that
>> don't go all the way across the page. (Currently I have wrapped them
>> in \startnarrower...\stopnarrower -- is there a better way?) But this
>> is followed by an Abstract paragraph that uses the full width of the
>> page.
>>
>> I would like to ensure that the full-width text never starts high
>> enough on the page that it encroaches on the upper-right-corner
>> graphic. So, I'm looking for a way to protect the graphic, or to force
>> the Abstract to start a minimum distance from the top of the page.
>>
>> The Abstract can be forced down the page if necessary by manually
>> inserting a \godown[] command before it, but I would prefer a
>> programmatic solution.
>>
>> Floating the graphic and wrapping text around it does not seem like a
>> good option, because I want to ensure that its position is absolute
>> and it never moves. Also, the Abstract needs to be full-width
>> throughout, so I need to force it to start after the graphic rather
>> than partially wrapping it.
>>
>> Any suggestions appreciated…
>
> You can use something like the following code but without a example from you it’s difficult to give a answer.
>
> \showframe[text][text]
>
> \starttext
>
> \maxaligned\bgroup
>
>        \startframed[frame=off,location=top,width=10cm,align=flushleft]%
>        line 1\\
>        line 2\\
>        line 3
>        \stopframed
>
>        \hfill
>
>        \tbox{\externalfigure[dummy][width=3cm,height=4cm]}%
>
> \egroup
>
> \input knuth
>
> \stoptext
>
> Wolfgang
>
> ___________________________________________________________________________________

Here's a minimal example of what I'm talking about.

I would like the Abstract to not start until it will be clear of the
logo graphic on the right side.

In the real document, I cannot be sure how much vertical space will
taken up by text items (Authors, subtitle, etc.) between the Title and
the Abstract, hence my question.

Maybe I am thinking about this in the wrong way and there is a
different approach? I have more of a DTP background.

%%---start example -----------------------%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% PAGE LAYOUT
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\setuppapersize[letter][letter]

\setuplayout
  [width=middle,
  backspace=15mm,
  topspace=10mm,
  height=254mm,
  header=5mm,
  headerdistance=3mm,
  footer=5mm,
  footerdistance=3mm,
  grid=yes]

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% LOGO ON FIRST PAGE:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\useexternalfigure[logo][dummy][type=pdf,width=35mm,height=50mm]

\definelayer
  [logo-layer]
  [width=\paperwidth,height=\paperheight]

\setlayer
  [logo-layer]
  [preset=righttop,hoffset=15mm,voffset=10mm]
  {\externalfigure[logo]}

\setupbackgrounds[page][background={logo-layer}]

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% HEADS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\setuphead[title]
 [header=high,
  footer=high,
  grid={page},
  width=140mm,
  textstyle=\tfc\ss\bf]

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% ARTICLE ABSTRACT
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\definedescription[Abstract][%
  location=serried,
  width=broad,
  text={Abstract},
  indentnext=no]%,

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% ARTICLE TEXT
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\starttext

\title{The title of this article wraps at 140 mm so it doesn't hit the logo}

% A VARIABLE NUMBER OF TEXT ITEMS WILL BE PLACED HERE...

% \godown[3cm] % UNCOMMENT TO FORCE THE ABSTRACT BELOW THE LOGO

\startAbstract
But the abstract can continue all the way across the page...\input tufte\par
\stopAbstract

\stoptext

%%------- end example --------------%

-- 
Peter Park Nelson
peter.park.nelson@gmail.com
___________________________________________________________________________________
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
___________________________________________________________________________________


  reply	other threads:[~2012-02-03  0:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-02 20:51 Peter Park Nelson
2012-02-02 21:46 ` Wolfgang Schuster
2012-02-03  0:35   ` Peter Park Nelson [this message]
2012-02-04  2:16     ` Peter Park Nelson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGfkPGkn3yXYZPkZONnOmLLWSngx_tHOpUiLUypNRLd-sD9ZEw@mail.gmail.com \
    --to=peter.park.nelson@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).