ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Enumeration: chapter in counter, problem next to placefigure, and documentation issues
@ 2016-09-04 17:37 Florian Leupold
  2016-09-04 19:54 ` Otared Kavian
  2016-09-04 20:22 ` Wolfgang Schuster
  0 siblings, 2 replies; 6+ messages in thread
From: Florian Leupold @ 2016-09-04 17:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1881 bytes --]

Dear list,

I am trying to use enumerations with MKIV I am a bit at a loss when it comes to the documentation (see below for a few issues).

Working on a concrete example, I have come pretty close to what I want for my enumeration ‘theorem’:

\setupexternalfigures[location=default]
\setupenumerations[
	alternative=left,
	text=Theorem,
	headstyle=bold,
	title=no,
	way=bychapter,
	stopper={:},
	distance=1ex,
	width=fit,
	style=normal,
	hang=fit]
\defineenumeration[theorem]
\starttext
\chapter{First chapter}
\starttheorem
The square on the hypotenuse is equal to the sum of the squares on the other two sides.
\stoptheorem
\chapter{Second chapter}
\placefigure[right, none]{}{\externalfigure[mill]}
\starttheorem
The square on the hypotenuse is equal to the sum of the squares on the other two sides.
\stoptheorem
\stoptext

QUESTIONS:
1) I would like to prefix the theorem counter with the chapter number, such that the number of the second theorem becomes 2.1. Can this be done?
2) Is it possible to circumvent the misplacement of the second theorem due to the placed figure? Ideally, the theorem would just use the space to the left it.

Issues with the documentation:
- In “ConTeXt Commands”, it says on page 224 that \setupenumeration inherits from \setupcounter; but in “ConTEXt reference manual", it says on page 246 that \setupenumerations inherits from \setupdescriptions.
- In “ConTEXt reference manual”, the key “location” for \defineenumeration should probably replaced by “alternative”. Right now, all examples on page 247 are unaffected by this setting and hence look the same.
- The wiki seems to use MKII, which makes a difference for the example on http://wiki.contextgarden.net/Command/enumeration, which compiles differently under ConTeXT online.

Thanks for your help!

Best regards,
Florian

