Re: [NTG-context] Chapter numbering - applying several commands at once

2013-11-17 Thread Jan Tosovsky
On 2013-11-17 Wolfgang Schuster wrote:
> Am 17.11.2013 um 20:02 schrieb Jan Tosovsky:
> 
> > in my book I'd like to precede my titles with the number formated as
> > 'CHAPTER I.', e.g. roman numeral and all this small caped and also in
> > bold as the title itself.
> >
> Instead of small capitals for the chapter number you can use capitals
> in combination with a smaller font size.
> 
> \setuplabeltext[en][chapter=Chapter~]
> 
> \setuphead
>   [chapter]
>   [alternative=middle,
>style=\bfc,
>numberstyle={\setcharactercasing[WORD]\kerncharacters[0.125]\bfa},
>numbercommand=\groupedcommand{}{\blank[4mm]},
>sectionstopper={.},
>inbetween={\blank[4mm]},
>conversion=Romannumerals]

I must admit this looks much better! Thanks.

The same approach can be used also for small caps, but the result is not so
appealing. Especially I don't like the size of the 'stopper' (dot).

Btw, that case conversion can be eliminated using
\setuplabeltext[en][chapter=CHAPTER~]

Jan

___
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
___


Re: [NTG-context] ToC - right-alignment of roman numerals

2013-11-17 Thread Jan Tosovsky
On 2013-06-03 Marco Patzer wrote:
> On 2013–06–03 honyk wrote:
> 
> > in fresh MkIV I use the following commands for building ToC, but I
> > have no idea how to align the label (roman numeral) to the right.
> 
> The width setting needs to be applied to the chapter list, not the
> content list, see example
>
> \setuphead[chapter][conversion=Romannumerals]
> \setupheadnumber[chapter][48]
> 
> \setupcombinedlist
>   [content]
>   [alternative=c]
> 
> \setupcombinedlist
>   [chapter]
>   [distance=1em,
>width=1cm,
>numbercommand={\simplealignedbox{\listparameter{width}}{flushright}}
>   ]
> 
> \starttext
> \completecontent
> \chapter{Foo}
> \chapter{Bar}
> \stoptext
> 

Whereas this works for basic test cases, in my document it ends with an error:

structure   > sectioning > title @ level 2 : 0.0 -> \headtext {content}
! Argument of \147>flushright has an extra }.

How can I decode this message and fix the problematic location?

Thanks, Jan

___
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
___

Re: [NTG-context] Chapter numbering - applying several commands at once

2013-11-17 Thread Wolfgang Schuster

Am 17.11.2013 um 20:02 schrieb Jan Tosovsky :

> Dear All,
> 
> in my book I'd like to precede my titles with the number formated as
> 'CHAPTER I.', e.g. roman numeral and all this small caped and also in bold
> as the title itself.
> 
> In the following definition I can use either:
> (1) \sc + \setcharactercasing - small caps + lowercased number (but not
> bold)
> (2) \smallcaps - bold small caps (but not lowercased number)
> (3) \setcharactercasing - lowercased number (but not small caps)
> 
> Idealy I'd like to combine \smallcaps + \setcharactercasing, but this throws
> an error.
> 
> I am also considering using just smaller font, but I am facing similar
> problems as I cannot combine both the casing conversion and e.g. \bfb in
> single \groupedcommand.
> 
> I prefer setting the upercased version of Romannumerals as I do not want
> small roman literals in the TOC or bookmarks. Are there better ways to
> accomplish this?
> 
> \definefontfamily[palatino][rm][Palatino Linotype][features={default,
> quality}]
> \setupbodyfont[palatino]
> 
> \setuplabeltext[en][chapter=chapter~]
> 
> \setuphead[chapter][
> alternative=middle,
> style=\bfc,
> conversion=Romannumerals,
> numbercommand=\groupedcommand{\sc
> \setcharactercasing[word]}{.\blank[0.4cm]},
> ]


Inestead of small capitals for the chapter number you can use capitals in 
combination with a smaller font size.

\setuplabeltext[en][chapter=Chapter~]

\setuphead
  [chapter]
  [alternative=middle,
   style=\bfc,
   numberstyle={\setcharactercasing[WORD]\kerncharacters[0.125]\bfa},
   numbercommand=\groupedcommand{}{\blank[4mm]},
   sectionstopper={.},
   inbetween={\blank[4mm]},
   conversion=Romannumerals]

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
___


