ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* bug with active :!;?
@ 2005-08-26 10:01 Olivier
  2005-08-29 10:50 ` Hans Hagen Outside
  0 siblings, 1 reply; 13+ messages in thread
From: Olivier @ 2005-08-26 10:01 UTC (permalink / raw)


Hi,

Seems like the following crashes conTeXt:

 \useencoding [ffr] 
 \mainlanguage[fr]

 \setupheadertexts[text][][][\setups{run:left}][]
 \startsetups run:left
         nothing
 \stopsetups

 \starttext
        Nothing special here
 \stoptext

Of course one can live with this by renaming the tag.
However, the bug will also occur in the 
  \cite[Bob:A,Bob:B]
commands from the bib module, and I assume in anything that deals with
csnameS containing active colons...

Strangely enough, the bug doesn't seem to occur in
  \placeformula[eq:A]

Many thanks for hinting a fix,
Olivier

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

* Re: bug with active :!;?
  2005-08-26 10:01 bug with active :!;? Olivier
@ 2005-08-29 10:50 ` Hans Hagen Outside
  2005-08-29 13:20   ` BILLET Olivier
  0 siblings, 1 reply; 13+ messages in thread
From: Hans Hagen Outside @ 2005-08-29 10:50 UTC (permalink / raw)


Olivier wrote:

>Hi,
>
>Seems like the following crashes conTeXt:
>
>  
>
see patch below

>Strangely enough, the bug doesn't seem to occur in
>  \placeformula[eq:A]
>  
>
references get their labels cleaned up

>Many thanks for hinting a fix,
>  
>
\unprotect

\def\dopreventmode[#1]%
  {\protect
   \cleanuplabel{#1}%
   \rawprocesscommalist[\cleanlabel]\dodopreventmode}

\def\doenablemode[#1]%
  {\protect
   \cleanuplabel{#1}%
   \rawprocesscommalist[\cleanlabel]\dodoenablemode }

\def\dodisablemode[#1]%
  {\protect
   \cleanuplabel{#1}%
   \rawprocesscommalist[\cleanlabel]\dododisablemode}

\def\docheckformode#1#2#3% will be sped up with a quit
  {\cleanuplabel{#3}%
   \protect
   \checkedmodefalse
   \rawprocesscommacommand[\cleanlabel]\dodocheckformode
   \ifcheckedmode\@EA#1\else\@EA#2\fi}

\def\docheckforallmodes#1#2#3% will be sped up with a quit
  {\cleanuplabel{#3}%
   \protect
   \checkedmodetrue
   \rawprocesscommacommand[\cleanlabel]\dodocheckforallmodes
   \ifcheckedmode\@EA#1\else\@EA#2\fi}

\long\def\dodostartsetups#1#2#3% watch out: not \grabuntil
  {\cleanuplabel{\??su#2:#3}%
   \dograbuntil#1{\egroup\dodoglobal\long\setvalue\cleanlabel}} 

\def\dosetupsA#1%
  {\cleanuplabel{#1}%
   \processcommacommand[\cleanlabel]\dosetups}

\def\dosetupsB[#1]%
 {\cleanuplabel{#1}%
  \processcommacommand[\cleanlabel]\dosetups}

\def\dosetupsC[#1]%
  {\cleanuplabel{#1}%
   \dosetups\cleanlabel}

\protect

\useencoding [ffr] \mainlanguage[fr]

\setupheadertexts[text][\setups{run:left}]

\startsetups run:left
    nothing
\stopsetups

\starttext
    Nothing special here
\stoptext

\endinput

With the next pdftex we will not need this active mess any more since pre-char spacing will be supported natively; by that time we need to adapt the ffr files 

Hans 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

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

* Re: bug with active :!;?
  2005-08-29 10:50 ` Hans Hagen Outside