[-- Attachment #1.2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 842 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

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

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

* Re: Enumeration: chapter in counter, problem next to placefigure, and documentation issues
  2016-09-04 17:37 Enumeration: chapter in counter, problem next to placefigure, and documentation issues Florian Leupold
@ 2016-09-04 19:54 ` Otared Kavian
  2016-09-05  9:06   ` Florian Leupold
  2016-09-04 20:22 ` Wolfgang Schuster
  1 sibling, 1 reply; 6+ messages in thread
From: Otared Kavian @ 2016-09-04 19:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Florian,

The following setup works fine here, I wonder whether this is what you want:

\defineenumeration[theorem]
	[text={Theorem},
	style=slanted,
	title=yes,
	alternative=hanging,
%	hang=2,
	width=fit,
	right={~},
	way=bychapter,
%	way=bysection,
	prefix=yes,
%	prefixsegments={chapter:section},
	prefixsegments={chapter},
	]

Another more versatile solution is to define an enumeration like the \proclaim definition of plain TeX, as follows:

\defineenumeration[proclaim]
	[text=,
	style=slanted,
	title=yes,
	titleleft=,
	titleright={.},
	alternative=hanging,
%	hang=2,
	width=fit,
	right={~},
	way=bychapter,
%	way=bysection,
	prefix=yes,
%	prefixsegments={chapter:section},
	prefixsegments={chapter},
	]

and the use it as in the following example:

\startproclaim{Pythagoras Theorem}
The square on the hypotenuse is equal to the sum of the squares on the other two sides.
\stopproclaim

You can play with other options in the setups above and tune them to your taste.

Best regards: OK

> On 4 Sep 2016, at 19:37, Florian Leupold <fleupold@posteo.net> wrote:
> 
> Dear list,
> 
> I am trying to use enumerations with MKIV I am a bit at a loss when it comes to the documentation (see below for a few issues).
> 
> Working on a concrete example, I have come pretty close to what I want for my enumeration ‘theorem’:
> 
> \setupexternalfigures[location=default]
> \setupenumerations[
> 	alternative=left,
> 	text=Theorem,
> 	headstyle=bold,
> 	title=no,
> 	way=bychapter,
> 	stopper={:},
> 	distance=1ex,
> 	width=fit,
> 	style=normal,
> 	hang=fit]
> \defineenumeration[theorem]
> \starttext
> \chapter{First chapter}
> \starttheorem
> The square on the hypotenuse is equal to the sum of the squares on the other two sides.
> \stoptheorem
> \chapter{Second chapter}
> \placefigure[right, none]{}{\externalfigure[mill]}
> \starttheorem
> The square on the hypotenuse is equal to the sum of the squares on the other two sides.
> \stoptheorem
> \stoptext
> 
> QUESTIONS:
> 1) I would like to prefix the theorem counter with the chapter number, such that the number of the second theorem becomes 2.1. Can this be done?
> 2) Is it possible to circumvent the misplacement of the second theorem due to the placed figure? Ideally, the theorem would just use the space to the left it.
> 
> Issues with the documentation:
> - In “ConTeXt Commands”, it says on page 224 that \setupenumeration inherits from \setupcounter; but in “ConTEXt reference manual", it says on page 246 that \setupenumerations inherits from \setupdescriptions.
> - In “ConTEXt reference manual”, the key “location” for \defineenumeration should probably replaced by “alternative”. Right now, all examples on page 247 are unaffected by this setting and hence look the same.
> - The wiki seems to use MKII, which makes a difference for the example on http://wiki.contextgarden.net/Command/enumeration, which compiles differently under ConTeXT online.
> 
> Thanks for your help!
> 
> Best regards,
> Florian
> ___________________________________________________________________________________
> 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
___________________________________________________________________________________

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

* Re: Enumeration: chapter in counter, problem next to placefigure, and documentation issues
  2016-09-04 17:37 Enumeration: chapter in counter, problem next to placefigure, and documentation issues Florian Leupold
  2016-09-04 19:54 ` Otared Kavian
@ 2016-09-04 20:22 ` Wolfgang Schuster
  1 sibling, 0 replies; 6+ messages in thread
From: Wolfgang Schuster @ 2016-09-04 20:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1417 bytes --]

> Florian Leupold <mailto:fleupold@posteo.net>
> 4. September 2016 um 19:37
> Issues with the documentation:
> - In “ConTeXt Commands”, it says on page 224 that \setupenumeration 
> inherits from \setupcounter; but in “ConTEXt reference manual", it 
> says on page 246 that \setupenumerations inherits from \setupdescriptions.
> - In “ConTEXt reference manual”, the key “location” for 
> \defineenumeration should probably replaced by “alternative”. Right 
> now, all examples on page 247 are unaffected by this setting and hence 
> look the same.
ConTeXt contains two different interface files, a) a old one 
(cont-en.xml) which was written for MkII and extended of the time with a 
few new command introduced by MkIV (e.g. \definefontfeature) and b) a 
new one (i-context.xml) which was rewritten with MkIV as its base.

Most of the existing documents use the old file which contains either 
wrong keys (e.g. location vs. alternative) or document no longer 
existing functions (compare counter related settings in both files).

The new file takes also into account internal changes for commands, e.g. 
in MkII note descriptions are based on enumerations which are itself a 
extension to the description commands. In MkIV notations (new name for 
note descriptions), enumerations and descriptions all use a internal 
mechanism called constructions with extra functions for each instance.

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 2416 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

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

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

* Re: Enumeration: chapter in counter, problem next to placefigure, and documentation issues
  2016-09-04 19:54 ` Otared Kavian
@ 2016-09-05  9:06   ` Florian Leupold
  2016-09-06  0:55     ` Aditya Mahajan
  0 siblings, 1 reply; 6+ messages in thread
From: Florian Leupold @ 2016-09-05  9:06 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 5028 bytes --]