[NTG-context] Chapter numbering - applying several commands at once

2013-11-17 Thread Jan Tosovsky
Dear All,

in my book I'd like to precede my titles with the number formated as
'CHAPTER I.', e.g. roman numeral and all this small caped and also in bold
as the title itself.

In the following definition I can use either:
(1) \sc + \setcharactercasing - small caps + lowercased number (but not
bold)
(2) \smallcaps - bold small caps (but not lowercased number)
(3) \setcharactercasing - lowercased number (but not small caps)

Idealy I'd like to combine \smallcaps + \setcharactercasing, but this throws
an error.

I am also considering using just smaller font, but I am facing similar
problems as I cannot combine both the casing conversion and e.g. \bfb in
single \groupedcommand.

I prefer setting the upercased version of Romannumerals as I do not want
small roman literals in the TOC or bookmarks. Are there better ways to
accomplish this?

\definefontfamily[palatino][rm][Palatino Linotype][features={default,
quality}]
\setupbodyfont[palatino]

\setuplabeltext[en][chapter=chapter~]

\setuphead[chapter][
 alternative=middle,
 style=\bfc,
 conversion=Romannumerals,
 numbercommand=\groupedcommand{\sc
\setcharactercasing[word]}{.\blank[0.4cm]},
]

\setupcombinedlist[content][list=chapter, alternative=c]

\starttext
\completecontent
\chapter{Foo}text
\chapter{Bar}text
\stoptext


Thanks, Jan

___
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
___


Re: [NTG-context] Support for Bold Small Caps font alternative

2013-11-17 Thread Wolfgang Schuster

Am 17.11.2013 um 15:33 schrieb honyk :

> Other OTF features needs to be declared though:
> \definefontfeature[f:superscript][sups=yes]
> 
> and then used as written above:
> 25 m{\feature[+][f:superscript]2}
> 
> But it is not so big deal.

When you use this for units you can use the \unit command:

\starttext
\unit{25 square meter}
\stoptext

> I suggest removing all font styles related descriptions in manuals, 
> wiki pages to some special place marked as obsolete and replace it with this 
> simple approach ending with a small note that if this is not applicable, 
> there are other, but deprecated, ways - with the appropriate 
> hyperlink..

Not all font provide small caps as font feature, there is still many (older and 
newer) which use a separate file for them.

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
___


Re: [NTG-context] Support for Bold Small Caps font alternative

2013-11-17 Thread honyk
On 2013-11-17 Wolfgang Schuster wrote: 
> Am 17.11.2013 um 13:23 schrieb honyk:
> > On 2013-11-17 Wolfgang Schuster wrote:
> >> Am 17.11.2013 um 11:04 schrieb honyk:
> >>>
> >>> in my document I combine both regular and bold small caps.
> >>> As there is no predefined alternative for bold small caps variant,
> >>> moreover, combining bold style and small caps has no effect, I've
> >>> had to override an unused one:
> >>>
> >>> \definefontsynonym[SerifCaps][file:pala.ttf][features=small-caps]
> >>>
> >>> \definefontsynonym[SerifBoldSlanted][file:palab.ttf]
> >>> [features=small-caps] % bold caps
> >>>
> >>> Now I can switch styles using \sc and \bs.
> >>>
> >>> It would be nice to have a dedicated alternative for this. Or am I
> >>> missing something?
> >>
> >> When you use a opentype font you can enable the small caps feature
> >> with the \feature command, there is no need for an additional font
> >> synonym.
> >>
> >> \setupbodyfont[pagella]
> >>
> >> \starttext
> >>
> >> Text {\feature[+][f:smallcaps]Text} {\bf Text
> >> {\feature[+][f:smallcaps]Text}}
> >>
> >> Text \smallcaps{Text} \bold{Text \smallcaps{Text}}
> >>
> >> \stoptext
> >
> > Thanks for pointing me to this nice feature! This is even more
> > robust.
> >
> > All my font definitions are based on this example
> > http://wiki.contextgarden.net/Palatino_Linotype_under_MKIV
>  
> You can save a few lines in the font setup when you the new simplefonts
> code (works only with a recent beta).
> 
> \definefontfamily[mainface][rm][Palatino
> Linotype][features={default,quality}]
> 
> \setupbodyfont[mainface]
> 

