Re: [NTG-context] Header-Footer-Layout

2012-10-09 Thread Arne Runge

Am 23.09.2012 um 16:07 schrieb Arne Rungearne_runge at gmx.de  
http://www.ntg.nl/mailman/listinfo/ntg-context:

/  Hi,
//
//  I would like to have a doublesided layout with:
//
//  - a titlepage with neither header nor footer,
//  - a frontpart with pagesnumbers(left/right) in roman
//  - a bodypart with pagesnumbers(left/right) in arabic
//  - an appendix with pagesnumbers(left/right) in arabic
//
//  - first page of a chapter should not have a header + underline
//  - next page header(CHAPTER #: chapter) underlined
//  - next page header(section) underlined
//
//  - if there is no section then only the line.
//  - if the next page is empty than only the pagenumber should be printed.
//
//  Seems to be a common layout and I apologize for asking.
//
//  Thanks in advance for any help.
//
//  Regards,
//
//  Arne
/

Put the makeup environment in the front matter environment and remove the 
sectionblock settings.

When you don't want to start chapter at a right page you can add 
\setupsectionblock[page=yes] to your document.

\setuppagenumbering[alternative=doublesided]

\setupheadertexts[]
\setupheadertexts[\setups{text a}][][][\setups{text b}]

\startsetups[text a]
   CHAPTER \getmarking[chapternumber]: \WORD{\getmarking[chapter]}
\stopsetups

\startsetups[text b]
   \getmarking[section]
\stopsetups

\setupheader[text][after=\hrule]

\setuphead[chapter][page={header,right},header=empty]

\setupfootertexts[][pagenumber]

\defineconversionset[frontpart:pagenumber][romannumerals][]

\startsectionblockenvironment[bodypart]
   \setcounter[userpage][1]
\stopsectionblockenvironment

\starttext

\startfrontmatter

\startstandardmakeup[align=middle]
{\tfd TITLE}
\stopstandardmakeup

\completecontent

\stopfrontmatter

\startbodymatter

\chapter{Knuth}

\dorecurse{12}{\input knuth\par}

\stopbodymatter

\startappendices

\chapter{Zapf}

\dorecurse{12}{\input zapf\par}

\stopappendices

\stoptext

Wolfgang

Thank you Wolfgang for the reply. If I compile your code then I get

! Undefined control sequence.
l.20 \defineconversionset
 [frontpart:pagenumber][romannumerals][]

and if I comment this line, I get

! Missing number, treated as zero.

and if I comment   \setcounter[userpage][1]

then
- page 4 has a header line, which I don't like
- page 7 or 11 has not the marking Knuth respectively Zapf
- useless page 13 at the end of the document

I guess that's because I don't use the latest version. I use 
context_2012.05.30.2012061,

TeXExec | version 6.2.1 - 1997-2009 - PRAGMA ADE/POD


I finally came up with the following code, which does it for me.

\setuppagenumbering[alternative=doublesided,location=]

\setupheadertexts[]
\setupheadertexts[\setups{text a}][][][\setups{text b}]

\startsetups[text a]
CHAPTER \getmarking[chapternumber]:
\expanded{\uppercase{\fetchmark[chapter][first]}}
  \stopsetups
\startsetups[text b]
\getmarking[section]
  \stopsetups


\setupfootertexts[][pagenumber]

\setupheader[text][after=\hrule]

\setuphead[chapter][header=empty]

\setupsectionblock[frontpart][
before={\setuppagenumbering[conversion=romannumerals]},
after={\page[yes,header,right]}]
\setupsectionblock[bodypart][after={\page[yes,header,right]}]
\setupsectionblock[appendix][after={\page[yes,header,right]}]
\setupsectionblock[backpart][after={\page[yes,header,right]}]

\starttext

\startfrontmatter
\startstandardmakeup
\title{title}
\stopstandardmakeup
\completecontent
\stopfrontmatter

\startbodymatter
\setuppagenumber[number=1]
\chapter{body}
\dorecurse{10}{\input knuth}

\stopbodymatter

\startappendices
\chapter{appendix}
code
\input knuth
\stopappendices
\page[stop]
\stoptext

Arne



___
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] Misplaced figure

2012-10-09 Thread Rogers, Michael K
Hi,

I wanted to start a proof with Proof: in italics and place a figure next to 
the right margin.  There are many ways to accomplish this, but my normal way, 
{\it Proof:\/}, fails.  Is this a bug or am I making a mistake?

\starttext
\startuseMPgraphic{ProofPQR}
numeric u; u:=2.5cm;
draw ((0, 0)--(1,0)--(1, 0.7)) scaled u withpen pencircle;
dotlabel.bot(textext($P$),(0,0)*u);
dotlabel.bot(textext($R$),(1,0)*u);
dotlabel.rt(textext($Q$),(1,0.7)*u);
\stopuseMPgraphic