@ 2005-08-29 13:20   ` BILLET Olivier
  2005-08-29 13:40     ` Hans Hagen
  2005-08-31  7:38     ` Hans Hagen
  0 siblings, 2 replies; 13+ messages in thread
From: BILLET Olivier @ 2005-08-29 13:20 UTC (permalink / raw)


Quoting  "Hans Hagen Outside" :
> -- was pragma@wxs.nl on Aug 29, 2005 at 06:50:51PM --

> With the next pdftex we will not need this active mess any more since 
> pre-char spacing will be supported natively; by that time we need to adapt 
> the ffr files 
This is a good news indeed. 
By the way, does this include the possibility to treat the character in
different ways depending on the current mode (math/text)?
Because, in the current setting, if you request for 3cm before `:' and
then define a mathematical function $f : R \to Z$ you'll end up with a
huuuge space between f and : which you certainly isn't what you want.

Thanks for your answer,
Olivier


PS:  Also the default definition in useencoding is .25em for :;?!
I'm no typographical expert at all but I thought the standard is
indeed .25em for ;?! but a normal space before `:'

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

* Re: bug with active :!;?
  2005-08-29 13:20   ` BILLET Olivier
@ 2005-08-29 13:40     ` Hans Hagen
  2005-08-31  7:38     ` Hans Hagen
  1 sibling, 0 replies; 13+ messages in thread
From: Hans Hagen @ 2005-08-29 13:40 UTC (permalink / raw)


BILLET Olivier wrote:

>
>This is a good news indeed. 
>By the way, does this include the possibility to treat the character in
>different ways depending on the current mode (math/text)?
>Because, in the current setting, if you request for 3cm before `:' and
>then define a mathematical function $f : R \to Z$ you'll end up with a
>huuuge space between f and : which you certainly isn't what you want.
>  
>
remind me in a few days; it's easy to fix with some extra's in \everymath 

Hans 


-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

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

* Re: bug with active :!;?
  2005-08-29 13:20   ` BILLET Olivier
  2005-08-29 13:40     ` Hans Hagen
@ 2005-08-31  7:38     ` Hans Hagen
  2005-08-31  8:19       ` Taco Hoekwater
  2005-08-31  8:55       ` Setting header texts Jilani Khaldi
  1 sibling, 2 replies; 13+ messages in thread
From: Hans Hagen @ 2005-08-31  7:38 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 916 bytes --]

BILLET Olivier wrote:

>By the way, does this include the possibility to treat the character in
>different ways depending on the current mode (math/text)?
>Because, in the current setting, if you request for 3cm before `:' and
>then define a mathematical function $f : R \to Z$ you'll end up with a
>huuuge space between f and : which you certainly isn't what you want.
>  
>
see attached file; taco may know other tricks (i remember that there is some mechanism in tex for active char treatment in math mode) 

Hans 


-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------


[-- Attachment #2: enco-ffr.tex --]
[-- Type: application/x-tex, Size: 1166 bytes --]

[-- Attachment #3: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

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

* Re: bug with active :!;?
  2005-08-31  7:38     ` Hans Hagen
@ 2005-08-31  8:19       ` Taco Hoekwater
  2005-08-31  8:55       ` Setting header texts Jilani Khaldi
  1 sibling, 0 replies; 13+ messages in thread
From: Taco Hoekwater @ 2005-08-31  8:19 UTC (permalink / raw)
  Cc: mailing list for ConTeXt users

Hans Hagen wrote:
> BILLET Olivier wrote:
> 
>> By the way, does this include the possibility to treat the character in
>> different ways depending on the current mode (math/text)?
>> Because, in the current setting, if you request for 3cm before `:' and
>> then define a mathematical function $f : R \to Z$ you'll end up with a
>> huuuge space between f and : which you certainly isn't what you want.
>>  
>>
> see attached file; taco may know other tricks (i remember that there is 
> some mechanism in tex for active char treatment in math mode)

It is possible to treat an arbitrary character as if it was \active
inside math mode, but not the other way around: when a character has
catcode \active, it is always treated as that macro, regardless of
the current mode.

For curious people, here is how you make a "mathmode only" macro:

   \mathcode`\!="8000
   \begingroup
   \catcode`\!=13
   \gdef!{\it math}
   \endgroup
   This is a $!$ test!.

Cheers, Taco

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

* Setting header texts
  2005-08-31  7:38     ` Hans Hagen
  2005-08-31  8:19       ` Taco Hoekwater
@ 2005-08-31  8:55       ` Jilani Khaldi
  2005-08-31  9:05         ` Setting header texts (second) Jilani Khaldi
  1 sibling, 1 reply; 13+ messages in thread
From: Jilani Khaldi @ 2005-08-31  8:55 UTC (permalink / raw)


Hi All,

Having set this header text:

\setupheadertexts
[\vbox{\hbox{AAA}}
\hbox{BBB}}}]
[{CCC}]

the result is:
AAA in the top left corner,
BBB just under AAA
CCC in the top right corner
with the page number in the center

What I want to have is:
1. AAA in the top left corner,
2. BBB just under AAA
(and that's ok)

3. CCC in the top right corner but containing the page number
4. Just below all this a long line to separate the page header from its 
content

I have struggled for a while but in vain, so help!

Thanks.

jk


-- 
// Jilani KHALDI
http://www.archsf.org

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

* Setting header texts (second)
  2005-08-31  8:55       ` Setting header texts Jilani Khaldi
