ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Otared Kavian <otared@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Enumeration: chapter in counter, problem next to placefigure, and documentation issues
Date: Sun, 4 Sep 2016 21:54:04 +0200	[thread overview]
Message-ID: <EEBA2CE2-2F86-4BEC-84CC-E36563BDC919@gmail.com> (raw)
In-Reply-To: <753E37B0-7521-4DF5-8FAB-5DA799DCE9C6@posteo.net>

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
___________________________________________________________________________________

  reply	other threads:[~2016-09-04 19:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-04 17:37 Florian Leupold
2016-09-04 19:54 ` Otared Kavian [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=EEBA2CE2-2F86-4BEC-84CC-E36563BDC919@gmail.com \
    --to=otared@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).