% MISPLACED
\placefigure[right,none]{}{\useMPgraphic{ProofPQR}}
{\it Proof:\/}
\input knuth

\hairline
% WORKS
\placefigure[right,none]{}{\useMPgraphic{ProofPQR}}
%{\it Proof:\/}
\input knuth

\hairline
% WORKS
\placefigure[right,none]{}{\useMPgraphic{ProofPQR}}
\strut{\it Proof:\/}
\input knuth
\stoptext

Thanks,

Michael



This e-mail message (including any attachments) is for the sole use of
the intended recipient(s) and may contain confidential and privileged
information. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, distribution
or copying of this message (including any attachments) is strictly
prohibited.

If you have received this message in error, please contact
the sender by reply e-mail message and destroy all copies of the
original message (including attachments).
___
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] Misplaced figure

2012-10-09 Thread Wolfgang Schuster

Am 09.10.2012 um 13:47 schrieb Rogers, Michael K mrog...@emory.edu:

 Hi,
 
 I wanted to start a proof with Proof: in italics and place a figure next to 
 the right margin.  There are many ways to accomplish this, but my normal way, 
 {\it Proof:\/}, fails.  Is this a bug or am I making a mistake?
 
 \starttext
 \startuseMPgraphic{ProofPQR}
 numeric u; u:=2.5cm;
 draw ((0, 0)--(1,0)--(1, 0.7)) scaled u withpen pencircle;
 dotlabel.bot(textext($P$),(0,0)*u);
 dotlabel.bot(textext($R$),(1,0)*u);
 dotlabel.rt(textext($Q$),(1,0.7)*u);
 \stopuseMPgraphic
 
 % MISPLACED
 \placefigure[right,none]{}{\useMPgraphic{ProofPQR}}
 {\it Proof:\/}
 \input knuth
 
 \hairline
 % WORKS
 \placefigure[right,none]{}{\useMPgraphic{ProofPQR}}
 %{\it Proof:\/}
 \input knuth
 
 \hairline
 % WORKS
 \placefigure[right,none]{}{\useMPgraphic{ProofPQR}}
 \strut{\it Proof:\/}
 \input knuth
 \stoptext

That’s a common problem when you use a font switch at the begin of a paragraph,
you can avoid this when you force horizontal mode with \dontleavehmode or \strut
before the begin of the group. You can avoid this also when you use \italic{…} 
etc.
instead of {\it …} but the best solution in your example is to create a proof
environment  which prints “Proof: ” as title for the environment.

\defineenumeration
  [proof]
  [text=Proof:,
   headstyle=italic,
   number=no,
   alternative=serried,
   width=fit,
   distance=.5em]

\startuseMPgraphic{ProofPQR}
numeric u; u:=2.5cm;
draw ((0, 0)--(1,0)--(1, 0.7)) scaled u withpen pencircle;
dotlabel.bot(textext($P$),(0,0)*u);
dotlabel.bot(textext($R$),(1,0)*u);
dotlabel.rt(textext($Q$),(1,0.7)*u);
\stopuseMPgraphic

\starttext

\placefigure[right,none]{}{\useMPgraphic{ProofPQR}}
\startproof
\input knuth
\stopproof

\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] \unit and french

2012-10-09 Thread Wolfgang Schuster

Am 09.10.2012 um 21:04 schrieb Romain Diss romain.d...@yahoo.fr:

 Hi all,
 
 As you know, the french number format is almost opposite to the english one: 
 period and comma have opposite roles.
 
 My question concerns the way to render properly numbers in french with the 
 \unit command. I already tried different combinations of 
 \setupunit[method=,order=] but I can’t find the right way. I tried even to 
 type french or english format as input for \unit but none output is right 
 (actually I'd prefer to type french format as \unit input).
 Also, when there are three digits separators on both sides of the decimal 
 point, some method outputs are not consistent.
 
 I attached a not so minimal exemple.
 
 Thanks for any idea to solve this.

Can you explain which numbers this should represent:

\m{12\,345,567\,89}~kg
\m{345,567\,89}~kg

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] \unit and french

2012-10-09 Thread Wolfgang Schuster

Am 09.10.2012 um 22:01 schrieb Wolfgang Schuster wolfgang.schus...@gmail.com:

 
 Am 09.10.2012 um 21:04 schrieb Romain Diss romain.d...@yahoo.fr:
 
 Hi all,
 
 As you know, the french number format is almost opposite to the english one: 
 period and comma have opposite roles.
 
 My question concerns the way to render properly numbers in french with the 
 \unit command. I already tried different combinations of 
 \setupunit[method=,order=] but I can’t find the right way. I tried even to 
 type french or english format as input for \unit but none output is right 
 (actually I'd prefer to type french format as \unit input).
 Also, when there are three digits separators on both sides of the decimal 
 point, some method outputs are not consistent.
 
 I attached a not so minimal exemple.
 
 Thanks for any idea to solve this.
 
 Can you explain which numbers this should represent:
 
 \m{12\,345,567\,89}~kg
 \m{345,567\,89}~kg

For get about this but you can try what happens when you don’t add a separator
between the number groups in the decimal parts.

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] \unit and french

