Re: [NTG-context] orphan headline

2016-05-26 Thread Wolfgang Schuster

Andrea Valle 
26. Mai 2016 um 10:56
Dear all,

I’m finishing a book, and getting the following undesired result.
Many times I have section or subsection title at the bottom of a page, 
with no text. Text starts on the next page.

I have looked at

http://wiki.contextgarden.net/Widows_and_orphans_control

but I wasn’t able to solve.

I guess it could depend on the formatting of my headlines. Here they are:

\setuphead[section]
[style=\ss\tfa, 
before={\blank[0.5cm]\startframedtext[offset=0.25cm,framecolor=black,
rulethickness=0.01cm, frame=off, topframe=off, 
 bottomframe=on]\crlf},after={\stopframedtext\noindentation\blank[1cm]}]


\setuphead[subsection]
[style=\ss, 
before={\blank[0.5cm]\startframedtext[offset=0.25cm,framecolor=black,
rulethickness=0.01cm, frame=off, topframe=off, 
 bottomframe=on]\crlf},after={\stopframedtext\noindentation\blank[1cm]}]

Your lack of a working minimal example makes it hard to give a solution
but adding changing the way how the frame is added should improve things.

\startsetups[section:andrea]
\ifconditional\headshownumber
\scratchdimenone\dimexpr\headnumberwidth+\headnumberdistance\relax
\scratchdimentwo\dimexpr\headnumberdistance\relax
\else
\scratchdimenone\zeropoint
\scratchdimentwo\zeropoint
\fi

\startframedtext[offset=0.25cm,loffset=\scratchdimenone,rulethickness=0.01cm,frame=off,bottomframe=on]

\dontleavehmode\llap{\headnumbercontent\hskip\scratchdimentwo}
\headtextcontent
\stopframedtext
\stopsetups

\defineheadalternative[section:andrea][alternative=vertical,renderingsetup=section:andrea]

\setuphead
  [section]
  [alternative=section:andrea,
   numberwidth=1em,
before={\blank[0.5cm]},
 after={\blank[1cm]}]

\starttext

\section{\input ward }

\subject{\input ward }

\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] orphan headline

2016-05-26 Thread Pablo Rodriguez
On 05/26/2016 05:45 PM, Andrea Valle wrote:
> Thanks a lot Pablo,
> 
>> On 26 May 2016, at 17:40, Pablo Rodriguez wrote:
>>
>> On 05/26/2016 10:56 AM, Andrea Valle wrote:
>> you may replace \blank[1cm] with \blank[samepage,1cm].
>>
>> This should move the heading to the next page.
> 
> alas, it does not, seems ineffective

In a much simpler case, it seems to work:

\setuphead[section]
[style=\ss\tfa, after={\hrule\blank[samepage,big]}]
%~ [style=\ss\tfa, after={\hrule\blank[big]}]

\setuphead[subsection]
[style=\ss, after={\hrule\blank[samepage,medium]}]
%~ [style=\ss, after={\hrule\blank[medium]}]

\starttext
\dorecurse{10}{\section{Section}
\input knuth
\subsection{Subsection}
\input zapf}
\stoptext

Do you really need headings to be inside framed texts?


Pablo
-- 
http://www.ousia.tk
___
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] Underbar offset

