ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: call for help with context
       [not found] <20010308150340.A8765@anxur.fi.muni.cz>
@ 2001-03-08 14:44 ` Hans Hagen
  2001-03-08 15:16   ` Han The Thanh
  2001-03-08 17:48   ` Re[2]: " Giuseppe Bilotta
  0 siblings, 2 replies; 9+ messages in thread
From: Hans Hagen @ 2001-03-08 14:44 UTC (permalink / raw)
  Cc: ntg-context

At 03:03 PM 3/8/01 +0100, Han The Thanh wrote:
>Hi Hans,
>
>I posted a few questions to the context mail list but didn't get the
>answer ...

SInce i cannot see you suffering ... 

>1) how to define a new font family alternative similar to \rm, \ss or \tt?
>   I tried to add some code to the file font-ini.tex, however it
>   doesn't work. It seem to be non-trivial, and I don't know context
>   enough yet. I tried to use my own NFSS, but soon found out that it
>   is not a good idea.

\definefontstyle [hanthethanh,htt] [htt]

\definebodyfont
  [10pt,11pt,12pt]
  [htt]
  [tf=Regular sa 1,
   bf=Sans sa 1]

\setupbodyfont[hanthethanh]
\setupfootnotes[n=3,align=normal,tolerance={verytolerant,stretch}]

So, we can mix {\bf whatever fonts} we want in a style like \htt.

>2) I cannot get rid of the overfull boxes in two-column footnote:
>   setting \emergencystretch in the beggining doesn't work for
>   footnote mode (it is always set to 0)

You can add this code to cont-new.tex

\setupfootnotes[\c!uitlijnen=\v!normaal,\c!tolerantie=\v!soepel]

\def\setfootnotebodyfont%
  {\let\setfootnotebodyfont\relax
   \restoreglobalbodyfont
   \switchtobodyfont[\@@vnkorps]%
   \steltolerantiein[\@@vntolerantie]%
   \steluitlijnenin[\@@vnuitlijnen]}

Now you can say:  

\setupfootnotes[align=normal, tolerance={verytoleranr,stretch}]

>3) somehow context breaks page in a very odd way: sometime too much
>   space between body text and footnote, sometime too little. Maybe it
>   has to do with choosing the page dimension that the textheight is
>   not a multiple of the baselineskip.

Indeed. The new otr will give you more control over that. It is a tricky
rounding error problem and (imho) tex does not always give you the control
you need. 

Hans
-------------------------------------------------------------------------
                                  Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                      Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


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

* Re: call for help with context
  2001-03-08 14:44 ` call for help with context Hans Hagen
@ 2001-03-08 15:16   ` Han The Thanh
  2001-03-08 15:54     ` Berend de Boer
  2001-03-08 16:34     ` Hans Hagen
  2001-03-08 17:48   ` Re[2]: " Giuseppe Bilotta
  1 sibling, 2 replies; 9+ messages in thread
From: Han The Thanh @ 2001-03-08 15:16 UTC (permalink / raw)
  Cc: ntg-context

Hi Hans,

> \definefontstyle [hanthethanh,htt] [htt]
> 
> \definebodyfont
>   [10pt,11pt,12pt]
>   [htt]
>   [tf=Regular sa 1,
>    bf=Sans sa 1]
> 
> \setupbodyfont[hanthethanh]
> \setupfootnotes[n=3,align=normal,tolerance={verytolerant,stretch}]
> 
> So, we can mix {\bf whatever fonts} we want in a style like \htt.

I tried the following:

==================== begin of file font-test.tex ==========================
\definebodyfont [14.4pt,12pt,11pt,10pt,9pt,8pt,7pt,6pt,5pt] [rm] [ 
    tf=LexiconNo2RomanA-Txt8y,
    bf=LexiconNo2RomanC-Txt8y,
    it=LexiconNo2ItalicA-Txt8y,
    bi=LexiconNo2ItalicC-Txt8y,
    sc=LexiconNo2RomanA-Exp8y]

\definefontstyle [aa] [aa]

\definebodyfont [14.4pt,12pt,11pt,10pt,9pt,8pt,7pt,6pt,5pt] [aa] [ 
    tf=LexiconNo2RomanB-Txt8y,
    bf=LexiconNo2RomanD-Txt8y,
    it=LexiconNo2ItalicB-Txt8y,
    bi=LexiconNo2ItalicD-Txt8y,
    sc=LexiconNo2RomanB-Exp8y]
==================== end of file font-test.tex ==========================

