Re: [NTG-context] Sections in content: macros v text

2020-10-07 Thread Tomas Hala
Thank you, Wolfgang, that's it!

Tomáš

Wed, Oct 07, 2020 ve 05:12:42PM +0200 Wolfgang Schuster napsal(a):
# Tomas Hala schrieb am 05.10.2020 um 20:20:
# >Hi all,
# >
# >the content generated by the MWE below contains
# >1 bb ... 1
# >2 bb ... 1
# >instead of
# >1 aa ... 1
# >2 bb ... 1
# >because the content structure refers to the macro name \name in both 
sections instead of to work with the text.
# >
# >Maybe it was already discussed by I am not able to find any solution how to 
send the text "aa" to the content in this case.
# >
# >Thanks in advance for any hint.
# >
# >Best wishes,
# >
# >Tomáš
# >
# >MWE (TL2020):
# >\starttext
# >\define\name{aa} \startsection[title=\name,list=\name] \stopsection
# >\define\name{bb} \startsection[title=\name,list=\name] \stopsection
# >\completecontent
# >\stoptext
# 
# Variant 1:
# 
# \setuphead[section][expansion=yes]
# 
# \starttext
# 
# \defineexpandable\name{aa}
# 
# \startsection[title=\name,list=\name] \stopsection
# 
# \defineexpandable\name{bb}
# 
# \startsection[title=\name,list=\name] \stopsection
# 
# \completecontent
# 
# \stoptext
# 
# 
# Variant 2:
# 
# \starttext
# 
# \defineexpandable\name{aa}
# 
# \expanded{\startsection[title=\name,list=\name]} \stopsection
# 
# \defineexpandable\name{bb}
# 
# \expanded{\startsection[title=\name,list=\name]} \stopsection
# 
# \completecontent
# 
# \stoptext
# 
# 
# Wolfgang

 Tomáš Hála

Mendelova univerzita, Provozně ekonomická fakulta, ústav informatiky
Zemědělská 1, CZ-613 00 Brno,  tel. +420 545 13 22 28

http://akela.mendelu.cz/~thala
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Sections in content: macros v text

2020-10-07 Thread Wolfgang Schuster

Tomas Hala schrieb am 05.10.2020 um 20:20:

Hi all,

the content generated by the MWE below contains
1 bb ... 1
2 bb ... 1
instead of
1 aa ... 1
2 bb ... 1
because the content structure refers to the macro name \name in both sections 
instead of to work with the text.

Maybe it was already discussed by I am not able to find any solution how to send the text 
"aa" to the content in this case.

Thanks in advance for any hint.

Best wishes,

Tomáš

MWE (TL2020):
\starttext
\define\name{aa} \startsection[title=\name,list=\name] \stopsection
\define\name{bb} \startsection[title=\name,list=\name] \stopsection
\completecontent
\stoptext


Variant 1:

\setuphead[section][expansion=yes]

\starttext

\defineexpandable\name{aa}

\startsection[title=\name,list=\name] \stopsection

\defineexpandable\name{bb}

\startsection[title=\name,list=\name] \stopsection

\completecontent

\stoptext


Variant 2:

\starttext

\defineexpandable\name{aa}

\expanded{\startsection[title=\name,list=\name]} \stopsection

\defineexpandable\name{bb}

\expanded{\startsection[title=\name,list=\name]} \stopsection

\completecontent

\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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Sections in content: macros v text

2020-10-05 Thread Tomas Hala
Hi all,

the content generated by the MWE below contains 
1 bb ... 1
2 bb ... 1
instead of
1 aa ... 1
2 bb ... 1
because the content structure refers to the macro name \name in both sections 
instead of to work with the text.

Maybe it was already discussed by I am not able to find any solution how to 
send the text "aa" to the content in this case.

Thanks in advance for any hint.

Best wishes, 

Tomáš 

MWE (TL2020):
\starttext
\define\name{aa} \startsection[title=\name,list=\name] \stopsection
\define\name{bb} \startsection[title=\name,list=\name] \stopsection
\completecontent
\stoptext

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] sections without numbering

2014-07-25 Thread Wolfgang Schuster

Am 13.07.2014 um 12:06 schrieb Werner Hintze w.hin...@posteo.eu:

 Aha. I see. Two possibilities more. But I forgot another problem. All these 
 solutions give me
 
 »1.2. Kapitel« - »1.2. Kapitel« etc. if it’s the first part. I don’t 
 unterstand the mechanism and so I don’t know where to look for the solution.

Which output do you expect?

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] sections without numbering

2014-07-13 Thread Philipp Gesang
Hello Werner!

···date: 2014-07-12, Saturday···from: Werner Hintze···

 I can’t figure out how to change the chapter heading. More important: 
 I have no idea where to find the needed information. What I want to see 
 is for example:
 
 Kapitel: Blablabla

Several unnumbered structures are predefined.

\setuphead [subject] [before=Kapitel~]
\starttext
  \startsubject [title=foo] \input knuth \stopsubject
\stoptext

If you wish for the styles of the label and the title to match,
you’ll have to assign them manually:

\definealternativestyle [subjectstyle] [\italic \tfd]

\setuphead [subject] [
  style=subjectstyle,
  before=\bgroup \subjectstyle Kapitel~\egroup,
]
\starttext
  \startsubject [title=foo] \input knuth \stopsubject
\stoptext

The reason as to why this isn’t as easy as

\setuplabeltext [chapter=Kapitel]
\setuphead [chapter] [number=no]

is that the section label is treated as part of the number.
Consequently, Context exposes no option to typeset the label
independently. However, it can be made work by passing an
appropriate command that omits the number:

\setuplabeltext [chapter=Kapitel]
\setuphead [chapter] [deepnumbercommand=\gobbleoneargument]

\starttext
  \startchapter [title=foo] \input knuth \stopchapter
\stoptext

 Where can I find these informations?

In the manual [0]. The \title and \subject structurals even made the
second place on the “top ten” ladder of important commands
(cf. section 1.10). The numberless versions also feature
promintently on the wiki [1].

PS  Next time you ask a new question, please open a new thread
with an adequate subject to keep the list tidy.