2016-05-26 Thread Mojca Miklavec
On 26 May 2016 at 18:17, Hans Hagen wrote:
> On 5/26/2016 2:48 PM, Mojca Miklavec wrote:
>>
>> Nevertheless this doesn't entirely solve the problem. I now have a
>> problem with the following:
>>
>> \catcode`č=\active
>> \defč{\buildtextaccent\textcaron c}
>
>
> doesn't the compose=yes feature work?

I'm sorry, compose=yes works as expected (I was copy pasting some old
code and forgot about the later improvements in ConTeXt: shame on me).

> so let's give you another piece
>
> \startluacode
> fonts.handlers.otf.addfeature {
> name = "mojca",
> type = "multiple",
> prepend = true,
> data = {
> ["č"] = { 0x30C, "c" },
> }
> }
> fonts.handlers.otf.addfeature {
> name = "kern",
> type = "pair",
> data = {
> [0x30C] = { c = { { 500, 0, 0, 0 }, false } },
> }
> }
> \stopluacode
>
> \definefontfeature[default][default][mojca=yes]
>
> \showframe
>
> \starttext
>
> mojča miklave\utfchar{"30C}c
>
> \stoptext
>
> (actually it uncovered a buglet but i suppose the č never is the first char
> so ...)

But the code above doesn't seem to work (I don't get the letter "č"
printed out at all). I would prefer the approach with more fine-tuning
though because "č" is always misaligned. And I seem to remember that
this functionality has been in the core for a long time already, I
just again forgot about it because most fonts include the full charset
nowadays.

Mojca
___
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] Underbar offset

2016-05-26 Thread Hans Hagen

On 5/26/2016 2:48 PM, Mojca Miklavec wrote:

On 25 May 2016 at 17:35, Wolfgang Schuster wrote:


With \shiftup the line under the raised text stays at the same position.

\starttext
\underbar{Test this \shiftup{®}}
\stoptext


When has \shiftup been implemented?

It doesn't work in TeX Live (or maybe I forgot to update TL to the
latest version), but works with the latest version of ConTeXt.


it has always been there but recently i saw that when i had updated some 
low level stuff (to new luatex) i had forgotten something, so i fixed that



Nevertheless this doesn't entirely solve the problem. I now have a
problem with the following:

\catcode`č=\active
\defč{\buildtextaccent\textcaron c}


doesn't the compose=yes feature work?


\underbar{Test this č}

I will try to remember how to fix the font on the fly with lua (or
perhaps figure out how to edit the font; it's a commercial font
though, so fixing it "on the fly" would probably be better).

I will also test some other piece of code that Hans sent me off-list.
(I seem to remember that there must be some tens of ways to underline
text. Every now and then Hans sends a new demo.)


so let's give you another piece

\startluacode
fonts.handlers.otf.addfeature {
name = "mojca",
type = "multiple",
prepend = true,
data = {
["č"] = { 0x30C, "c" },
}
}
fonts.handlers.otf.addfeature {
name = "kern",
type = "pair",
data = {
[0x30C] = { c = { { 500, 0, 0, 0 }, false } },
}
}
\stopluacode

\definefontfeature[default][default][mojca=yes]

\showframe

\starttext

mojča miklave\utfchar{"30C}c

\stoptext

(actually it uncovered a buglet but i suppose the č never is the first 
char so ...)


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | 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
___

Re: [NTG-context] orphan headline

2016-05-26 Thread Andrea Valle
Thanks a lot Pablo,


> On 26 May 2016, at 17:40, Pablo Rodriguez  wrote:
> 
> On 05/26/2016 10:56 AM, Andrea Valle wrote:
> you may replace \blank[1cm] with \blank[samepage,1cm].
> 
> This should move the heading to the next page.

alas, it does not, seems ineffective

Best


-a-

--
Andrea Valle
--
CIRMA - StudiUm
Università degli Studi di Torino
--> http://www.cirma.unito.it/andrea/
--> http://www.fonurgia.unito.it/andrea/
--> http://www.flickr.com/photos/vanderaalle/sets/
--> http://vimeo.com/vanderaalle
--> andrea.va...@unito.it
--

"This is a very complicated case, Maude. You know, a lotta ins, a lotta outs, a 
lotta what-have-yous." 
(Jeffrey 'The Dude' Lebowski)___
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] orphan headline

2016-05-26 Thread Pablo Rodriguez
On 05/26/2016 10:56 AM, Andrea Valle wrote:
> Dear all, 
> 
> I’m finishing a book, and getting the following undesired result.
> Many times I have section or subsection title at the bottom of a page,
> with no text. Text starts on the next page.
> I have looked at 
> 
> http://wiki.contextgarden.net/Widows_and_orphans_control
> 
> but I wasn’t able to solve.
> 
> I guess it could depend on the formatting of my headlines. Here they are: 
> 
> \setuphead[section]
> [style=\ss\tfa,
> before={\blank[0.5cm]\startframedtext[offset=0.25cm,framecolor=black,
> rulethickness=0.01cm, frame=off, topframe=off,
>  bottomframe=on]\crlf},after={\stopframedtext\noindentation\blank[1cm]}]
> 
> \setuphead[subsection]
> [style=\ss,
> before={\blank[0.5cm]\startframedtext[offset=0.25cm,framecolor=black,
> rulethickness=0.01cm, frame=off, topframe=off,
>  bottomframe=on]\crlf},after={\stopframedtext\noindentation\blank[1cm]}]