2012-10-09 Thread Marco Patzer
2012-10-09 Wolfgang Schuster:

 Can you explain which numbers this should represent:
 
 \m{12\,345,567\,89}~kg

12345.56789 kg

 \m{345,567\,89}~kg

345.56789 kg


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] \unit and french

2012-10-09 Thread Wolfgang Schuster

Am 09.10.2012 um 22:11 schrieb Marco Patzer home...@lavabit.com:

 2012-10-09 Wolfgang Schuster:
 
 Can you explain which numbers this should represent:
 
 \m{12\,345,567\,89}~kg
 
 12345.56789 kg
 
 \m{345,567\,89}~kg
 
 345.56789 kg

Thanks but I realized it myself (I guess I need sleep), The problem is that 
Hans number parser doesn’t check for a separator in the decimal numbers.

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] \unit and french

2012-10-09 Thread Marco Patzer
2012-10-09 Wolfgang Schuster:

 The problem is that Hans number parser doesn’t check for a
 separator in the decimal numbers.

If the unit code is being touched maybe you can address this one as
well:

http://article.gmane.org/gmane.comp.tex.context/78251


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] \unit and french

2012-10-09 Thread Romain Diss
Le mardi 09 octobre 2012, Wolfgang Schuster a écrit :
 Am 09.10.2012 um 22:11 schrieb Marco Patzer home...@lavabit.com:
  2012-10-09 Wolfgang Schuster:
  Can you explain which numbers this should represent:
  
  \m{12\,345,567\,89}~kg
  
  12345.56789 kg
  
  \m{345,567\,89}~kg
  
  345.56789 kg
 
 Thanks but I realized it myself (I guess I need sleep), The problem is that
 Hans number parser doesn’t check for a separator in the decimal numbers.
Thanks for the response.

The minimal example was suppose to test three numbers: one with a separator in 
the integer part (12345.567), one with a separator in the decimal part 
(345.56789) and one in both (12345.56789).

Anyway, if one forget the problem of the separator in the decimal part which 
is not handle, none of the 'method=', 'order=' and 'language=' combinations in 
\setupunit make it possible to render a number in the french format (a comma 
as the decimal separator and a thin space for the three digits separator).

Any idea to get this work?

-- 
Romain Diss
romain.d...@yahoo.fr
___
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] Problem with ConTeXt (MkIV), Hebrew and ligatures

2012-10-09 Thread Simo Ojala

 Am 08.10.2012 um 20:51 schrieb Simo Ojala smsojala at gmail.com:

 On 1-10-2012 19:25, Philipp Gesang wrote:

 
utilities.sequencers.disableaction(resolvers.openers.helpers.textfileactions,characters.filters.utf.collapse)


 Doesn’t work. What helps is to comment out the “appendaction” in
 char-utf.lua or the corresponding table for U0xfb35 in
 char-def.lua. My guess is that this is the case because the .tex
 file is processed *before* you can disable it.

 so we need a directive (as they can be given on the commandline)

 local textfileactions = resolvers.openers.helpers.textfileactions

 directives.register(filters.utf.collapse, function(v)
 utilities.sequencers[v and enableaction or
 disableaction](textfileactions,characters.filters.utf.collapse)
 end)



 Hans

 Sorry to still bother you with this. I just could not get this 
working. Hopefully it is just that I could not figure out right command 
line stuff. (I tried out several different ways.) So could somebody tell 
me how it should be run.


 My guess is something like..

 context --directives=filters.utf.collapse=what_should_i_put_here? 
testcase.tex


 Thanks,

 Simo

 PS: Both Context setups I tried to get this working (Ubuntu PPA and 
standalone) should have had code updated. So that should have not been 
the problem.


 Does it work when you add

   \enabledirectives[filters.utf.collapse]

 at the begin of your document.

 Wolfgang

Did not work for me. However there was discussion that the directive 
should be invoked from command line.


But what left me really wondering this time was following. I tried to 
comment out U0xfb35 table in char-def.lua for proof that this 
solution should work at all. However, for my surprise, it had no effect 
at all. For just in case, I even purged my Ubuntu PPA packaged version 
of ConTeXt to make sure that this modification I made to standalone 
version is really used. No effect. I also checked that my TeX file 
should have the correct characters, not the already combined ones. No 
error in there either.


Unfortunately internals of ConTeXt seems so complex for my level of 
programming skills that this time I could not think of anything more to try.


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