Best regards,
Philipp

[0] http://wiki.contextgarden.net/ConTeXt_reference_manual
[1] http://wiki.contextgarden.net/Titles#Default



pgpAV8cO5Yz87.pgp
Description: PGP signature
___
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] sections without numbering

2014-07-13 Thread Werner Hintze

Hi Philipp,

I don’t know what happened: I believe I started a new thread with a 
new subject. My mail program makes sometimes strange things…


Anayway. Thanks for your response. In the meantime I found another 
solution:



\starttext

\define[2]\MyChapter {#1.\,Kapitel: #2}
\setuphead [chapter] [command=\MyChapter, page=no]

\startchapter
[title=Die ersten Menschen]
\input knuth
\stopchapter

\startchapter
[title=Mehr von den ersten Menschen]
\input knuth
\stopchapter

\stoptext

But you helped me to unterstand better what happens here.

Thank you and best regards

Werner


***
☞ Werner Hintze  ●  Auerstraße 1  ●  D-10249 Berlin ☜
Fon: +49 (30) 42 73 485 ● Mob: +49 (160) 94 68 76 60
***
On 13 Jul 2014, at 9:03, Philipp Gesang wrote:

Hello Werner!

·

I can’t figure out how to change the chapter heading. More important:
I have no idea where to find the needed information. What I want to see
is for example:

Kapitel: Blablabla

Several unnumbered structures are predefined.

\setuphead [subject] [before=Kapitel~]
\starttext
\startsubject [title=foo] \input knuth \stopsubject
\stoptext

If you wish for the styles of the label and the title to match,
you’ll have to assign them manually:

\definealternativestyle [subjectstyle] [\italic \tfd]

\setuphead [subject] [
style=subjectstyle,
before=\bgroup \subjectstyle Kapitel~\egroup,
]
\starttext
\startsubject [title=foo] \input knuth \stopsubject
\stoptext

The reason as to why this isn’t as easy as

\setuplabeltext [chapter=Kapitel]
\setuphead [chapter] [number=no]

is that the section label is treated as part of the number.
Consequently, Context exposes no option to typeset the label
independently. However, it can be made work by passing an
appropriate command that omits the number:

\setuplabeltext [chapter=Kapitel]
\setuphead [chapter] [deepnumbercommand=\gobbleoneargument]

\starttext
\startchapter [title=foo] \input knuth \stopchapter
\stoptext

Where can I find these informations?

In the manual [0]. The \title and \subject structurals even made the
second place on the “top ten” ladder of important commands
(cf. section 1.10). The numberless versions also feature
promintently on the wiki [1].

PS Next time you ask a new question, please open a new thread
with an adequate subject to keep the list tidy.

Best regards,
Philipp

[0] http://wiki.contextgarden.net/ConTeXt_reference_manual
[1] http://wiki.contextgarden.net/Titles#Default

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___
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] sections without numbering

2014-07-13 Thread Philipp Gesang
···date: 2014-07-13, Sunday···from: Werner Hintze···

 Anayway. Thanks for your response. In the meantime I found another 
 solution:
 
 
   \starttext
 
   \define[2]\MyChapter {#1.\,Kapitel: #2}
   \setuphead [chapter] [command=\MyChapter, page=no]

Yes, that a valid solution as well.

Good luck!
Philipp



pgpne94u5pdEP.pgp
Description: PGP signature
___
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] sections without numbering

2014-07-13 Thread Werner Hintze
Aha. I see. Two possibilities more. But I forgot another problem. All 
these solutions give me


»1.2. Kapitel« - »1.2. Kapitel« etc. if it’s the first part. I 
don’t unterstand the mechanism and so I don’t know where to look for 
the solution.


On 13 Jul 2014, at 11:38, Wolfgang Schuster wrote:

Am 13.07.2014 um 09:23 schrieb Werner Hintze w.hin...@posteo.eu:

Hi Philipp,

I don’t know what happened: I believe I started a new thread with a 
new subject. My mail program makes sometimes strange things…


Anayway. Thanks for your response. In the meantime I found another 
solution:


\starttext