Hi Andrea,

you may replace \blank[1cm] with \blank[samepage,1cm].

This should move the heading to the next page.

Just in case it helps,

Pablo
-- 
http://www.ousia.tk
___
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] Underbar offset

2016-05-26 Thread Aditya Mahajan

On Thu, 26 May 2016, Mojca Miklavec wrote:


   \catcode`č=\active
   \defč{\buildtextaccent\textcaron c}


Instead of creating an active character, does this work:

\definefontfeature
  [default]
  [default]
  [compose=yes]

Aditya___
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] Underbar offset

2016-05-26 Thread Marco Patzer
On Thu, 26 May 2016 14:48:00 +0200
Mojca Miklavec  wrote:

> On 25 May 2016 at 17:35, Wolfgang Schuster wrote:
> >
> > With \shiftup the line under the raised text stays at the same
> > position.
> >
> > \starttext
> > \underbar{Test this \shiftup{®}}
> > \stoptext  
> 
> When has \shiftup been implemented?

The git history first mentions it on 2015.12.22. I didn't know that
command, either.

Marco
___
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] Underbar offset

2016-05-26 Thread Mojca Miklavec
On 25 May 2016 at 17:35, Wolfgang Schuster wrote:
>
> With \shiftup the line under the raised text stays at the same position.
>
> \starttext
> \underbar{Test this \shiftup{®}}
> \stoptext

When has \shiftup been implemented?

It doesn't work in TeX Live (or maybe I forgot to update TL to the
latest version), but works with the latest version of ConTeXt.

Nevertheless this doesn't entirely solve the problem. I now have a
problem with the following:

\catcode`č=\active
\defč{\buildtextaccent\textcaron c}

\underbar{Test this č}

I will try to remember how to fix the font on the fly with lua (or
perhaps figure out how to edit the font; it's a commercial font
though, so fixing it "on the fly" would probably be better).

I will also test some other piece of code that Hans sent me off-list.
(I seem to remember that there must be some tens of ways to underline
text. Every now and then Hans sends a new demo.)

Mojca
___
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] orphan headline

2016-05-26 Thread Andrea Valle
Dear all, 

I’m finishing a book, and getting the following undesired result.
Many times I have section or subsection title at the bottom of a page, with no 
text. Text starts on the next page.
I have looked at 

http://wiki.contextgarden.net/Widows_and_orphans_control

but I wasn’t able to solve.

I guess it could depend on the formatting of my headlines. Here they are: 

\setuphead[section]
[style=\ss\tfa, 
before={\blank[0.5cm]\startframedtext[offset=0.25cm,framecolor=black,
rulethickness=0.01cm, frame=off, topframe=off,  
bottomframe=on]\crlf},after={\stopframedtext\noindentation\blank[1cm]}]

\setuphead[subsection]
[style=\ss, 
before={\blank[0.5cm]\startframedtext[offset=0.25cm,framecolor=black,
rulethickness=0.01cm, frame=off, topframe=off,  
bottomframe=on]\crlf},after={\stopframedtext\noindentation\blank[1cm]}]

thanks 

Best

-a-

--
Andrea Valle
--
CIRMA - StudiUm
Università degli Studi di Torino
--> http://www.cirma.unito.it/andrea/
--> http://www.fonurgia.unito.it/andrea/
--> http://www.flickr.com/photos/vanderaalle/sets/
--> http://vimeo.com/vanderaalle
--> andrea.va...@unito.it
--

"This is a very complicated case, Maude. You know, a lotta ins, a lotta outs, a 
lotta what-have-yous." 
(Jeffrey 'The Dude' Lebowski)



--
Andrea Valle
--
CIRMA - StudiUm
Università degli Studi di Torino
--> http://www.cirma.unito.it/andrea/
--> http://www.fonurgia.unito.it/andrea/
--> http://www.flickr.com/photos/vanderaalle/sets/
--> http://vimeo.com/vanderaalle
--> andrea.va...@unito.it
--

"This is a very complicated case, Maude. You know, a lotta ins, a lotta outs, a 
lotta what-have-yous." 
(Jeffrey 'The Dude' Lebowski)

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