and the tex file looks like:

==================== cut here ==========================
\setupbodyfont [test]
\setupfootnotes[style=aa]

\starttext
\chapter{A SHORT STORY}
Once upon a time, in a distant
  galaxy called \"O\"o\c c,
there lived a computer
named R.~J. Drofnats.
\footnote{% 
Mr.~Drofnats---or ``R. J.,'' as
he preferred to be called---% error has been fixed!
was happiest when he was at work
typesetting {\it beautiful\/} documents.}
\stoptext
==================== cut here ==========================

it works more or less, but there are still two problems:

1) the chapter font is cmr12
2) the italic font in the footnote comes from \rm, not \aa as I expected

How can I please fix it?

Thanh


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

* Re: call for help with context
  2001-03-08 15:16   ` Han The Thanh
@ 2001-03-08 15:54     ` Berend de Boer
  2001-03-08 16:36       ` Hans Hagen
       [not found]       ` <20010309130110.A2783@anxur.fi.muni.cz>
  2001-03-08 16:34     ` Hans Hagen
  1 sibling, 2 replies; 9+ messages in thread
From: Berend de Boer @ 2001-03-08 15:54 UTC (permalink / raw)
  Cc: Hans Hagen, ntg-context

Han The Thanh wrote:

> \definebodyfont [14.4pt,12pt,11pt,10pt,9pt,8pt,7pt,6pt,5pt] [aa] [ 

Shouldn't this be [rm] to define an rm font?

Else you perhaps have to do a

\setupbodyfont[test,aa]

Groetjes,

Berend. (-:


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

* Re: call for help with context
  2001-03-08 15:16   ` Han The Thanh
  2001-03-08 15:54     ` Berend de Boer
@ 2001-03-08 16:34     ` Hans Hagen
  2001-03-09  9:34       ` Han The Thanh
  1 sibling, 1 reply; 9+ messages in thread
From: Hans Hagen @ 2001-03-08 16:34 UTC (permalink / raw)
  Cc: ntg-context

At 04:16 PM 3/8/01 +0100, Han The Thanh wrote:

>1) the chapter font is cmr12

then you need to define: 

[.....,tfa=... sa a]

which means tfa tfb tfc etc scaled at predefined sizes a b c [see font-cmr
for examples]

>2) the italic font in the footnote comes from \rm, not \aa as I expected

\setupfootnotes[bodyfont=aa]
-------------------------------------------------------------------------
                                  Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                      Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


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

* Re: call for help with context
  2001-03-08 15:54     ` Berend de Boer
@ 2001-03-08 16:36       ` Hans Hagen
       [not found]       ` <20010309130110.A2783@anxur.fi.muni.cz>
  1 sibling, 0 replies; 9+ messages in thread
From: Hans Hagen @ 2001-03-08 16:36 UTC (permalink / raw)
  Cc: ntg-context