@ 2005-08-31  9:05         ` Jilani Khaldi
  2005-08-31  9:19           ` Hans Hagen
  2005-08-31 15:58           ` Mojca Miklavec
  0 siblings, 2 replies; 13+ messages in thread
From: Jilani Khaldi @ 2005-08-31  9:05 UTC (permalink / raw)


Hi All,

Having set this header text:

\setupheadertexts
[\vbox{\hbox{AAA}}
\hbox{BBB}}}]
[{CCC}]

the result is:
AAA in the top left corner,
BBB just under AAA
CCC in the top right corner
with the page number in the center

What I want to have is:
1. AAA = the title of the chapter
2. BBB = the title of the section
3. CCC in the top right corner but containing the page number
4. Just below all this a long line to separate the page header from its 
content

Thanks.

jk

-- 
// Jilani KHALDI
http://www.archsf.org

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

* Re: Setting header texts (second)
  2005-08-31  9:05         ` Setting header texts (second) Jilani Khaldi
@ 2005-08-31  9:19           ` Hans Hagen
  2005-08-31 11:23             ` Jilani Khaldi
  2005-08-31 15:58           ` Mojca Miklavec
  1 sibling, 1 reply; 13+ messages in thread
From: Hans Hagen @ 2005-08-31  9:19 UTC (permalink / raw)


Jilani Khaldi wrote:

> Hi All,
>
> Having set this header text:
>
> \setupheadertexts
> [\vbox{\hbox{AAA}}
> \hbox{BBB}}}]
> [{CCC}]
>
> the result is:
> AAA in the top left corner,
> BBB just under AAA
> CCC in the top right corner
> with the page number in the center
>
> What I want to have is:
> 1. AAA = the title of the chapter
> 2. BBB = the title of the section

\getmarking{chapter} etc

> 3. CCC in the top right corner but containing the page number

\pagenumber

> 4. Just below all this a long line to separate the page header from 
> its content
>
> Thanks.
>
> jk
>


-- 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

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

* Re: Setting header texts (second)
  2005-08-31  9:19           ` Hans Hagen
