ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Numberconversion problem in caption prefixes
@ 2013-11-12  1:14 Géry Ogam
  2013-11-21 15:25 ` Géry Ogam
  2013-11-21 15:33 ` Wolfgang Schuster
  0 siblings, 2 replies; 6+ messages in thread
From: Géry Ogam @ 2013-11-12  1:14 UTC (permalink / raw)
  To: ntg-context


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

Hello,

There is a numberconversion problem in caption prefixes. For instance, if
chapter numbers are set to Romannumerals, the conversion of the caption
prefixes depends on the presence of a section

Minimal example:

\setuphead[chapter][conversion=Romannumerals]
\setupcaption[way=bychapter, prefixsegments=chapter]


\starttext

\chapter{Cool}
\placefigure{A cow}{\externalfigure[cow]}

\chapter{Cat}
\section{Mouse}
\section{Dog}
\placefigure{A cow}{\externalfigure[cow]}

\stoptext


The previous code displays an inconsistent caption prefix (first time a
Romannumeral, second time a number):

I Cool
[figure] Figure I.1 A cow

II Cat
2.1 Mouse
2.2 Dog
[figure] Figure 2.1 A cow

[-- Attachment #1.2: Type: text/html, Size: 1093 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: Numberconversion problem in caption prefixes
  2013-11-12  1:14 Numberconversion problem in caption prefixes Géry Ogam
@ 2013-11-21 15:25 ` Géry Ogam
  2013-11-21 15:33 ` Wolfgang Schuster
  1 sibling, 0 replies; 6+ messages in thread
From: Géry Ogam @ 2013-11-21 15:25 UTC (permalink / raw)
  To: ntg-context


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

It should display:

I Cool
[figure] Figure 1.1 A cow % <-- not: Figure I.1 A cow

II Cat
2.1 Mouse
2.2 Dog
[figure] Figure 2.1 A cow


Could you look at this weird prefix conversion behaviour Hans?



Géry Ogam


2013/11/12 Géry Ogam <maggyero@gmail.com>

> Hello,
>
> There is a numberconversion problem in caption prefixes. For instance, if
> chapter numbers are set to Romannumerals, the conversion of the caption
> prefixes depends on the presence of a section
>
> Minimal example:
>
> \setuphead[chapter][conversion=Romannumerals]
> \setupcaption[way=bychapter, prefixsegments=chapter]
>
>
> \starttext
>
> \chapter{Cool}
> \placefigure{A cow}{\externalfigure[cow]}
>
> \chapter{Cat}
> \section{Mouse}
> \section{Dog}
> \placefigure{A cow}{\externalfigure[cow]}
>
> \stoptext
>
>
> The previous code displays an inconsistent caption prefix (first time a
> Romannumeral, second time a number):
>
> I Cool
> [figure] Figure I.1 A cow
>
> II Cat
> 2.1 Mouse
> 2.2 Dog
> [figure] Figure 2.1 A cow
>

[-- Attachment #1.2: Type: text/html, Size: 2107 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: Numberconversion problem in caption prefixes
  2013-11-12  1:14 Numberconversion problem in caption prefixes Géry Ogam
  2013-11-21 15:25 ` Géry Ogam
@ 2013-11-21 15:33 ` Wolfgang Schuster
  1 sibling, 0 replies; 6+ messages in thread
From: Wolfgang Schuster @ 2013-11-21 15:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 12.11.2013 um 02:14 schrieb Géry Ogam <maggyero@gmail.com>:

> Hello,
> 
> There is a numberconversion problem in caption prefixes. For instance, if chapter numbers are set to Romannumerals, the conversion of the caption prefixes depends on the presence of a section
> 
> Minimal example:
> 
> \setuphead[chapter][conversion=Romannumerals]
> \setupcaption[way=bychapter, prefixsegments=chapter]

\defineconversionset [section:chapter] [] [R]
\defineconversionset [float:figure]    [] [n]

\setuphead
  [chapter]
  [sectionconversionset=section:chapter]

\setupcaption
  [way=bychapter,
   prefixsegments=chapter,
   prefixconversionset=float:figure]

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
___________________________________________________________________________________


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

* Re: Numberconversion problem in caption prefixes
@ 2013-11-23 15:56 Géry Ogam
  0 siblings, 0 replies; 6+ messages in thread
From: Géry Ogam @ 2013-11-23 15:56 UTC (permalink / raw)
  To: ntg-context


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

Thanks again Wolfgang, with this setup everything is fine.

But I wanted to bring to the attention of Hans the inconsistency of the
prefix conversions by defaut, so that he can correct them:

I A chapter

[a figure] Figure I.1  % <-- Here the conversion of the prefix to
Romannumerals is done AUTOMATICALLY.

1.1 A section

[a figure] Figure 1.2 % <-- Here the conversion of the prefix to
Romannumerals is NOT done AUTOMATICALLY (the presence of a section before
seems to DISCARD THE AUTOMATIC CONVERSION). Nor in the prefix of the
section.


Code:

\setuphead[chapter][conversion=Romannumerals]
\starttext
\chapter{A chapter}
\placefigure{}{\externalfigure}
\section{A section}
\placefigure{}{\externalfigure}
\stoptext


Every prefix should be AUTOMATICALLY converted, not half of them. Hans,
could you please correct that in the next betas?

Best regards.

[-- Attachment #1.2: Type: text/html, Size: 1214 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: Numberconversion problem in caption prefixes
  2013-11-21 20:01 Géry Ogam
@ 2013-11-22  5:56 ` Wolfgang Schuster
  0 siblings, 0 replies; 6+ messages in thread
From: Wolfgang Schuster @ 2013-11-22  5:56 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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


Am 21.11.2013 um 21:01 schrieb Géry Ogam <maggyero@gmail.com>:

> Thank you Wolfgang, it does what I want.
> 
> However, I realised after trying the following code inside environments (frontmatter, bodymatter, backmatter and appendices) that the default behaviour is WRONG because the conversions of prefixes are not always automatic.
> 
> For instance, in the appendix environment, by default chapter numbers are Characters and every prefix representing a chapter number is also a Character (section prefixes, caption prefixes and so on). Now if you decide to switch chapter numbers to Romannumerals, you will get something totally inconsistent if you don’t do many conversions manually:
> 
> 
> \startsectionblockenvironment[appendix]
>     \defineconversionset[romannumeralsconversionset][][R]
>     \setuphead[chapter][sectionconversionset=romannumeralsconversionset]
> \stopsectionblockenvironment
> 
> \starttext
> 
> \startappendices
> \chapter{Cool}
> \placefigure{A cow}{\externalfigure[cow]}
> \chapter{Cat}
> \section{Mouse}
> \section{Dog}
> \placefigure{A cow}{\externalfigure[cow]}
> 
> \stopappendices
> 
> \stoptext

\defineconversionset [appendix:headconversionset]  [n,R] [n]
\defineconversionset [appendix:floatconversionset] []    [n]

\setuphead[sectionconversionset=headconversionset]

\setupcaption[numberconversionset=floatconversionset]

\starttext

\startappendices
\chapter{Cool}
\placefigure{A cow}{\externalfigure[cow]}
\chapter{Cat}
\section{Mouse}
\section{Dog}
\placefigure{A cow}{\externalfigure[cow]}
\stopappendices

\stoptext

Wolfgang


[-- Attachment #1.2: Type: text/html, Size: 2612 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: Numberconversion problem in caption prefixes
@ 2013-11-21 20:01 Géry Ogam
  2013-11-22  5:56 ` Wolfgang Schuster
  0 siblings, 1 reply; 6+ messages in thread
From: Géry Ogam @ 2013-11-21 20:01 UTC (permalink / raw)
  To: ntg-context


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

Thank you Wolfgang, it does what I want.

However, I realised after trying the following code inside environments
(frontmatter, bodymatter, backmatter and appendices) that the default
behaviour is WRONG because the conversions of prefixes are not always
automatic.

For instance, in the appendix environment, by default chapter numbers are
Characters and every prefix representing a chapter number is also a
Character (section prefixes, caption prefixes and so on). Now if you decide
to switch chapter numbers to Romannumerals, you will get something totally
inconsistent if you don’t do many conversions manually:


*\startsectionblockenvironment[appendix]*
*    \defineconversionset[romannumeralsconversionset][][R]*
*    \setuphead[chapter][sectionconversionset=romannumeralsconversionset]*
*\stopsectionblockenvironment*

*\starttext*

*\startappendices*
*\chapter{Cool}*
*\placefigure{A cow}{\externalfigure[cow]}*
*\chapter{Cat}*
*\section{Mouse}*
*\section{Dog}*
*\placefigure{A cow}{\externalfigure[cow]}*

*\stopappendices*

*\stoptext*


which gives:


*I Cool*
*[figure] Figure I.I Cow     % <-- Here the prefix conversion from 'A' to
'I' works.*

*II Cat*
*B.1 Mouse                     % <-- Here the prefix conversion from 'B' to
'II' does NOT work.*
*B.2 Dog                         % <-- Here the prefix conversion from 'B'
to 'II' does NOT work.*
*[figure] Figure B.II Cow   % <-- Here the prefix conversion from 'B' to
'II' does NOT work (because of the presence of the 2 sections B.1 and B.2
where the prefix conversion already did not work I think, so here is the
BUG).*


Extra: is it normal that caption NUMBERS (not prefixes) are converted to
Romannumerals by default INSIDE the appendix environment (outside they are
usual numbers)? ('Figure I.I Cow' and 'Figure B.II Cow' instead of 'Figure
A.1 Cow' and 'Figure B.2 Cow'.)

[-- Attachment #1.2: Type: text/html, Size: 2627 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:[~2013-11-23 15:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-12  1:14 Numberconversion problem in caption prefixes Géry Ogam
2013-11-21 15:25 ` Géry Ogam
2013-11-21 15:33 ` Wolfgang Schuster
2013-11-21 20:01 Géry Ogam
2013-11-22  5:56 ` Wolfgang Schuster
2013-11-23 15:56 Géry Ogam

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