\define[2]\MyChapter {#1.\,Kapitel: #2}
\setuphead [chapter] [command=\MyChapter, page=no]

\setuphead [chapter] [numbercommand=\groupedcommand{}{ 
Kapitel:},page=no,sectionstopper=.]


or

\setuplabeltext[en][chapter={, Kapitel:}]
\setuphead [chapter] [page=no,sectionstopper=.]

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

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

2014-06-01 Thread Hans Hagen

Hi Pablo,

The section breaks are a bit of a headache. In the old mechanism (also 
mkii) we used penalties between different section levels (different 
values so that there is some hierarchy).


In mkiv we have a weighted penalty/glue mechanism which has advantages 
but can also create side effects. The method of a few weeks ago coul 
deal with


\section followed by 100 \subsections

i.e. no text between this. In a strict mechanism you end up with one 
long page fur to all the penalties. So, there was some precaution for 
this. However that didn't work well with content following sections that 
prefers breaks (read: section head followed by e.g. itemize or tabulate).


So, the newer mechanism tries to analyze the page stream which 
(currently) is somewhat tricky. That's why we need to iterate to an 
acceptable solution.


Some of these mkiv mechanisms are already a bit old and could be done 
better using some newer luatex trickery (but i need tome to do that).


It would be nice to have a large test case for this (sort of hard to 
make one as some trial and error is involved). As you already have some, 
best collect them for future reference.


A new beta ...

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
___


Re: [NTG-context] sections

2014-06-01 Thread Rik

On 2014-06-01 07:51, Hans Hagen wrote:

Hi Pablo,

The section breaks are a bit of a headache. In the old mechanism (also 
mkii) we used penalties between different section levels (different 
values so that there is some hierarchy).


In mkiv we have a weighted penalty/glue mechanism which has advantages 
but can also create side effects. The method of a few weeks ago coul 
deal with


\section followed by 100 \subsections

i.e. no text between this. In a strict mechanism you end up with one 
long page fur to all the penalties. So, there was some precaution for 
this. However that didn't work well with content following sections 
that prefers breaks (read: section head followed by e.g. itemize or 
tabulate).


So, the newer mechanism tries to analyze the page stream which 
(currently) is somewhat tricky. That's why we need to iterate to an 
acceptable solution.


Some of these mkiv mechanisms are already a bit old and could be done 
better using some newer luatex trickery (but i need tome to do that).


It would be nice to have a large test case for this (sort of hard to 
make one as some trial and error is involved). As you already have 
some, best collect them for future reference.


A new beta ...

Hans


Hans,

Is this also the cause of problems I noted with heading placed into the 
margin, as in the example below?


   %   Extra whitespace after some marginal section headings
   %
   %   When section heads are set in the margin, the following body
   %   text should start on the same line as the heading. This is
   %   the case with plain text, but not always the case with other
   %   features (floats and enumerations). Wolfgang suggested adding
   %   insidesection={blank[overlay]} to the section heading setup, but
   %   that only helps with enumerations and with tabulate tables that do
   %   not start with an HL (it fails with natural tables as well). And
   %   that success only comes with start/stop sectioning. With traditional
   %   sectioning, there are more failures.
   %
   %
  \setupexternalfigures[location=default]
  \setuphead
[section]
[alternative=text,
 command=\SectionCommand,
 distance=0pt,
 insidesection={\blank[overlay]},
]

  \define[2]\SectionCommand
{\inmargin{#1 -- #2}}

  \setuplayout[backspace=4cm]

  \starttext
  \startchapter[title={Start/Stop sectioning}]
  \startsection[title={Okay with text first}]

  Text here
  \starttabulate
  \FL \NC Knuth \NC \input{knuth} \NC\NR
  \stoptabulate

  \stopsection
  \startsection[title={Okay with itemize}]

  \startitemize
  \item One
  \item Two
  \item Three
  \stopitemize

  \stopsection
  \startsection[title={Okay with tabulate no HL}]

  \starttabulate
  \NC Knuth \NC \input{knuth} \NC\NR
  \stoptabulate

  \page
  \stopsection
  \startsection[title={Fail with tabulate HL}]

  \starttabulate
  \FL \NC Knuth \NC \input{knuth} \NC\NR
  \stoptabulate
  \stopsection
  \startsection[title={Fail with TABLE frame}]

  \bTABLE
  \bTR \bTD Knuth \eTD\bTD \input{knuth} \eTD\eTR
  \eTABLE

  \stopsection
  \startsection[title={Fail with TABLE no frame}]

  \bTABLE[frame=off]
  \bTR \bTD Knuth \eTD\bTD \input{knuth} \eTD\eTR
  \eTABLE

  \page
  \stopsection
  \startsection[title={Fails with figures}]

   \startplacefigure[location=right,reference={fig:2},title={Caption}]
\externalfigure[cow.pdf][width=2cm]
  \stopplacefigure

  \input{tufte}

  \stopsection
  \stopchapter

  \chapter{Traditional sectioning}

  \section{Okay with text first}

  Text here
  \starttabulate
  \FL \NC Knuth \NC \input{knuth} \NC\NR
  \stoptabulate

  \section{Fail with itemize}

  \startitemize
  \item One
  \item Two
  \item Three
  \stopitemize

  \page
  \section{Fail with tabulate no HL}

  \starttabulate
  \NC Knuth \NC \input{knuth} \NC\NR
  \stoptabulate

  \section{Fail with tabulate HL}

  \starttabulate
  \FL \NC Knuth \NC \input{knuth} \NC\NR
  \stoptabulate

  \section{Fail with TABLE frame}

  \bTABLE
  \bTR \bTD Knuth \eTD\bTD \input{knuth} \eTD\eTR
  \eTABLE

  \section{Fail with TABLE no frame}

  \bTABLE[frame=off]
  \bTR \bTD Knuth \eTD\bTD \input{knuth} \eTD\eTR
  \eTABLE

  \page
  \section[title={Fails with figures startstop}]

   \startplacefigure[location=right,reference={fig:2},title={Caption}]

Re: [NTG-context] sections

2014-06-01 Thread Hans Hagen

On 6/1/2014 5:40 PM, Rik wrote:


Is this also the cause of problems I noted with heading placed into the
margin, as in the example below?


no, unrelated, try this:

\setuphead
  [section]
  [after={\strut\blank[-2*line,samepage,disable]},
   command=\SectionCommand,
   distance=0pt]

\define[2]\SectionCommand{\inleft{XX}}


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


Re: [NTG-context] sections

2014-06-01 Thread Pablo Rodriguez
Hi Hans,

many thanks for your explanation and sorry for the trouble.

I created the test case that only contains three issues related to page
breaks.

Many thanks for the new beta, I’m afraid I’m still experiencing issues.

\showframe\showgrid
\setupbodyfont[pagella,15pt]
\starttext
\dorecurse{100}{This is a sentence. }

\startitemize
\dorecurse{3}{\item This is an item.\par}
\stopitemize
\stoptext

Previous beta located two items on the first page. Latest beta locates
only one. But when items are higher than two, the first item disappears
from the first page in the second run.

And my first sample works fine with the new beta, but not with the real
book. I’ll try to get a new sample.

Many thanks for your help again,


Pablo.


On 06/01/2014 01:51 PM, Hans Hagen wrote:
 Hi Pablo,
 
 The section breaks are a bit of a headache. In the old mechanism (also 
 mkii) we used penalties between different section levels (different 
 values so that there is some hierarchy).
 
 In mkiv we have a weighted penalty/glue mechanism which has advantages 
 but can also create side effects. The method of a few weeks ago could 
 deal with
 
 \section followed by 100 \subsections
 
 i.e. no text between this. In a strict mechanism you end up with one 
 long page fur to all the penalties. So, there was some precaution for 
 this. However that didn't work well with content following sections that 
 prefers breaks (read: section head followed by e.g. itemize or tabulate).
 
 So, the newer mechanism tries to analyze the page stream which 
 (currently) is somewhat tricky. That's why we need to iterate to an 
 acceptable solution.
 
 Some of these mkiv mechanisms are already a bit old and could be done 
 better using some newer luatex trickery (but i need tome to do that).
 
 It would be nice to have a large test case for this (sort of hard to 
 make one as some trial and error is involved). As you already have some, 
 best collect them for future reference.
 
 A new beta ...
 
 Hans


-- 
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] sections

2014-06-01 Thread Pablo Rodriguez
Hi Hans,

I found out that the issue I wrote about in my previous message is about
widow and orphan lines.

Here is the sample:

\showframe\showgrid
\setuplayout[setups=*lessstrict]
\startsetups[*lessstrict]
\setup[reset]
\widowpenalty=1
\clubpenalty=1
\stopsetups
\setupbodyfont[pagella,15pt]
\starttext
\chapter{Chapter}
\section{Section}
\dorecurse{103}{\ConTeXt\ is fun! }

\subsection{Subsection}

\ConTeXt\ is fun!
\stoptext

Many thanks for your excellent work,

Pablo



On 06/01/2014 01:51 PM, Hans Hagen wrote:
 Hi Pablo,
 
 The section breaks are a bit of a headache. In the old mechanism (also 
 mkii) we used penalties between different section levels (different 
 values so that there is some hierarchy).
 
 In mkiv we have a weighted penalty/glue mechanism which has advantages 
 but can also create side effects. The method of a few weeks ago coul 
 deal with
 
 \section followed by 100 \subsections
 
 i.e. no text between this. In a strict mechanism you end up with one 
 long page fur to all the penalties. So, there was some precaution for 
 this. However that didn't work well with content following sections that 
 prefers breaks (read: section head followed by e.g. itemize or tabulate).
 
 So, the newer mechanism tries to analyze the page stream which 
 (currently) is somewhat tricky. That's why we need to iterate to an 
 acceptable solution.
 
 Some of these mkiv mechanisms are already a bit old and could be done 
 better using some newer luatex trickery (but i need tome to do that).
 
 It would be nice to have a large test case for this (sort of hard to 
 make one as some trial and error is involved). As you already have some, 
 best collect them for future reference.
 
 A new beta ...
 
 Hans


-- 
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] sections

2014-06-01 Thread Hans Hagen

On 6/1/2014 8:18 PM, Pablo Rodriguez wrote:

Hi Hans,

I found out that the issue I wrote about in my previous message is about
widow and orphan lines.


indeed, when testing setting them to 0 helps (there are more cases when 
such penalties interfere, idem for (ex)hyphenpenalty)


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
___


Re: [NTG-context] Sections numbering in miscellaneous parts of documents (MKIV)

2010-05-18 Thread Wolfgang Schuster

Am 17.05.10 22:12, schrieb Jaroslav Hajtmar:

Is there due

\setupsectionblock
   [backpart]
   [before={\setupuserpagenumber[numberconversion=Romannumerals]}]

\setupsectionblock
   [appendix]
   [before={\setupuserpagenumber[numberconversion=numbers] 
%Characters

 \setupheadertexts[][]
 \setupfootertexts[][]
 }]


I suggest to use sectionblockenvironment for these settings, e.g.

\startsectionblockenvironment[backpart]
\setupusepagenumber[numberconversion=Romannumerals]
\stopsectionblockenvironment

possibility change of section numbering to (for. example) only numbers 
in all parts of documents


\definestructureconversionset[numbers][][numbers]

\setupheads[sectionconversionset=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] Sections numbering in miscellaneous parts of documents (MKIV)

2010-05-18 Thread Jaroslav Hajtmar

Thanx Wolfgang.
It is OK. Is there any possibility continue numbering from previous 
sections?


Is there any manual or informations about this?
I study contextref.pdf and I didnt any info about.

Thanx Jaroslav



Dne 18.5.2010 10:57, Wolfgang Schuster napsal(a):

Am 17.05.10 22:12, schrieb Jaroslav Hajtmar:

Is there due

\setupsectionblock
   [backpart]
   [before={\setupuserpagenumber[numberconversion=Romannumerals]}]

\setupsectionblock
   [appendix]
   [before={\setupuserpagenumber[numberconversion=numbers] 
%Characters

 \setupheadertexts[][]
 \setupfootertexts[][]
 }]


I suggest to use sectionblockenvironment for these settings, e.g.

\startsectionblockenvironment[backpart]
\setupusepagenumber[numberconversion=Romannumerals]
\stopsectionblockenvironment

possibility change of section numbering to (for. example) only 
numbers in all parts of documents


\definestructureconversionset[numbers][][numbers]

\setupheads[sectionconversionset=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] Sections numbering in miscellaneous parts of documents (MKIV)

2010-05-18 Thread Wolfgang Schuster

Am 18.05.10 11:56, schrieb Jaroslav Hajtmar:

Thanx Wolfgang.
It is OK. Is there any possibility continue numbering from previous 
sections?


Is there any manual or informations about this?
I study contextref.pdf and I didnt any info about.


This seems to be not possible in MkIV because a new sectionblock resets 
the counters
for the headers (that's what i can guess from the source) and only Hans 
can help here.


The manual does currently not explain the new MkIV commands for 
numberconversion etc.

and all you can do is to search in the list archive and the wiki.


I made a short example for Hans where the remaining problem is to 
continue the header
numbering in the appendix, i.e. header '1 Three' should be '3 Three' and 
'2 Four'should

be '4 Four'.


\definestructureconversionset[numbers][][numbers]

\setupheads[sectionconversionset=numbers]
\setupuserpagenumber[numberconversionset=numbers]

\starttext

\startbodymatter

\chapter{One}

\chapter{Two}

\stopbodymatter

\startappendices

\chapter{Three}

\chapter{Four}

\stopappendices

\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] Sections numbering in miscellaneous parts of documents (MKIV)

2010-05-17 Thread Jaroslav Hajtmar

Hello,
is there any way to change default setting of style of section numbering 
of miscellaneous parts of documents?


In \startbodymatter  - \stopbodymatter environment is default style of 
numbering :


1. Section 1
2. Section 2

but in \startappendices \stopappendices environment is style of numbering:

A. Section 9
B. Section 10

in \startbackmatter - \stopbackmatter is  without numbering:
Section 14
Section 15


Is there due

\setupsectionblock
   [backpart]
   [before={\setupuserpagenumber[numberconversion=Romannumerals]}]

\setupsectionblock
   [appendix]
   [before={\setupuserpagenumber[numberconversion=numbers] %Characters
 \setupheadertexts[][]
 \setupfootertexts[][]
 }]

possibility change of section numbering to (for. example) only numbers 
in all parts of documents


thanx
Jaroslav

___
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] sections in mkiv

