Hi all I'm trying to setup captions for figures with mkiv. I found this page on the wiki: http://wiki.contextgarden.net/Reference/en/setupnumbering Using both these: \setupcaptions[way=bysection,prefixsegments=section] \setupformulae[way=bysection,prefixsegments=section] formulae are numbered as expected but captions are not, the prefix is lacking. My next question is, how to replace the word "Figure" in the caption by another one? Sorry if these have been discussed before... Thanks, -- Jean
Am 02.08.2011 um 16:10 schrieb Jean Magnan de Bornier:
Hi all
I'm trying to setup captions for figures with mkiv. I found this page on the wiki:
http://wiki.contextgarden.net/Reference/en/setupnumbering
Using both these:
\setupcaptions[way=bysection,prefixsegments=section] \setupformulae[way=bysection,prefixsegments=section]
formulae are numbered as expected but captions are not, the prefix is lacking.
Does it help when you add “prefix=yes” to \setupcaptions? When this doesn’t work you should provide a minimal example.
My next question is, how to replace the word "Figure" in the caption by another one?
\setuplabeltext[en][figure=Picture ] Wolfgang
Le 02 août à 16:19:01 Wolfgang Schuster
| > Hi all | > | > I'm trying to setup captions for figures with mkiv. I found this page on the wiki: | > | > http://wiki.contextgarden.net/Reference/en/setupnumbering | > | > Using both these: | > | > \setupcaptions[way=bysection,prefixsegments=section] | > \setupformulae[way=bysection,prefixsegments=section] | > | > formulae are numbered as expected but captions are not, the prefix is | > lacking.
| Does it help when you add “prefix=yes” to \setupcaptions?
| When this doesn’t work you should provide a minimal example. No; here is where I stand after some more trial and errors: - On my small testfile when adding chapters and sections I get a prefix (section number); however I want the chapter number as prefix, which is the standard practice and I don't see how to do that with mkiv (obviously it is doable...) - On my big real file I have no prefix, I only hope I will find out why by myself...
| > My next question is, how to replace the word "Figure" in the caption by | > another one?
| \setuplabeltext[en][figure=Picture ]
yes Thank you Wolfgang -- Jean
Le 03 août à 08:29:55 Jean Magnan de Bornier
Le 03 août à 08:29:55 Jean Magnan de Bornier
| | Am 02.08.2011 um 16:10 schrieb Jean Magnan de Bornier: | > | | > Hi all | | > | | > I'm trying to setup captions for figures with mkiv. I found this page on the wiki: | | > | | > http://wiki.contextgarden.net/Reference/en/setupnumbering | | > | | > Using both these: | | > | | > \setupcaptions[way=bysection,prefixsegments=section] | | > \setupformulae[way=bysection,prefixsegments=section] | | > | | > formulae are numbered as expected but captions are not, the prefix is | | > lacking. | > | | Does it help when you add “prefix=yes” to \setupcaptions? | > | | When this doesn’t work you should provide a minimal example.
| No; here is where I stand after some more trial and errors: | - On my small testfile when adding chapters and sections I get a prefix (section | number); however I want the chapter number as prefix, which is the | standard practice and I don't see how to do that with mkiv (obviously it | is doable...) | - On my big real file I have no prefix, I only hope I will find out why by myself... After lots of checking on my project I came to this, which looks like a bug: Project is eg: .......................... \startproduct Test \environment env_test \startfrontmatter \component bla \stopfrontmatter \startbodymatter \component test1 \component test2 \stopbodymatter \stopproduct ......................... If files test1.tex and test2.tex begin with \starttext and end with \stoptext: \setupcaptions works as expected regarding prefix If files test1.tex and test2.tex begin with \startcomponent and end with \stopcomponent: \setupcaptions does not work as expected regarding prefix (no prefix at all) \setupformulae not affected bye, -- Jean
Am 04.08.2011 um 08:16 schrieb Jean Magnan de Bornier:
After lots of checking on my project I came to this, which looks like a bug:
Project is eg: .......................... \startproduct Test \environment env_test \startfrontmatter \component bla \stopfrontmatter
\startbodymatter
\component test1 \component test2 \stopbodymatter
\stopproduct ......................... If files test1.tex and test2.tex begin with \starttext and end with \stoptext: \setupcaptions works as expected regarding prefix
If files test1.tex and test2.tex begin with \startcomponent and end with \stopcomponent: \setupcaptions does not work as expected regarding prefix (no prefix at all)
Provide a *minimal working*, otherwise there is no way to tell what’s wrong. Wolfgang
Le 04 août à 15:38:11 Wolfgang Schuster
Am 04.08.2011 um 17:10 schrieb Jean Magnan de Bornier:
Le 04 août à 15:38:11 Wolfgang Schuster
écrit notamment: | Provide a *minimal working*, otherwise there is no way to tell what’s wrong.
test1.tex: .......................... \startcomponent
\startcomponent test1
test2.tex: ..........................
\startcomponent
\startcomponent test2
"context TEst" produces a different result in the caption with these files and when replacing (start-stop)component by (start-stop)text (files test1 and test2).
It’s no surprise that you don’t get a chapter prefix because there is no in your document. You forgot the title after \startcomponent and ConTeXt took “\chapter{…}” as argument for the component title. Wolfgang
Le 04 août à 18:14:45 Wolfgang Schuster
Am 04.08.2011 um 19:17 schrieb Jean Magnan de Bornier:
Le 04 août à 18:14:45 Wolfgang Schuster
écrit notamment: | It’s no surprise that you don’t get a chapter prefix because there is | no in your document. You forgot the title after \startcomponent and | ConTeXt took “\chapter{…}” as argument for the component title.
Right, my mistake!
However, with such mistake we have a prefix for formulas anyway!
\setupcaptions[way=bysection,prefixsegments=chapter] \setupformulae[way=bysection,prefixsegments=section] You use for the formula the section number as prefix while floats use chapters. In your example there had been section but no chapter and therefore you get a prefix for formulas but none for floats. Wolfgang
Le 04 août à 19:24:20 Wolfgang Schuster
| > Le 04 août à 18:14:45 Wolfgang Schuster
| \setupcaptions[way=bysection,prefixsegments=chapter] | \setupformulae[way=bysection,prefixsegments=section]
| You use for the formula the section number as prefix while floats use chapters.
| In your example there had been section but no chapter and therefore | you get a prefix for formulas but none for floats. Wolfgang, thank you for your patience, I do need rest! -- Jean
Le 04 août à 19:17:55 Jean Magnan de Bornier
Am 05.08.2011 um 10:00 schrieb Jean Magnan de Bornier:
Le 04 août à 19:17:55 Jean Magnan de Bornier
écrit notamment: | Let me search again :(
Here is what I found now. In my environment file (real not test) I have this:
\setuphead[subsection][number=no]
whenever a formula or picture is within a subsection the prefix disappears all over, so the "number=no" is not just for how things look (as I believed), it has deeper effects.
Can you make a minimal example for this. Wolfgang
Le 05 août à 14:30:55 Wolfgang Schuster
| > Le 04 août à 19:17:55 Jean Magnan de Bornier
| Can you make a minimal example for this. Here are the four files. This time it is the formula lacking the prefix. ......................... \startproduct Test \environment env_test \startbodymatter \component test1 \component test2 \stopbodymatter \stopproduct .......................... ......................... \startenvironment env_test \setupcolors [state=start] \setupcaptions[way=bysection,prefixsegments=chapter] \setupformulae[way=bysection,prefixsegments=chapter] \setupinteraction[state=start] \definereferenceformat[ineq] [left=(,right=),text=équation] \definereferenceformat[graph][left={graphique },right=] \setuphead[subsection][number=no] \stopenvironment ..................... ..................... \startcomponent test1 \chapter{ch 1} This file has been typeset on \currentdate{} at \currenttime, with \doifmodeelse{mkiv}{mkiv, LuaTeX revision \luatexrevision, (LuaTeX date stamp \luatexdatestamp)}{mkii}, ConTeXt version \contextversion, using the command: \starttyping context TEst \stoptyping \stopcomponent ...................... ...................... \startcomponent test2 \chapter{ch 2} \section{un} \startuseMPgraphic{kdj} pickup pencircle scaled 1.5mm ; draw (origin -- dir(45) -- dir(0) -- cycle) scaled sqrt(2) scaled 3cm withcolor .625red ; draw (origin -- dir(angle(1,1)) -- dir(angle(1,0)) -- cycle) scaled sqrt(2) scaled 3cm shifted (4.5cm,0) withcolor .625yellow ; draw (origin -- (1,1) -- (1,0) -- cycle) scaled 3cm shifted (9cm,0) withcolor .625white ; label.lft(btex quid? $\alpha$ etex, (1,3)); \stopuseMPgraphic \placefigure[][fig:un]{Un}{\useMPgraphic{kdj}} Document créé grâce au système d'édition \CONTEXT% LUA \startlua a = 1.5 b = 1.9 c = a*b tex.print(c) \stoplua \section{deux} \subsection{trois} \placeformula[eq:pythagoras] \startformula a^2+b^2=c^2 \stopformula \subsection{quatre} This is explained in \ineq[eq:pythagoras]. Et dans le \graph[fig:un] \stopcomponent ...................... bye -- Jean
Le 05 août à 17:36:39 Wolfgang Schuster
Am 05.08.2011 um 18:51 schrieb Jean Magnan de Bornier:
Le 05 août à 17:36:39 Wolfgang Schuster
écrit notamment: | For the moment replace “number=no” with “incrementnumber=no”. ^^^^^^^^^^^^^^ ??????????????
That's it!
There is a bug but it takes time to find it, unless it is found and fixed use incrementnumber. BTW: A *minimal* example your problem is **this**: \setupformulas[way=bysection,prefixsegments=chapter] %\setuphead[subsection][number=no] \setuphead[subsection][incrementnumber=no] \starttext \chapter{Chapter 1} \chapter{Chapter 2} \section{Section} \subsection{Subsection} \placeformula \startformula a^2+b^2=c^2 \stopformula \stoptext Wolfgang
participants (2)
-
Jean Magnan de Bornier
-
Wolfgang Schuster