> On 04.09.16, at 21:54, Otared Kavian <otared@gmail.com> wrote:
> 
> Hi Florian,
> 
> The following setup works fine here, I wonder whether this is what you want:
> 
> \defineenumeration[theorem]
> 	[text={Theorem},
> 	style=slanted,
> 	title=yes,
> 	alternative=hanging,
> %	hang=2,
> 	width=fit,
> 	right={~},
> 	way=bychapter,
> %	way=bysection,
> 	prefix=yes,
> %	prefixsegments={chapter:section},
> 	prefixsegments={chapter},
> 	]
> 
> Another more versatile solution is to define an enumeration like the \proclaim definition of plain TeX, as follows:
> 
> \defineenumeration[proclaim]
> 	[text=,
> 	style=slanted,
> 	title=yes,
> 	titleleft=,
> 	titleright={.},
> 	alternative=hanging,
> %	hang=2,
> 	width=fit,
> 	right={~},
> 	way=bychapter,
> %	way=bysection,
> 	prefix=yes,
> %	prefixsegments={chapter:section},
> 	prefixsegments={chapter},
> 	]
> 
> and the use it as in the following example:
> 
> \startproclaim{Pythagoras Theorem}
> The square on the hypotenuse is equal to the sum of the squares on the other two sides.
> \stopproclaim
> 
> You can play with other options in the setups above and tune them to your taste.
> 
> Best regards: OK
> 
>> On 4 Sep 2016, at 19:37, Florian Leupold <fleupold@posteo.net> wrote:
>> 
>> Dear list,
>> 
>> I am trying to use enumerations with MKIV I am a bit at a loss when it comes to the documentation (see below for a few issues).
>> 
>> Working on a concrete example, I have come pretty close to what I want for my enumeration ‘theorem’:
>> 
>> \setupexternalfigures[location=default]
>> \setupenumerations[
>> 	alternative=left,
>> 	text=Theorem,
>> 	headstyle=bold,
>> 	title=no,
>> 	way=bychapter,
>> 	stopper={:},
>> 	distance=1ex,
>> 	width=fit,
>> 	style=normal,
>> 	hang=fit]
>> \defineenumeration[theorem]
>> \starttext
>> \chapter{First chapter}
>> \starttheorem
>> The square on the hypotenuse is equal to the sum of the squares on the other two sides.
>> \stoptheorem
>> \chapter{Second chapter}
>> \placefigure[right, none]{}{\externalfigure[mill]}
>> \starttheorem
>> The square on the hypotenuse is equal to the sum of the squares on the other two sides.
>> \stoptheorem
>> \stoptext
>> 
>> QUESTIONS:
>> 1) I would like to prefix the theorem counter with the chapter number, such that the number of the second theorem becomes 2.1. Can this be done?
>> 2) Is it possible to circumvent the misplacement of the second theorem due to the placed figure? Ideally, the theorem would just use the space to the left it.
>> 
>> Issues with the documentation:
>> - In “ConTeXt Commands”, it says on page 224 that \setupenumeration inherits from \setupcounter; but in “ConTEXt reference manual", it says on page 246 that \setupenumerations inherits from \setupdescriptions.
>> - In “ConTEXt reference manual”, the key “location” for \defineenumeration should probably replaced by “alternative”. Right now, all examples on page 247 are unaffected by this setting and hence look the same.
>> - The wiki seems to use MKII, which makes a difference for the example on http://wiki.contextgarden.net/Command/enumeration, which compiles differently under ConTeXT online.
>> 
>> Thanks for your help!
>> 
>> Best regards,
>> Florian
>> ___________________________________________________________________________________
>> 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
> ___________________________________________________________________________________

