}\expanded{\setregisterentry[index][entries=\recurselevel]}%
\samplefile{lorem}\footnote{xxx\expanded{\setregisterentry[index][entries=\recurselevel][footnote={\rawcountervalue[footnote]}]}}%
\samplefile{lorem}}
\page \placeindex
\stoptext
::footnote}
{\setregisterentry
[index][keys:1=\xmlatt{#1}{key},entries:1=\xmlatt{#1}{key}][footnote={\rawcountervalue[footnote]}]}
{\setregisterentry[index][keys:1=\xmlatt{#1}{key},entries:1=\xmlatt{#1}{key}]}
\stopxmlsetups
\startxmlsetups xml:index
\page \placeregister [index
isterentry[index][entries=\recurselevel]}%
\samplefile{lorem}\footnote{xxx\expanded{\setregisterentry[index][entries=\recurselevel][footnote={\rawcountervalue[footnote]}]}}%
\samplefile{lorem}}
\page \placeindex
\stoptext
=\outermarginwidth]
\setupmargindata [SidenoteContent][stack=yes,style=\it]
\def\sidenotemark{\rawcountervalue[SidenoteMarkNumber]}
\def\convertsidenotemark#1{\high{\convertnumber{#1}{\sidenotemark}}}
\def\sidenote{\dosingleempty\dosidenote}
\def\dosidenote[#1]#2{%
\getparameters[SMsidenote
On 4/24/24 02:15, Joel via ntg-context wrote:
> [...] Any idea how I can get current footnote value?
Hi Joel,
current footnote value can be accessed with \rawcountervalue[footnote],
such as in:
\starttext
\dorecurse{25}
{\ \footnote{Footnote \recurselevel}:
\rawcounterva
number\numexpr1+\rawcountervalue[ConcurrentTextGetCounter]/2\relax}}
>
I don't know why the counter is incremented twice for each concurrent
environment; the document is typeset once, in three passes. Dividing by two
solves the issue, if there's a deeper issue, I'm at a loss to e
urrentTextSetCounter]%
\setxvariable
{concurrent}
{text:\rawcountervalue[ConcurrentTextSetCounter]}
{#1}}
% Account for the counter incrementing twice and the index being 1-based.
\def\ConcurrentTextGet{%
\incrementnumber[ConcurrentTextGetCounter]%
\getvariable
{con
xtGetCounter][prefix=no]
\setnumber[ConcurrentTextSetCounter][0]
\setnumber[ConcurrentTextGetCounter][0]
% Map each label as global key/value pairs.
\def\ConcurrentTextSet#1{%
\incrementnumber[ConcurrentTextSetCounter]%
\setxvariable
{concurrent}
{text:\rawcountervalue[ConcurrentText
2022 at 4:41 PM mf wrote:
>>
>>> I hope I got the point now:
>>>
>>> ...
>>> \startcolumns
>>>
>>> \the\titlefootnotes
>>>
>>> \kern-\rawcountervalue[address]\lineheight % dirty trick
>>>
>>> test\footnote{test}
>&g
t;>
>> ...
>> \startcolumns
>>
>> \the\titlefootnotes
>>
>> \kern-\rawcountervalue[address]\lineheight % dirty trick
>>
>> test\footnote{test}
>>
>> \input knuth
>>
>> \stopcolumns
>> ...
>>
>> Massi
>
Hi Massi,
You are a champion!
On Wed, May 18, 2022 at 4:41 PM mf wrote:
> I hope I got the point now:
>
> ...
> \startcolumns
>
> \the\titlefootnotes
>
> \kern-\rawcountervalue[address]\lineheight % dirty trick
>
> test\footnote{test}
>
> \input knuth
>
&
{ \getmarking[notePage][top]}
> {s \getmarking[notePage][top]–\getmarking[notePage][bottom]}}
> \stopsetups
>
> \starttexdefinition unexpanded startEndnote
> \dosingleempty\doStartEndnote
> \stoptexdefinition
>
> \starttexdefinition doStartEndnote [#1]
>
]}
{ \getmarking[notePage][top]}
{s \getmarking[notePage][top]–\getmarking[notePage][bottom]}}
\stopsetups
\starttexdefinition unexpanded startEndnote
\dosingleempty\doStartEndnote
\stoptexdefinition
\starttexdefinition doStartEndnote [#1]
\expanded{\dodoStartEndnote[#1][{\rawcountervalue
, but it is
functional.
\definelabel[Qa]
\definecounter[SAVE][numberconversion=R]
\starttext
This is labeled.\Qa\par
This is labeled.\Qa[REF]\par
\setcounter[SAVE][{\rawcountervalue[Qa]}]
See \in[REF].\par
See \ref[number][REF].\par
See \in[REF].\par
This is labeled.\Qa\par
Jairo A. del Rio schrieb am 15.09.2020 um 04:38:
Hi, list. I've adapted the following example from the mailing list. My
aim is to use endnotes for each chapter:
\mainlanguage[es]
\definehead[footnotetitle][title]
\startsetups[chapter:after]
\ifcase\rawcountervalue[footnote]\relax
\else
> Am 15.09.2020 um 04:38 schrieb Jairo A. del Rio :
>
> Hi, list. I've adapted the following example from the mailing list. My aim is
> to use endnotes for each chapter:
>
> \mainlanguage[es]
> \definehead[footnotetitle][title]
> \startsetups[chapter:after]
> \ifca
Hi, list. I've adapted the following example from the mailing list. My aim
is to use endnotes for each chapter:
\mainlanguage[es]
\definehead[footnotetitle][title]
\startsetups[chapter:after]
\ifcase\rawcountervalue[footnote]\relax
\else
\startfootnotetitle[title={Notas
]
\definecounter[ncounter]
[way=bychapter]
\starttext
\rawcountervalue[ncounter]\page
\incrementcounter[ncounter][1]
\page
\lastcountervalue[ncounter]
\chapter{}
\lastcountervalue[ncounter]
\stoptext
I don’t know how to link any page increment to the defined
]
\definecounter[ncounter]
[way=bychapter]
\starttext
\rawcountervalue[ncounter]\page
\incrementcounter[ncounter][1]
\page
\lastcountervalue[ncounter]
\chapter{}
\lastcountervalue[ncounter]
\stoptext
I don’t know how to link any page increment to the defined
]
\starttext
\rawcountervalue[ncounter]\page
\incrementcounter[ncounter][1]
\page
\lastcountervalue[ncounter]
\chapter{}
\lastcountervalue[ncounter]
\stoptext
I don’t know how to link any page increment to the defined counter.
Although method is page, this seems to be related
ber, but I’m not sure how to use \reference so that it uses my tag
>> number. For instance:
>> \definecounter[myTagCounter]
>> .
>> .
>> .
>> \reference[tagref]{\rawcountervalue[myTagCounter]}
>> Doesn’t work. But perhaps I’m going
[tagref] on page \at[tagref].
What is the best way to do this in ConTeXt? I’ve got a counter for tag number,
but I’m not sure how to use \reference so that it uses my tag number. For
instance:
\definecounter[myTagCounter]
.
.
.
\reference[tagref]{\rawcountervalue
way to do this in ConTeXt? I’ve got a counter for tag number,
but I’m not sure how to use \reference so that it uses my tag number. For
instance:
\definecounter[myTagCounter]
.
.
.
\reference[tagref]{\rawcountervalue[myTagCounter]}
Doesn’t work. But perhaps I’m going about
-----
>> Also an example from the Wiki:
>> \startsetups
>> chapter:after
>> \ifcase\rawcountervalue[footnote]\relax
>> \or
>> \startsubject[title=Footnote]
>> \placefootnotes
>> \sto
Also an example from the Wiki:
\startsetups
chapter:after
\ifcase\rawcountervalue[footnote]\relax
\or
\startsubject[title=Footnote]
\placefootnotes
\stopsubject
\else
\startsubject[title=Footnotes
of each chapter
Also an example from the Wiki:
\startsetups
chapter:after
\ifcase\rawcountervalue[footnote]\relax
\or
\startsubject[title=Footnote]
\placefootnotes
\stopsubject
\else
]
{\def\startitem##1\stopitem{\incrementcounter[mycounter]}#1}
\ifnum \rawcountervalue[mycounter]>\rawcountervalue[minforpacked]
\setupitemize[packed]\fi
\startitemize#1\stopitemize}
\starttext
\mystartitemize %normal
\dorecurse{2}{\startitem text\stopitem}
\stopitem
distance=24pt
> ]
> \definecounter[marginales][way=bytext,prefix=no]
> \def\romanMarginales{\convertnumber{r}{\rawcountervalue[marginales]}}
> \def\marginal{\dosingleempty\doMarginal}
> \def\doMarginal[#1]#2{%
> \incrementnumber[marginales]
> \iffirstargument
> \high
]
\definecounter[marginales][way=bytext,prefix=no]
\def\romanMarginales{\convertnumber{r}{\rawcountervalue[marginales]}}
\def\marginal{\dosingleempty\doMarginal}
\def\doMarginal[#1]#2{%
\incrementnumber[marginales]
\iffirstargument
\high{\romanMarginales}\inouter[#1]{\romanMarginales.\ #2}
\else
1)}}
\def\TestLuaB#1{\ctxlua{TestVarB(#1)}}
\startbuffer[testtext]
\dorecurse{100}{Words, words, words. }
\stopbuffer
\starttext
\startlinenumbering
Counter: \TestLuaA{\rawcountervalue[test]}\par
Lineref: \TestLuaB{1} \par
\getbuffer[testtext]
\someline[1]LABEL 1
.
https://www.contextgarden.net/Programming_in_LuaTeX\startbuffer[testtext]\dorecurse{100}{Words,
words, words. }\stopbuffer\starttext\startlinenumberingCounter:
\TestLua{\rawcountervalue[test]}\par% The counter is expanded before
being passed to Lua.Lineref: \TestLua{\inlinerange[1]}\par
/Programming_in_LuaTeX\startbuffer[testtext]\dorecurse{100}{Words,
words, words. }\stopbuffer\starttext\startlinenumberingCounter:
\TestLua{\rawcountervalue[test]}\par% The counter is expanded before
being passed to Lua.Lineref: \TestLua{\inlinerange[1]}\par% The line
reference is not expanded before being
Hello list, please consider this MWE:
\definenumber[p]
\setnumber[p][1]
\def\PageLeft{ p.~}
\def\TextCommand#1{\getnumber[p]
#1\doif{\rawcountervalue[p]}{2}{\def\PageLeft{ P.~}}\incrementnumber[p]}
\setupindex[n=1,pageleft=\PageLeft,pageright=,textcommand=\TextCommand]
\starttext
Foo\index{foo
On 9/25/18 9:22 PM, Damien Thiriet wrote:
> Hello list,
>
> Why do I have to enclose \rawcountervalue in braces to get this MWE
> compiled ?
Hi Damien,
just as you wrote it is the way to enclose brackets inside brackets (you
need a pair of braces between them.
>\definecou
Hello list,
Why do I have to enclose \rawcountervalue in braces to get this MWE
compiled ?
\definecounter[fiche][way=bytext]
\setupheadertexts[Fiche méthodologique N.{\rawcountervalue[fiche]} ][][][]
\starttext
\setcounter[fiche][2]
\starttitle[title={Un essai
\PrintCounterValues{Here \type{\QuestionCounter = }\QuestionCounter.\par
Here \type{\AnswerCounter = }\AnswerCounter.\par
Here \type{\rawcountervalue[question] = }\rawcountervalue[question].\par
Here \type{\rawcountervalue[answer] = }\rawcountervalue[answer].
}
\starttext
\startchapter[title=Questions
upling=… », but somehow I am unable to create automatic
references by extracting the number of each question or that of each
answer, for example by using \rawcountervalue,
or \currentconstructionnumber. Strangely the latter gives the name of
the construction and not a number: is it on p
the number
of each question or that of each answer, for example by using \rawcountervalue,
or \currentconstructionnumber. Strangely the latter gives the name of the
construction and not a number: is it on purpose?
The solution Wolfgang proposes today, using the new keyword referenceprefix, is
almost
?
Not really. The visual counter code is simply using \rawcountervalue and
\lastcountervalue to draw a metapost graphic. I don't know of an easy way
to add a link to "page where this counter has value n". Nor do I know how
to add interaction to a metapost image.
Hans had written s
On 6/15/2016 4:47 PM, mass...@fastwebnet.it wrote:
Hello list,
how can I read the numeric value of a counter in Lua?
local c_value = ...
Something like \rawcountervalue in ConTeXt, but in Lua.
\starttext
x \footnote{x} x \footnote{x} x \footnote{x} x
\cldcontext
Hello list,
how can I read the numeric value of a counter in Lua?
local c_value = ...
Something like \rawcountervalue in ConTeXt, but in Lua.
Thanks in advance,
Massi
___
If your question is of interest to others
Thanks for the reply. \thispage is producing no output in all the places it is
being invoked
Aidan
> On 24 Feb 2016, at 15:35, ntg-context-requ...@ntg.nl wrote:
>
> startsetups[referenceformat:thispage]
>\doifelse{\filterreference{page}}{\rawcountervalue[userpage]}
>
Thanks for the reply. \thispage is producing no output in all the places it is
being invoked
Aidan
> On 24 Feb 2016, at 15:35, ntg-context-requ...@ntg.nl wrote:
>
> startsetups[referenceformat:thispage]
> \doifelse{\filterreference{page}}{\rawcountervalue[userpage]}
>
Aidan Nichol <mailto:ai...@nicholware.co.uk>
24. Februar 2016 um 12:47
I’m trying to create something (like varioref in latex) that
suppresses \at output if the referenced item is on the current page.
The main decision point is with
\doifelse{\at[ref2]}{\rawcountervalue[page]}{ sam
I’m trying to create something (like varioref in latex) that suppresses \at
output if the referenced item is on the current page. The main decision point
is with
\doifelse{\at[ref2]}{\rawcountervalue[page]}{ same page }{ different page }
no matter what I try (expdoifelse and other ways to get
note]%
\incrementcounter[authornote]\decrementcounter[authornote]% <-- authornote
is incremented and decremented to force the reset by page
>\setcounter[footnote][{\rawcountervalue[authornote]}]%
>\setupnotation[footnote][numberconversion=set 1]%
>\foot
every page (way=bypage).
-
\setupnotation[footnote][way=bypage]
\definecounter[authornote][way=bypage]
% taken and adapted from
https://www.mail-archive.com/ntg-context@ntg.nl/msg56637.html
\define[1]\authorNote{\bgroup%
\savecounter[footnote]%
\setcounter[footnote][{\rawcountervalue
e".
>> \startsetups[testlayer]
>> \setlayer[test2]{page2}
>> \stopsetups
> You have to include a check for the first page, possible are
>
> \startsetups[testlayer]
> \doifnot{\rawcountervalue[userpage]}{1}{\setlayer[test2]{page2}}
> \stopsetups
ospace font as fallback.
\definelayer[test2][x=.5\paperwidth, y=.5\paperheight, state=continue]
Remove "state=continue".
\startsetups[testlayer]
\setlayer[test2]{page2}
\stopsetups
You have to include a check for the first page, possible are
\startsetups[testlayer]
\ifnum\rawcount
, it prints the value of the counter that
the footnote had in the previous page, when it should produce a new
\footnote instead for the new page.
Running this example should show the problem more clearly:
\setupnotation[way=bypage]
\def\showcountersinmargin#1{%
\inmargin{\rawcountervalue[contapag#1
BTW: The names for the counter commands are \...counter, e.g.
\definecounter[testcounter][way=bypage]
\define\TestCounter
{\incrementcounter[testcounter]
%\convertedcounter[testcounter]
\rawcountervalue [testcounter]}
\starttext
\dorecurse{3}{\TestCounter\page}
\stoptext
Hello list,
consider this example, involving a number (counter) to be reset at each
page:
\starttext
\definenumber[MyNumber][way=bypage] % MyNumber=0
\incrementnumber[MyNumber] % MyNumber=1
\incrementnumber[MyNumber] % MyNumber=2
mynumber is \rawcountervalue[MyNumber]. % prints 2
\page % MyNumber
Hi MF,
You should use \rawcountervalue instead of \getnumber, as in the following:
\starttext
\definenumber[numero][]
\setnumber[numero][42]
The value of {\tt numero} is \getnumber[numero].
The value of {\tt numero} is \rawnumber[numero].
The value of {\tt numero} is \rawcountervalue[numero
Thanks Otared,
I've added this example to http://wiki.contextgarden.net/Counters
Best regards,
MF
Hi MF,
You should use \rawcountervalue instead of \getnumber, as in the
following:
\starttext
\definenumber[numero][]
\setnumber[numero][42]
The value of {\tt numero} is \getnumber
put the layer settings in a setups environment and flush the content
when the page backgrounds are applied
with the setups key for \setupbackground.
\definelayer[letterhead][width=\paperwidth,height=\paperheight]
\startsetups[letterhead]
\ifnum\rawcountervalue[userpage]=1
On Thu, 12 Mar 2015 22:59:33 +0100
Hans Hagen pra...@wxs.nl wrote:
Supplementary question, just for fun:
how to specify title=Footnote if there is only one?
\startsetups chapter:after
\ifcase\rawcountervalue[footnote]\relax
\or
\startsubject[title=Footnote
to
have empty Footnotes subjects appearing in my document.
Supplementary question, just for fun:
how to specify title=Footnote if there is only one?
\startsetups chapter:after
\ifcase\rawcountervalue[footnote]\relax
\or
\startsubject[title=Footnote]
\placefootnotes
to access the counter with \rawcountervalue[countername] but in your
case you can use a different counter mechanism.
\setvariables[slide][list={1,2,3,6,7,8}]
%
\setupbackgrounds[page][background={fond,Auteur,backgraphics,foreground,foregraphics}]
\def\startSlide
{\increment\SlideCounter
to an enumeration
or an item?
You can use \rawcountervalue[name of the enumeration environment] or
\convertedcounter[name of the environment].
Also, if I understand correctly, the command
\increment\QuestionCounter
creates first a counter named QuestionCounter, if it does not exist yet
[test]
\starttext
\bTABLE
\dorecurse{8}{
\bTR
\dorecurse{5}{\bTD \rawcountervalue[test]\incrementnumber[test] \eTD}
\eTR
}
\eTABLE
\stoptext
Thanks
Jannik Voges
signature.asc
Description: Message signed with OpenPGP using GPGMail
I
get the desired numbers?
\definenumber[test]
\starttext
\bTABLE
\dorecurse{8}{
\bTR
\dorecurse{5}{\bTD \rawcountervalue[test]\incrementnumber[test] \eTD}
\eTR
}
\eTABLE
\stoptext
Change that to:
\rawcountervalue[test]\iftrialtypesetting\else\incrementnumber[test]\fi
example,
I get numbers between 80 and 119, I would expect numbers between 0 and 39.
How can I get the desired numbers?
\definenumber[test]
\starttext
\bTABLE
\dorecurse{8}{
\bTR
\dorecurse{5}{\bTD \rawcountervalue[test]\incrementnumber[test] \eTD}
\eTR
}
\eTABLE
(red)
end
end
\stopluacode
\def\PageColor%
{\ctxlua{thirddata.getpagecolor(\rawcountervalue[userpage])}}
\setupbackgrounds[page][background=color, backgroundcolor=\PageColor]
\setuppapersize[S3]
\starttext
\dorecurse{10}{\input knuth \par}
\stoptext
You can also use a lua table to assign
then
context(red)
end
end
\stopluacode
\def\PageColor%
{\ctxlua{thirddata.getpagecolor(\rawcountervalue[userpage])}}
\setupbackgrounds[page][background=color, backgroundcolor=\PageColor]
\setuppapersize[S3]
\starttext
\dorecurse{10}{\input knuth \par}
\stoptext
You
:
\rawcountervalue[definition]/\convertedcounter[definition][prefix=yes,prefixsegments=chapter]
In \in{Definition}[definition:1] blabla ...
\stoptext
Wolfgang
___
If your question is of interest to others as well, please add
[backgroundimage]
[{\ifnum\rawcountervalue[userpage]=1\relax
\overlayfigure{Cover}%
\else
\overlayfigure{Background}%
\fi}]
\setupbackgrounds[page][background=backgroundimage]
\starttext
\dorecurse{4}{\input knuth\page}
\stoptext
Wolfgang
On Mon, 2012-07-09 at 10:06 +0200, Wolfgang Schuster wrote:
\setupexternalfigures[directory=Makeup/Images]
\defineoverlay
[backgroundimage]
[{\ifnum\rawcountervalue[userpage]=1\relax
\overlayfigure{Cover}%
\else
\overlayfigure{Background}%
\fi
]{\convertedcounter[ParagraphCounter]}}}
\protect
\starttext
\markParagraph[mark=aaa]
\input tufte
\markParagraph[mark=bbb]
\input tufte
\markParagraph[mark=ccc]
Should be 1: \in[aaa]
Should be 2: \in[bbb]
Should be 3: \in[ccc]
\stoptext
you need to use expandable macros like \rawcountervalue
68 matches
Mail list logo