What a great improvement!

In sum 4 basic + 2 complementary (smallcaps, oldstyle) styles out-of-the-box 
thanks to this simple definition! Moreover, these basic and complementary ones 
can be combined easily.

Other OTF features needs to be declared though:
\definefontfeature[f:superscript][sups=yes]

and then used as written above:
25 m{\feature[+][f:superscript]2}

But it is not so big deal.

I suggest removing all font styles related descriptions in manuals, wiki 
pages to some special place marked as obsolete and replace it with this simple 
approach ending with a small note that if this is not applicable, there are 
other, but deprecated, ways - with the appropriate hyperlink..

Jan

___
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
___


Re: [NTG-context] Support for Bold Small Caps font alternative

2013-11-17 Thread Wolfgang Schuster

Am 17.11.2013 um 13:23 schrieb honyk :

> On 2013-11-17 Wolfgang Schuster wrote: 
>> Am 17.11.2013 um 11:04 schrieb honyk :
>>> 
>>> in my document I combine both regular and bold small caps.
>>> As there is no predefined alternative for bold small caps variant,
>>> moreover, combining bold style and small caps has no effect, I've 
>>> had to override an unused one:
>>> 
>>> \definefontsynonym[SerifCaps][file:pala.ttf][features=small-caps]
>>> \definefontsynonym[SerifBoldSlanted][file:palab.ttf][features=small-
>>> caps] % bold caps
>>> 
>>> Now I can switch styles using \sc and \bs.
>>> 
>>> It would be nice to have a dedicated alternative for this. Or am I
>>> missing something?
>> 
>> When you use a opentype font you can enable the small caps feature 
>> with the \feature command, there is no need for an additional font 
>> synonym.
>> 
>> \setupbodyfont[pagella]
>> 
>> \starttext
>> 
>> Text {\feature[+][f:smallcaps]Text} {\bf Text
>> {\feature[+][f:smallcaps]Text}}
>> 
>> Text \smallcaps{Text} \bold{Text \smallcaps{Text}}
>> 
>> \stoptext
> 
> Thanks for pointing me to this nice feature! This is even more robust. 
> 
> All my font definitions are based on this example 
> http://wiki.contextgarden.net/Palatino_Linotype_under_MKIV


You can save a few lines in the font setup when you the new simplefonts code 
(works only with a recent beta).

\definefontfamily[mainface][rm][Palatino Linotype][features={default,quality}]

\setupbodyfont[mainface]

\setupalign[hanging,hz]

\starttext

How you, O Athenians, have been affected by my accusers, I cannot tell;
but I know that they almost made me forget who I was—so persuasively
did they speak; and yet they have hardly uttered a word of truth.

Ὅτι μὲν ὑμεῖς, ὦ ἄνδρες Ἀθηναῖοι, 
πεπόνθατε ὑπὸ τῶν ἐμῶν κατηγόρων, 
οὐκ οἶδα· ἐγὼ δ' οὖν καὶ αὐτὸς ὑπ' 
αὐτῶν ὀλίγου ἐμαυτοῦ ἐπελαθόμην, 
οὕτω πιθανῶς ἔλεγον. 

\stoptext

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
___

Re: [NTG-context] Support for Bold Small Caps font alternative

2013-11-17 Thread honyk
On 2013-11-17 Wolfgang Schuster wrote: 
> Am 17.11.2013 um 11:04 schrieb honyk :
> >
> > in my document I combine both regular and bold small caps.
> > As there is no predefined alternative for bold small caps variant,
> > moreover, combining bold style and small caps has no effect, I've 
> > had to override an unused one:
> >
> > \definefontsynonym[SerifCaps][file:pala.ttf][features=small-caps]
> > \definefontsynonym[SerifBoldSlanted][file:palab.ttf][features=small-
> > caps] % bold caps
> >
> > Now I can switch styles using \sc and \bs.
> >
> > It would be nice to have a dedicated alternative for this. Or am I
> > missing something?
> 
> When you use a opentype font you can enable the small caps feature 
> with the \feature command, there is no need for an additional font 
> synonym.
> 
> \setupbodyfont[pagella]
> 
> \starttext
> 
> Text {\feature[+][f:smallcaps]Text} {\bf Text
> {\feature[+][f:smallcaps]Text}}
> 
> Text \smallcaps{Text} \bold{Text \smallcaps{Text}}
> 
> \stoptext