2009-07-18 Thread Mojca Miklavec
Hello,

out of curiosity I have tried the latest current. Is the command
\setupheadnumber[section][6]
now invalid on purpose or is there a simple way to fix it?

One more problem:

\setuphead[section][textstyle=\ss\bfc] % combined with numbercommand=
\setuphead[subsection][style=\ss\bfb]
\starttext
\section{abcdef}
\subsection{abcdef}
\stoptext

Subsection gets typeset with \bfc while in mkii it uses \bfb.

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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] sections in mkiv

2009-07-18 Thread Hans Hagen

Mojca Miklavec wrote:

Hello,

out of curiosity I have tried the latest current. Is the command
\setupheadnumber[section][6]
now invalid on purpose or is there a simple way to fix it?


i dunno, i see the command but never tested if it works (might not be 
adapted to some changes); do you need it urgently?



One more problem:

\setuphead[section][textstyle=\ss\bfc] % combined with numbercommand=
\setuphead[subsection][style=\ss\bfb]
\starttext
\section{abcdef}
\subsection{abcdef}
\stoptext

Subsection gets typeset with \bfc while in mkii it uses \bfb.


hm, needs checking but i think that i changed the default chain a bit 
... this is debatable


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
-
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] sections in mkiv

2009-07-18 Thread Mojca Miklavec
On Sat, Jul 18, 2009 at 11:45, Hans Hagen wrote:
 Mojca Miklavec wrote:

 Hello,

 out of curiosity I have tried the latest current. Is the command
    \setupheadnumber[section][6]
 now invalid on purpose or is there a simple way to fix it?

 i dunno, i see the command but never tested if it works (might not be
 adapted to some changes); do you need it urgently?

