* Chapter number with Luametafun
@ 2020-08-18 14:24 Fabrice Couvreur
2020-08-18 14:37 ` Wolfgang Schuster
0 siblings, 1 reply; 2+ messages in thread
From: Fabrice Couvreur @ 2020-08-18 14:24 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 1016 bytes --]
Hello,
How to get the number of the current chapter ?
How to get the label "Chapitre" ?
Thanks for your help.
Fabrice
%%% Begin example
\mainlanguage[fr]
\setcharacterspacing [frenchpunctuation]
\setuplabeltext[fr][chapter=Chapitre~]
\startuseMPgraphic{fun}
definecolor[name="Mycolor", s = 0.85 ]
draw lmt_outline
[
text = "1",
kind = "fillup",
fillcolor = "Mycolor",
rulethickness = 1,
]
xsized 1cm;
\stopuseMPgraphic
\unexpanded\def\MyNumber#1{\useMPgraphic{fun}#1}
\unexpanded\def\Title#1#2{\framed[frame=off,width=fit,align=flushleft]
{#1\blank#2}}
\setuphead[chapter]
[style=\bfd,
align={flushleft,broad},
command=\Title,
textcommand=\MyNumber,
numbercommand=\groupedcommand{}{\MyNumber},
number=no]
\starttext
\startchapter
[title={First chapter}]
\input knuth.tex
\stopchapter
\startchapter
[title={Second chapter}]
\input knuth.tex
\stopchapter
\stoptext
%%% end example
[-- Attachment #1.2: Type: text/html, Size: 2591 bytes --]
[-- Attachment #2: Type: text/plain, Size: 493 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://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-08-18 14:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-18 14:24 Chapter number with Luametafun Fabrice Couvreur
2020-08-18 14:37 ` 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).