@ 2005-08-31 11:23             ` Jilani Khaldi
  0 siblings, 0 replies; 13+ messages in thread
From: Jilani Khaldi @ 2005-08-31 11:23 UTC (permalink / raw)



>> Hi All,
>>
>> Having set this header text:
>>
>> \setupheadertexts
>> [\vbox{\hbox{AAA}}
>> \hbox{BBB}}}]
>> [{CCC}]
>>
>> the result is:
>> AAA in the top left corner,
>> BBB just under AAA
>> CCC in the top right corner
>> with the page number in the center
>>
>> What I want to have is:
>> 1. AAA = the title of the chapter
>> 2. BBB = the title of the section
>
>
> \getmarking{chapter} etc
>
>> 3. CCC in the top right corner but containing the page number
>
>
> \pagenumber
>
>> 4. Just below all this a long line to separate the page header from 
>> its content
>>
I tried to apply the tips but now I have the page number on both the 
center and the right, without having the name of the chapter and the 
section in the left. Could you please be more precise. Where can I find 
info about "\getmarking"?
Thanks.

jk

-- 
// Jilani KHALDI
http://www.archsf.org

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

* Re: Setting header texts (second)
  2005-08-31  9:05         ` Setting header texts (second) Jilani Khaldi
  2005-08-31  9:19           ` Hans Hagen
@ 2005-08-31 15:58           ` Mojca Miklavec
  2005-08-31 21:25             ` Setting a line on the header Jilani Khaldi
  1 sibling, 1 reply; 13+ messages in thread
From: Mojca Miklavec @ 2005-08-31 15:58 UTC (permalink / raw)


Jilani Khaldi wrote:
> Hi All,
> 
> Having set this header text:
> 
> \setupheadertexts
> [\vbox{\hbox{AAA}}
> \hbox{BBB}}}]
> [{CCC}]
> 
> the result is:
> AAA in the top left corner,
> BBB just under AAA
> CCC in the top right corner
> with the page number in the center
> 
> What I want to have is:
> 1. AAA = the title of the chapter
> 2. BBB = the title of the section
> 3. CCC in the top right corner but containing the page number

You already got the answer to this one I guess, just to sum it up:

\setupheadertexts
[{\framed[align=flushleft,frame=off,offset=0pt]{\getmarking[chapter]\crlf\getmarking[section]}}]
[pagenumber] % or empty

% and one of the two commands:
%-----
% this one overwrites the second argument above
%\setuppagenumbering[location={header,right}]
% this one only removes page number from the center
%\setuppagenumbering[location=]

> 4. Just below all this a long line to separate the page header from its
> content

\setupbackgrounds[header][text][frame=off,bottomframe=on]

(You probably have to adjust some parameters in \setuplayout: header
height and distance between header and text.)

Mojca

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

* Re: Setting a line on the header
  2005-08-31 15:58           ` Mojca Miklavec
@ 2005-08-31 21:25             ` Jilani Khaldi
  0 siblings, 0 replies; 13+ messages in thread
From: Jilani Khaldi @ 2005-08-31 21:25 UTC (permalink / raw)



>>4. Just below all this a long line to separate the page header from its
>>content
>>    
>>
>
>\setupbackgrounds[header][text][frame=off,bottomframe=on]
>
>(You probably have to adjust some parameters in \setuplayout: header
>height and distance between header and text.)
>  
>
Thank you. It works, but I have a long line on all the pages. Is it 
possibile to exclude the first page of the document and the first page 
of every chapter using some settings?

jk

-- 
// Jilani KHALDI
http://www.archsf.org

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

* Re: Setting header texts (second)
       [not found] <20050831100002.C30DF12837@ronja.ntg.nl>
@ 2005-08-31 12:54 ` Duncan Hothersall
  0 siblings, 0 replies; 13+ messages in thread
From: Duncan Hothersall @ 2005-08-31 12:54 UTC (permalink / raw)


Hi.

"\getmarking[chapter][current]" should give you the title of the current
chapter. Similarly "\getmarking[section][current]", etc.

In order to rid yourself of the default pagenumber in the middle of the
top header, use "\setuppagenumbering[location=]", or add "location=" to
your existing \setuppagenumbering command.

Hope that helps.

Duncan

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

end of thread, other threads:[~2005-08-31 21:25 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-26 10:01 bug with active :!;? Olivier
2005-08-29 10:50 ` Hans Hagen Outside
2005-08-29 13:20   ` BILLET Olivier
2005-08-29 13:40     ` Hans Hagen
2005-08-31  7:38     ` Hans Hagen
2005-08-31  8:19       ` Taco Hoekwater
2005-08-31  8:55       ` Setting header texts Jilani Khaldi
2005-08-31  9:05         ` Setting header texts (second) Jilani Khaldi
2005-08-31  9:19           ` Hans Hagen
2005-08-31 11:23             ` Jilani Khaldi
2005-08-31 15:58           ` Mojca Miklavec
2005-08-31 21:25             ` Setting a line on the header Jilani Khaldi
     [not found] <20050831100002.C30DF12837@ronja.ntg.nl>
2005-08-31 12:54 ` Setting header texts (second) Duncan Hothersall

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