At 04:54 PM 3/8/01 +0100, Berend de Boer wrote:
>
>
>Han The Thanh wrote:
>
>> \definebodyfont [14.4pt,12pt,11pt,10pt,9pt,8pt,7pt,6pt,5pt] [aa] [ 
>
>Shouldn't this be [rm] to define an rm font?

You can take anything you want, but rm, ss tt hw and cg are kind of
predefined; so one can have hundreds of font collections 

Hans

-------------------------------------------------------------------------
                                  Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                      Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


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

* Re[2]: call for help with context
  2001-03-08 14:44 ` call for help with context Hans Hagen
  2001-03-08 15:16   ` Han The Thanh
@ 2001-03-08 17:48   ` Giuseppe Bilotta
  1 sibling, 0 replies; 9+ messages in thread
From: Giuseppe Bilotta @ 2001-03-08 17:48 UTC (permalink / raw)
  Cc: ntg-context

>>3) somehow context breaks page in a very odd way: sometime too much
>>   space between body text and footnote, sometime too little. Maybe it
>>   has to do with choosing the page dimension that the textheight is
>>   not a multiple of the baselineskip.

HH> Indeed. The new otr will give you more control over that. It is a tricky
HH> rounding error problem and (imho) tex does not always give you the control
HH> you need. 

Hans, I posted a mail on the list about footnote handling, about a
week ago, named "Still on footnotes", with two test files that show
the problems presented in the post. Were you able to pin down the
problems? Are they the same as the ones referred in this post?

Giuseppe


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

* Re: call for help with context
  2001-03-08 16:34     ` Hans Hagen
@ 2001-03-09  9:34       ` Han The Thanh
  2001-03-10 13:18         ` Hans Hagen
  0 siblings, 1 reply; 9+ messages in thread
From: Han The Thanh @ 2001-03-09  9:34 UTC (permalink / raw)
  Cc: Han The Thanh, ntg-context

Hans,

many thanks for the great hints -- it works now. But for completeness: how
can I define a new style like \bf, \it in a new family? For example I tried
a \zz style:

\definebodyfont [12pt,11pt,10pt] [aa] [ 
    tf=LexiconNo2RomanA-Txt8y,
    zz=LexiconNo2RomanD-Txt8y]

but when switching to \zz, it seems to go into an endless loop: I had to
use `killall pdfetex' to stop it. 

Thanh


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

* Re: call for help with context
  2001-03-09  9:34       ` Han The Thanh
@ 2001-03-10 13:18         ` Hans Hagen
  0 siblings, 0 replies; 9+ messages in thread
From: Hans Hagen @ 2001-03-10 13:18 UTC (permalink / raw)
  Cc: ntg-context

At 10:34 AM 3/9/01 +0100, Han The Thanh wrote:
>Hans,
>
>many thanks for the great hints -- it works now. But for completeness: how
>can I define a new style like \bf, \it in a new family? For example I tried
>a \zz style:
>
>\definebodyfont [12pt,11pt,10pt] [aa] [ 
>    tf=LexiconNo2RomanA-Txt8y,
>    zz=LexiconNo2RomanD-Txt8y]

you should add the sa 1 [scaled a 1 time the current bodyfont] otherwise it
gets the whatever-it-is design size

>but when switching to \zz, it seems to go into an endless loop: I had to
>use `killall pdfetex' to stop it. 

The number of families is limited in tex (which is quite annoying since
it's one of the reasons why macro(packages) are more complicated than
needed when it comes down to fonts). Families are kind of tricky anyway
since in math the fonts are resolved afterwards which means that one cannot
temporarily overload a family. 

In context, there are a number of predefined families
(tf,bf,sl,it,bs,bi,sc) and technically one can extend this list. One way is
to misuse a family that you would not use anyway, so using the bi slot fo
rinstance, but an alternative is to hitch hike on an existing one like: 

  tf=...,
  tfmine=LexiconFontWithAVeryLongAndFunnyNameEncodedInASpecialWayByThanh sa
1, 

This would behave like tfa etc, which is ok outside math; in the
bodyfontenvironment you could specify 'mine' as size 1 so that you could
say 'sa mine']. 

Hans  
-------------------------------------------------------------------------
                                  Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                      Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


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

* Re: call for help with context
       [not found]       ` <20010309130110.A2783@anxur.fi.muni.cz>
@ 2001-03-10 13:24         ` Hans Hagen
  0 siblings, 0 replies; 9+ messages in thread
From: Hans Hagen @ 2001-03-10 13:24 UTC (permalink / raw)
  Cc: ntg-context

At 01:01 PM 3/9/01 +0100, Han The Thanh wrote:
>Hi Hans,

>My need is quite simple, however I couldn't figure out how to achieve it in
>context. I want to use several separate font families in a single document
>(one for the body text, one for the footnote text and one for a few special
>characters that appear in the document).

% interface=en output=pdftex

% first we define a new main font style 

\definefontstyle[footfonts,ff] [ff]

% then we define a (here quite simple) body font set that belongs to this
style

\definebodyfont[10pt,11pt,12pt] [ff] [tf=lbr sa 1]

% you want footnotes to use this style 

\setupfootnotes[bodyfont=footfonts]

% so let's test it: 

\starttext 

test test \footnote {test test} test test

\stoptext

% you have the lbr's i guess, but using more verbose names is better  

Hans

-------------------------------------------------------------------------
                                  Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                      Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


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

end of thread, other threads:[~2001-03-10 13:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20010308150340.A8765@anxur.fi.muni.cz>
2001-03-08 14:44 ` call for help with context Hans Hagen
2001-03-08 15:16   ` Han The Thanh
2001-03-08 15:54     ` Berend de Boer
2001-03-08 16:36       ` Hans Hagen
     [not found]       ` <20010309130110.A2783@anxur.fi.muni.cz>
2001-03-10 13:24         ` Hans Hagen
2001-03-08 16:34     ` Hans Hagen
2001-03-09  9:34       ` Han The Thanh
2001-03-10 13:18         ` Hans Hagen
2001-03-08 17:48   ` Re[2]: " Giuseppe Bilotta

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