ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <schuster.wolfgang@googlemail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: beta/problem with layers
Date: Wed, 2 Feb 2011 11:24:08 +0100	[thread overview]
Message-ID: <3B21D67B-85FF-4429-A093-629E95134B79@gmail.com> (raw)
In-Reply-To: <B8890CCD-CD24-406F-8F89-338256A620BD@uni-koblenz.de>


Am 01.02.2011 um 13:33 schrieb Andreas Harder:

> Am 01.02.2011 um 12:11 schrieb Wolfgang Schuster:
> 
>> Am 01.02.2011 um 11:43 schrieb Andreas Harder:
>> 
>>> Hi,
>>> 
>>> it seems there go something wrong with layers.
>> 
>> With the last beta context postpones font loading till \starttext.
>> 
>> As there is no font loaded the layer content is not visible,
>> move \starttext at the begin of the file and you can see the
>> layer text.
> 
> Thanks Wolfgang, I forgot about that.

Even though it’s not so obvious because other commands like \setupheadertexts
don’t have this problem, for all the curious people here is a small example
where you can see the problem in another context.

\starttext
\tt\setbox0=\hbox{boxed text}\ss unboxed text \box0
\stoptext

You would now expect both texts are printed sans serif but the first
was saved in a box and use not the font which was active when you
stored it in the box, the same happens with \setlayer because
the commands stores the content too in a \hbox and since there was
no font available when you put it in the box nothing is shown.

Besides moving \setlayer after \starttext you can just load a font
before the \setlayer settings, e.g.

\setupbodyfont[modern]
\definelayer[…]
\setlayer[…]{…}
\starttext
…
\stoptext

or you use \startproduct which is normally always written as first line
and acts \starttext which preloads then the Latin Modern fonts, e.g.

\startproduct

\definelayer[…]
\setlayer[…]{…}

\startbodymatter
…
\stopbodymatter

\stopproduct

The bodymatter enviroment isn’t necessary here because it’s always enabled
when you other sectionblockenvironment is used but it’s useful to have
something which separates the preamble from the text.

Wolfgang

___________________________________________________________________________________
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:[~2011-02-02 10:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-01 10:43 Andreas Harder
2011-02-01 11:11 ` Wolfgang Schuster
2011-02-01 12:33   ` Andreas Harder
2011-02-02 10:24     ` Wolfgang Schuster [this message]
2011-02-02 15:07       ` Aditya Mahajan
2011-02-02 15:20         ` Hans Hagen
2011-02-02 16:46           ` Aditya Mahajan
2011-02-02 17:02             ` Hans Hagen
2011-02-02 17:13             ` Hans Hagen
2011-02-02 21:19         ` Wolfgang Schuster

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=3B21D67B-85FF-4429-A093-629E95134B79@gmail.com \
    --to=schuster.wolfgang@googlemail.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).