Thanks for pointing me to this nice feature! This is even more robust. 

All my font definitions are based on this example 
http://wiki.contextgarden.net/Palatino_Linotype_under_MKIV

(with the help of ConTeXt Reference Manual where I didn't notice something
like this before).

In the light of this all examples on that page could be switched rather to
'feature' based styling to emphasise the power of this feature :-)

Jan

___
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
___


Re: [NTG-context] Palatino patch for the current ConTeXt version

2013-11-17 Thread Hans Hagen

On 11/17/2013 12:23 PM, honyk wrote:

Hello Everyone,

I am trying to fix a Palatino small caps issue using the procedure explained
here:
http://wiki.contextgarden.net/Palatino_Linotype_under_MKIV

That fix seems to be obsolete nowadays and returning errors.

I've changed
fonts.otf.enhancers.patches["^pala"]
to
fonts.handlers.otf.enhancers.patches["^pala"]
which compiles, but it does nothing.

I've also tried this variant, but that 'patch' function is never called even
though I clear my font cache every run:

\startluacode
local fonts= fonts
local otf  = fonts.handlers.otf
local patches  = otf.enhancers.patches
local register = patches.register
local report   = patches.report

function patch (data,filename)
 report("I am here")
 report("processing data %s", table.serialize(data))
end

register("after","prepare glyphs","^pala", patch)
\stopluacode


Any idea?


patches are applied when a font is cached so you need to wipe the cache 
after defining such a patch


there are several ways to apply patches runtime, see *.lfg files (and 
also fonts-mkiv.pdf)


Hans



--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
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
___


[NTG-context] Palatino patch for the current ConTeXt version

2013-11-17 Thread honyk
Hello Everyone,

I am trying to fix a Palatino small caps issue using the procedure explained
here:
http://wiki.contextgarden.net/Palatino_Linotype_under_MKIV

That fix seems to be obsolete nowadays and returning errors. 

I've changed 
fonts.otf.enhancers.patches["^pala"] 
to 
fonts.handlers.otf.enhancers.patches["^pala"]
which compiles, but it does nothing.

I've also tried this variant, but that 'patch' function is never called even
though I clear my font cache every run:

\startluacode
local fonts= fonts
local otf  = fonts.handlers.otf
local patches  = otf.enhancers.patches
local register = patches.register
local report   = patches.report

function patch (data,filename) 
report("I am here")
report("processing data %s", table.serialize(data))
end

register("after","prepare glyphs","^pala", patch)
\stopluacode


Any idea?

Thanks, Jan

___
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
___


Re: [NTG-context] Support for Bold Small Caps font alternative

2013-11-17 Thread Wolfgang Schuster

Am 17.11.2013 um 11:04 schrieb honyk :

> Dear All,
> 
> in my document I combine both regular and bold small caps. As there is no
> predefined alternative for bold small caps variant, moreover, combining bold
> style and small caps has no effect, I've had to override an unused one:
> 
> \definefontsynonym[SerifCaps][file:pala.ttf][features=small-caps]
> \definefontsynonym[SerifBoldSlanted][file:palab.ttf][features=small-caps] %
> bold caps
> 
> Now I can switch styles using \sc and \bs.
> 
> It would be nice to have a dedicated alternative for this. Or am I missing
> something?

When you use a opentype font you can enable the small caps feature with the 
\feature
command, there is no need for an additional font synonym.

\setupbodyfont[pagella]

\starttext

Text {\feature[+][f:smallcaps]Text} {\bf Text {\feature[+][f:smallcaps]Text}}

Text \smallcaps{Text} \bold{Text \smallcaps{Text}}

\stoptext

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
___


[NTG-context] Support for Bold Small Caps font alternative

2013-11-17 Thread honyk
Dear All,

in my document I combine both regular and bold small caps. As there is no
predefined alternative for bold small caps variant, moreover, combining bold
style and small caps has no effect, I've had to override an unused one:

\definefontsynonym[SerifCaps][file:pala.ttf][features=small-caps]
\definefontsynonym[SerifBoldSlanted][file:palab.ttf][features=small-caps] %
bold caps

Now I can switch styles using \sc and \bs.

It would be nice to have a dedicated alternative for this. Or am I missing
something?

Regards, Jan

___
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
___