No, luckily the document works with mkii :)

 One more problem:

 \setuphead[section][textstyle=\ss\bfc] % combined with numbercommand=
 \setuphead[subsection][style=\ss\bfb]
 \starttext
 \section{abcdef}
 \subsection{abcdef}
 \stoptext

 Subsection gets typeset with \bfc while in mkii it uses \bfb.

 hm, needs checking but i think that i changed the default chain a bit ...
 this is debatable

I don't claim that the way I use it is the right one.

This is just my guess why it happens: usually textstyle and style
would exclude one another (no reason why one would use both for the
same section). The problem is that textstyle is inherited from section
to subsection, and then subsection has both style and textstyle and
textstyle takes precedence over style.

A human being would expect the latest settings style= of subsection
to be obeyed, not the inherited conflicting value, though this might
be a bit tricky to change.

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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] sections, subsections, indenting, startnarrower, alignment

2009-05-26 Thread Amaël Broustet
Wouldn't be easier to achieve this using section personalized section
numbering ?

Best,
Amaël  


Le vendredi 22 mai 2009 à 14:40 -0700, afsmith a écrit :
 Hi again ntg-context.
 
 I have been working on my own CV/Resume module. Up until now I've just
 been asking about specific bits of the implementation of this thing I
 want to do, but perhaps that was a mistake as it hasn't really helped
 progress much, so:
 What I am trying to achieve is to define some three-argument command
 to give a section/subject header and a date, and then a block of text.
 The header and date should be on the same line, but aligned in either
 direction (subject aligned left, date aligned right)
 This block of text underneath it should be indented and able to
 include an instance of the same command. Let me try to explain the
 desired output in a little monospaced text diagram..
 
 |(Subject)___(Date)|
 |__(Subsubject)__(Date)|
 |texttexttexttexttexttexttexttext__|
 |textmoretextmoretextmoretexttext__|
 |__(Subsubject)__(Date)|
 |texttexttexttexttexttextexttext___|
 |textmoretextmoretextmoretexttext__|
 
 The subject and subsubject parts don't need to literally use
 \subject , for example I also tried to use \start(description){...
 for this purpose as well but that failed equally. Just something that
 works reasonably as a section header.
 
 I promise I have looked in the archives before asking :) for example
 http://www.mail-archive.com/ntg-context@ntg.nl/msg2.html
 http://www.mail-archive.com/ntg-context@ntg.nl/msg37664.html
 http://www.mail-archive.com/ntg-context@ntg.nl/msg11337.html
 http://www.mail-archive.com/ntg-context@ntg.nl/msg17276.html
 
 And here is an example of something I was playing with...
 
 ---
 \definehead[mysubject][subject]
 
 \defineframed[lrframe][
 width=\localhsize,
 align=normal,
 rulethickness=1pt]
 
 \setuphead[mysubject][style={\bf}]
 \define[3]\CHRONSUBJ
 {\mysubject{\dontleavehmode\lrframe{#1\hfill#2}}
 \startnarrower[left]{#3}\stopnarrower}
 
 \showframe[text]
 \starttext
 \CHRONSUBJ
   {This happened from June 08 to June 09}
   {06/08--06/09}
   {\CHRONSUBJ
 {This happened from June 08 to December 08}
 {06/08--12/08}
 {\input tufte }
   \CHRONSUBJ
 {This happened from January 09 to June 09}
 {01/09--06/09}
 {\input zapf }}
 \stoptext
 ---
 
 -A
 ___
 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  : https://foundry.supelec.fr/projects/contextrev/
 wiki : http://contextgarden.net
 ___

___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] sections, subsections, indenting, startnarrower, alignment

2009-05-26 Thread afsmith
I do not understand what you mean. Could you explain?

I stopped trying to use sections because I read somewhere in the
archives that sections cannot be used 'recursively' like this.
I have instead been trying to use definitions.


With regards to other approaches,  I have been trying to use several
different dimensions to solve this problem  but none of them seem to
work as expected inside the head of a definition inside a narrowed,
such as \localhsize and \makeupwidth, which mangle things in
unexpected ways.

Can anyone tell me however if there is some dimension that corresponds
to the local amount of indentation (made with narrower)?

-A




 Wouldn't be easier to achieve this using section personalized section
 numbering ?

 Best,
 Amaël


 Le vendredi 22 mai 2009 à 14:40 -0700, afsmith a écrit :
  Hi again ntg-context.
 
  I have been working on my own CV/Resume module. Up until now I've just
  been asking about specific bits of the implementation of this thing I
  want to do, but perhaps that was a mistake as it hasn't really helped
  progress much, so:
  What I am trying to achieve is to define some three-argument command
  to give a section/subject header and a date, and then a block of text.
  The header and date should be on the same line, but aligned in either
  direction (subject aligned left, date aligned right)
  This block of text underneath it should be indented and able to
  include an instance of the same command. Let me try to explain the
  desired output in a little monospaced text diagram..
 
  |(Subject)___(Date)|
  |__(Subsubject)__(Date)|
  |texttexttexttexttexttexttexttext__|
  |textmoretextmoretextmoretexttext__|
  |__(Subsubject)__(Date)|
  |texttexttexttexttexttextexttext___|
  |textmoretextmoretextmoretexttext__|
 
  The subject and subsubject parts don't need to literally use
  \subject , for example I also tried to use \start(description){...
  for this purpose as well but that failed equally. Just something that
  works reasonably as a section header.
 
  I promise I have looked in the archives before asking :) for example
  http://www.mail-archive.com/ntg-context@ntg.nl/msg2.html
  http://www.mail-archive.com/ntg-context@ntg.nl/msg37664.html
  http://www.mail-archive.com/ntg-context@ntg.nl/msg11337.html
  http://www.mail-archive.com/ntg-context@ntg.nl/msg17276.html
 
  And here is an example of something I was playing with...
 
  ---
  \definehead[mysubject][subject]
 
  \defineframed[lrframe][
  width=\localhsize,
  align=normal,
  rulethickness=1pt]
 
  \setuphead[mysubject][style={\bf}]
  \define[3]\CHRONSUBJ
  {\mysubject{\dontleavehmode\lrframe{#1\hfill#2}}
  \startnarrower[left]{#3}\stopnarrower}
 
  \showframe[text]
  \starttext
  \CHRONSUBJ
{This happened from June 08 to June 09}
{06/08--06/09}
{\CHRONSUBJ
  {This happened from June 08 to December 08}
  {06/08--12/08}
  {\input tufte }
\CHRONSUBJ
  {This happened from January 09 to June 09}
  {01/09--06/09}
  {\input zapf }}
  \stoptext
  ---
 
  -A
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] sections, subsections, indenting, startnarrower, alignment

2009-05-22 Thread afsmith
Hi again ntg-context.

I have been working on my own CV/Resume module. Up until now I've just
been asking about specific bits of the implementation of this thing I
want to do, but perhaps that was a mistake as it hasn't really helped
progress much, so:
What I am trying to achieve is to define some three-argument command
to give a section/subject header and a date, and then a block of text.
The header and date should be on the same line, but aligned in either
direction (subject aligned left, date aligned right)
This block of text underneath it should be indented and able to
include an instance of the same command. Let me try to explain the
desired output in a little monospaced text diagram..

|(Subject)___(Date)|
|__(Subsubject)__(Date)|
|texttexttexttexttexttexttexttext__|
|textmoretextmoretextmoretexttext__|
|__(Subsubject)__(Date)|
|texttexttexttexttexttextexttext___|
|textmoretextmoretextmoretexttext__|

The subject and subsubject parts don't need to literally use
\subject , for example I also tried to use \start(description){...
for this purpose as well but that failed equally. Just something that
works reasonably as a section header.

I promise I have looked in the archives before asking :) for example
http://www.mail-archive.com/ntg-context@ntg.nl/msg2.html
http://www.mail-archive.com/ntg-context@ntg.nl/msg37664.html
http://www.mail-archive.com/ntg-context@ntg.nl/msg11337.html
http://www.mail-archive.com/ntg-context@ntg.nl/msg17276.html

And here is an example of something I was playing with...

---
\definehead[mysubject][subject]

\defineframed[lrframe][
width=\localhsize,
align=normal,
rulethickness=1pt]

\setuphead[mysubject][style={\bf}]
\define[3]\CHRONSUBJ
{\mysubject{\dontleavehmode\lrframe{#1\hfill#2}}
\startnarrower[left]{#3}\stopnarrower}

\showframe[text]
\starttext
\CHRONSUBJ
  {This happened from June 08 to June 09}
  {06/08--06/09}
  {\CHRONSUBJ
{This happened from June 08 to December 08}
{06/08--12/08}
{\input tufte }
  \CHRONSUBJ
{This happened from January 09 to June 09}
{01/09--06/09}
{\input zapf }}
\stoptext
---

-A
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] sections incompatible colors in mkii/mkiv

2009-02-23 Thread Hans Hagen

Mojca Miklavec wrote:

Hello,

Maybe this is just one incompatibility I need to live with, but maybe
it could be fixed. You can try to compare results in mkii and mkiv.
The text Section is called is desplayed in black in mkii and in red
in mkiv. (It made some of my documents look funny. I can fix it
myself, but maybe there are other consequences as well.)

\setupcolors[state=start]
\def\mycommand#1#2{Section (#1) in called: #2}
\setuphead
[section]
[color=red,
numbercolor=black,
command=\mycommand]
\starttext
\section{First Section}
\stoptext


mkiv is probably ok (we can program more robusy there due to attribute 
usage), just play a bit with


color, textcolor, numbercolor

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
-
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] sections incompatible colors in mkii/mkiv

2009-02-23 Thread Wolfgang Schuster


Am 24.02.2009 um 00:48 schrieb Hans Hagen:


Mojca Miklavec wrote:

Hello,
Maybe this is just one incompatibility I need to live with, but maybe
it could be fixed. You can try to compare results in mkii and mkiv.
The text Section is called is desplayed in black in mkii and in red
in mkiv. (It made some of my documents look funny. I can fix it
myself, but maybe there are other consequences as well.)
\setupcolors[state=start]
\def\mycommand#1#2{Section (#1) in called: #2}
\setuphead
[section]
[color=red,
numbercolor=black,
command=\mycommand]
\starttext
\section{First Section}
\stoptext


mkiv is probably ok (we can program more robusy there due to  
attribute usage), just play a bit with


color, textcolor, numbercolor


The macros in core-sec.mkii and core-sec.mkiv are slightly different
and you moved in the MkIV the color setting before the command key
and affects therefore the complete text while in the MkII part the
color value is only used inside of the number/textcommand.

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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Sections, cross-references and separators

2008-04-01 Thread Taco Hoekwater
Duncan Hothersall wrote:
 What I am aiming for is a style where:
 Parts are labelled A, B, C [done],
 Chapters are labelled A1, A2, A3 [done, but...],
 Cross-references to Chapters call them A1, A2, A3 [not done: I'm 
 getting A.1]
 Figures are labelled A1.1, A1.2 [not done; I'm getting A.11 (eek!)]
 Cross-references to Figures call them A1.1, A1.2 [not done: I'm 
 getting A.11]

In this case it is easier to make the actual chapter number include
the 'A'. That way, you won't have to worry about separator at all
(which is good, because its use is confusing).

Try this:

@@ -1,4 +1,4 @@
-\setupheads[separator=] %-- this can't be right
  \setupreferencing[state=start,chapternumber=yes,global=yes]
-\setupsection[section-1][conversion=Characters]
-\setupsection[section-2][previousnumber=yes]
+\def\Mychapter#1{\convertnumber{Characters}{\getvalue{@@sesection-1}}#1}
+\defineconversion[MyChapter][\Mychapter]
+\setupsection[section-2][conversion=MyChapter]


Question for Hans: is there a nicer way to get at the part number?
The explicit @@se is a bit too low-level for my taste ...

Best wishes,
Taco
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Sections, cross-references and separators

2008-04-01 Thread Duncan Hothersall
Taco wrote:
 In this case it is easier to make the actual chapter number include
 the 'A'. That way, you won't have to worry about separator at all
 (which is good, because its use is confusing).

 Try this:

 @@ -1,4 +1,4 @@
 -\setupheads[separator=] %-- this can't be right
   \setupreferencing[state=start,chapternumber=yes,global=yes]
 -\setupsection[section-1][conversion=Characters]
 -\setupsection[section-2][previousnumber=yes]
 +\def\Mychapter#1{\convertnumber{Characters}{\getvalue{@@sesection-1}}#1}
 +\defineconversion[MyChapter][\Mychapter]
 +\setupsection[section-2][conversion=MyChapter]
   
Ah, thanks so much Taco, never thought of that approach - works like a 
charm. (I also thought that macros with @ in their names could only be 
used in protected mode, so that's two things I have learned for the 
price of one.)

Do you think this is general interest enough to warrant wikifying?

Thanks very much.

Duncan

___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Sections, cross-references and separators

2008-04-01 Thread Taco Hoekwater


Duncan Hothersall wrote:
 Taco wrote:
 In this case it is easier to make the actual chapter number include
 the 'A'. That way, you won't have to worry about separator at all
 (which is good, because its use is confusing).

 Try this:

 @@ -1,4 +1,4 @@
 -\setupheads[separator=] %-- this can't be right
   \setupreferencing[state=start,chapternumber=yes,global=yes]
 -\setupsection[section-1][conversion=Characters]
 -\setupsection[section-2][previousnumber=yes]
 +\def\Mychapter#1{\convertnumber{Characters}{\getvalue{@@sesection-1}}#1}
 +\defineconversion[MyChapter][\Mychapter]
 +\setupsection[section-2][conversion=MyChapter]
   
 Ah, thanks so much Taco, never thought of that approach - works like a 
 charm. (I also thought that macros with @ in their names could only be 
 used in protected mode, so that's two things I have learned for the 
 price of one.)

As far as TeX is concerned, I am not actually using the macro myself,
just mentioning its name. The \getvalue macro then constructs the actual
macro name internally. That works always, but usually macro calls look
funny when used in that way.

I just found  \rawsectionnumber, so with this change it should also work 
(and look less low-level, which is good if you want to wikify it):

   \def\Mychapter#1%
  {\convertnumber{Characters}{\rawsectionnumber{section-1}}#1}

Best wishes,
Taco
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] Sections, cross-references and separators

2008-03-31 Thread Duncan Hothersall
Dear all,

I am confused. Here is a minimal version of my problem:

---
\setupheads[separator=] %-- this can't be right
\setupreferencing[state=start,chapternumber=yes,global=yes]
\setupsection[section-1][conversion=Characters]
\setupsection[section-2][previousnumber=yes]
\setuphead[part][placehead=yes,resetnumber=yes,page=no]
\setuphead[chapter][page=no]
\setuphead[section][number=no]
\setuppagenumbering[partnumber=no]
\starttext
\placelist[part,chapter,section][alternative=b,partnumber=no]
\part[ptest]{Ptest}
\chapter[ctest]{Ctest}
\section[stest]{Stest}
See \in{Chapter}[ctest] (should say A1) and \in{Figure}[ftest] (should 
say A1.1).
\placefigure[here][ftest]{Ftest (should be called A1.1)}{}
\stoptext
---

What I am aiming for is a style where:
Parts are labelled A, B, C [done],
Chapters are labelled A1, A2, A3 [done, but...],
Cross-references to Chapters call them A1, A2, A3 [not done: I'm 
getting A.1]
Figures are labelled A1.1, A1.2 [not done; I'm getting A.11 (eek!)]
Cross-references to Figures call them A1.1, A1.2 [not done: I'm 
getting A.11]

It seems to me that the line
\setupheads[separator=]
can't possibly be right and is almost certainly causing the missing dot 
in the Figure number, but it was the only way I could find to remove the 
dot between the A and the 1 in the chapter label. I have toiled a little 
with the core-ref code and cannot fathom how any of the variety of uses 
of the word separator make sense, or indeed if they really have 
anything to do with it... :-)

I'm testing on the garden, using pdfTeX. I'd be *really* grateful for 
some help with this one.

Thanks,

Duncan

___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Sections with additional dot: a little request

2006-02-20 Thread Hans Hagen
Mojca Miklavec wrote:

 \setuplabeltext
   [sl]
   [chapter={{},{.}}]
 

 Thanks a lot. It's an interesting trick.
   
it's actually meant for that, it was introduced some years ago when chinese 
needed such features 

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
-

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


Re: [NTG-context] Sections with additional dot: a little request

2006-02-19 Thread Mojca Miklavec
On 2/18/06, Hans Hagen wrote:
 Mojca Miklavec wrote:
  Hello Hans,
 
  The sections in Slovenian have to be numbered wih dots at the end:
 
  1. Introduction
  2. Contents
  2.1. Subsection
  2.1.1. Subsubsection
  2.1.2. Subsubsection
  2.2. Subsection
  2.3. Subsection
  3. Bibliography
 
  rather than
 
  1  Introduction
  2  Contents
  2.1  Subsection
  2.1.1  Subsubsection
  2.1.2  Subsubsection
  2.2  Subsection
  2.3  Subsection
  3  Bibliography
 
  There are many commands in ConTeXt which support delimiter key, but
  here the delimiter already stands for the dot delimiting subsequent
  numbers in this case.
 
 a quick way out:

 \setuplabeltext
   [sl]
   [chapter={{},{.}}]

Thanks a lot. It's an interesting trick.

 it is no problem to provide some language dependent conversion handling, but 
 then i'd like to implement everything at once (i know that hungarian also has 
 special demands).

 so ... best is t o start meking a 'document' with proposed extensions (to 
 which other users can add their wishes); most of what you need, is not that 
 hard to implement, but i'd like to do it all at once

Wiki is a perfect place for such a thing. (I also have some other
half-written page about language support to be placed there.)

I can only hope that anyone is reading this and will reply or leave a
note on the wiki about his or her requests.

Thanks,
   Mojca
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Sections with additional dot: a little request

2006-02-18 Thread Hans Hagen
Mojca Miklavec wrote:
 Hello Hans,

 The sections in Slovenian have to be numbered wih dots at the end:

 1. Introduction
 2. Contents
 2.1. Subsection
 2.1.1. Subsubsection
 2.1.2. Subsubsection
 2.2. Subsection
 2.3. Subsection
 3. Bibliography

 rather than

 1  Introduction
 2  Contents
 2.1  Subsection
 2.1.1  Subsubsection
 2.1.2  Subsubsection
 2.2  Subsection
 2.3  Subsection
 3  Bibliography

 There are many commands in ConTeXt which support delimiter key, but
 here the delimiter already stands for the dot delimiting subsequent
 numbers in this case.
   
a quick way out: 

\setuplabeltext
  [sl]
  [chapter={{},{.}}]

\starttext

\chapter{whatever}

\mainlanguage[sl]

\chapter{whatever}

\stoptext

(we can extend that to other numbered things

it is no problem to provide some language dependent conversion handling, but 
then i'd like to implement everything at once (i know that hungarian also has 
special demands). 

so ... best is t o start meking a 'document' with proposed extensions (to which 
other users can add their wishes); most of what you need, is not that hard to 
implement, but i'd like to do it all at once 

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
-

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


[NTG-context] Sections with additional dot: a little request

2006-02-17 Thread Mojca Miklavec
Hello Hans,

The sections in Slovenian have to be numbered wih dots at the end:

1. Introduction
2. Contents
2.1. Subsection
2.1.1. Subsubsection
2.1.2. Subsubsection
2.2. Subsection
2.3. Subsection
3. Bibliography

rather than

1  Introduction
2  Contents
2.1  Subsection
2.1.1  Subsubsection
2.1.2  Subsubsection
2.2  Subsection
2.3  Subsection
3  Bibliography

There are many commands in ConTeXt which support delimiter key, but
here the delimiter already stands for the dot delimiting subsequent
numbers in this case.

There's a possible solution listed on
http://wiki.contextgarden.net/Dotted_number_in_caption, ie:

\def\Dot#1{#1.}
\setuphead[section][numbercommand=\Dot]
\setuplist[section][numbercommand=\Dot]
\setuplist[subsection][numbercommand=\Dot]
\setuplist[subsubsection][numbercommand=\Dot]

but this cannot be built into languagespecifics as such since it
interferes with user-defined numbercommands (if the user defines his
own numbercommand, the dot would disapear).

This is low-priority (can be circumvented and done properly if
needed), but I would be very glad if an additional keyword  its
setting could make its way into languagespecifics once in the future
if possible.

LaTeX people did that (not aplicable to ConTeXt at all):

\renewcommand\thepart [EMAIL PROTECTED]@part}
\renewcommand\thesection  [EMAIL PROTECTED]@section.}
\renewcommand\thesubsection   [EMAIL PROTECTED]@subsection}
[EMAIL PROTECTED]@subsubsection}
\renewcommand\theparagraph[EMAIL PROTECTED]@paragraph}
\renewcommand\thesubparagraph [EMAIL PROTECTED]@subparagraph}

\renewcommand\appendix{\par
  \setcounter{section}{0}%
  \setcounter{subsection}{0}%
  [EMAIL PROTECTED]@section.}}


Also, Part 1 may be written as 1. poglavje (with dot) or Poglavje
1 (without dot), so there has to remain an option to remove a dot
only for a certain title if necessary.

The only online reference I know (list of mistakes in babel) is
written in Slovenian
http://nl.ijs.si/gnusl/tex/tslovene/slolang/node98.html-l2#SECTION0002031400
but I guess that the content can at least partially be evident from
the TeX sources.

Once again the same comment as the last time with itemizing. If this
will ever be implemented and added, it will change the behaviour (and
break the old behaviour in a way), but I guess that there are not so
many people typesetting Slovenian in ConTeXt yet. There will be less
harm if a few old documents are fixed than if tons of other newer
documents are typeset wrong.

Thanks a lot,
Mojca
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context