Dear Otared and Wolfgang,

thanks for your helpful suggestions and information!

One problem, however, persists: The theorem environment gets misplaced when a figure is placed to its left:

\setupexternalfigures[location=default]
\setupenumerations[
	alternative=left,
	text=Theorem,
	title=no,
	stopper={:},
	distance=0ex,
	width=fit,
	right={~},
	style=normal,
	hang=fit]
\defineenumeration[theorem]
\starttext
\placefigure[right, none]{}{\externalfigure[mill]}
\starttheorem
The square on the hypotenuse is equal to the sum of the squares on the other two sides.
\stoptheorem
\stoptext

Does anyone know a way to fix this?

Thanks and best regards,
Florian

[-- Attachment #1.2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 842 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

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

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

* Re: Enumeration: chapter in counter, problem next to placefigure, and documentation issues
  2016-09-05  9:06   ` Florian Leupold
@ 2016-09-06  0:55     ` Aditya Mahajan
  2016-09-06  7:18       ` Florian Leupold
  0 siblings, 1 reply; 6+ messages in thread
From: Aditya Mahajan @ 2016-09-06  0:55 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Mon, 5 Sep 2016, Florian Leupold wrote:

> One problem, however, persists: The theorem environment gets misplaced 
> when a figure is placed to its left:
>
> \setupexternalfigures[location=default]
> \setupenumerations[
> 	alternative=left,
> 	text=Theorem,
> 	title=no,
> 	stopper={:},
> 	distance=0ex,
> 	width=fit,
> 	right={~},
> 	style=normal,
> 	hang=fit]

I am not sure what visual layout you want, but how about using:

\setupenumerations[
         alternative=serried,
         text=Theorem,
         title=no,
         stopper={:},
         distance=0ex,
         width=fit,
         right={~},
         style=normal,
       ]
\defineenumeration[theorem]

Aditya

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Enumeration: chapter in counter, problem next to placefigure, and documentation issues
  2016-09-06  0:55     ` Aditya Mahajan
@ 2016-09-06  7:18       ` Florian Leupold
  0 siblings, 0 replies; 6+ messages in thread
From: Florian Leupold @ 2016-09-06  7:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1472 bytes --]


> On 06.09.16, at 02:55, Aditya Mahajan <adityam@umich.edu> wrote:
> 
> On Mon, 5 Sep 2016, Florian Leupold wrote:
> 
>> One problem, however, persists: The theorem environment gets misplaced when a figure is placed to its left:
>> 
>> \setupexternalfigures[location=default]
>> \setupenumerations[
>> 	alternative=left,
>> 	text=Theorem,
>> 	title=no,
>> 	stopper={:},
>> 	distance=0ex,
>> 	width=fit,
>> 	right={~},
>> 	style=normal,
>> 	hang=fit]
> 
> I am not sure what visual layout you want, but how about using:
> 
> \setupenumerations[
>        alternative=serried,
>        text=Theorem,
>        title=no,
>        stopper={:},
>        distance=0ex,
>        width=fit,
>        right={~},
>        style=normal,
>      ]
> \defineenumeration[theorem]
> 
> Aditya
> 
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________

Dear Aditya,

thanks, that is indeed what I wanted to achieve. I don’t know why I got hung up with “alternative=left”.

Best,
Florian

[-- Attachment #1.2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 842 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

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

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

end of thread, other threads:[~2016-09-06  7:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-04 17:37 Enumeration: chapter in counter, problem next to placefigure, and documentation issues Florian Leupold
2016-09-04 19:54 ` Otared Kavian
2016-09-05  9:06   ` Florian Leupold
2016-09-06  0:55     ` Aditya Mahajan
2016-09-06  7:18       ` Florian Leupold
2016-09-04 20:22 ` Wolfgang Schuster

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