[NTG-context] METAFUN+CONTEXT+CUSTOMIZE
Hi everyone. I would like to pose the following question: I would like to know how I can customize the page number using an embedded graphic made with METAFUN. I mean, I wish someone would send me a simple example to do that, for example, a page number or headers (chapter, section, etc..) may appear with a color background or something else. The METAFUN manual provides, for example, the page number within an ellipse, and the sections are underlined in orange. Thank you all for your patience and sorry for my poor English and my poor knowledge of ConTeXt, but I'm studying hard reference manuals ConTeXt and hope to go slowly improving, although I am not expert in computer programming languages or even less in mathematics. Thanks very much.-- Manuel González Suárez ___ 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 ___
Re: [NTG-context] METAFUN+CONTEXT+CUSTOMIZE
Am 02.05.2013 um 23:31 schrieb MANUEL GONZALEZ SUAREZ gonzalezsman...@uniovi.es: Hi everyone. I would like to pose the following question: I would like to know how I can customize the page number using an embedded graphic made with METAFUN. I mean, I wish someone would send me a simple example to do that, for example, a page number or headers (chapter, section, etc..) may appear with a color background or something else. The METAFUN manual provides, for example, the page number within an ellipse, and the sections are underlined in orange. Thank you all for your patience and sorry for my poor English and my poor knowledge of ConTeXt, but I'm studying hard reference manuals ConTeXt and hope to go slowly improving, although I am not expert in computer programming languages or even less in mathematics. Thanks very much. These are only simple styles but the show how you can customize the heading and pagenumber. \define[2]\ChapterCommand {\startframed[frame=off,bottomframe=on,framecolor=orange,width=fit] #1\hspace[medium]#2 \stopframed} \setuphead[chapter][command=\ChapterCommand] \startuseMPgraphic{pagenumber} draw fullcircle xyscaled(OverlayWidth,OverlayHeight) withcolor \MPcolor{blue} ; \stopuseMPgraphic \defineoverlay[pagenumber][\useMPgraphic{pagenumber}] \define[1]\PagenumberCommand {\framed[frame=off,background=pagenumber]{#1}} \setuppagenumbering[command=\PagenumberCommand] \starttext \chapter{This is a chapter} \stoptext 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 ___
[NTG-context] METAFUN+CONTEXT+CUSTOMIZE
Wolfgang Thanks for your help.Your definition to customize the number of page works, but the command definition \ ChapterCommand gives me a compilation error. (with LuaTeX and MKIV).Thank you again. Now I see that is a bit more complicated than I imagined.Greetings.-- Manuel González Suárez ___ 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 ___
Re: [NTG-context] METAFUN+CONTEXT+CUSTOMIZE
Am 03.05.2013 um 00:27 schrieb MANUEL GONZALEZ SUAREZ gonzalezsman...@uniovi.es: Wolfgang Thanks for your help. Your definition to customize the number of page works, but the command definition \ ChapterCommand gives me a compilation error. (with LuaTeX and MKIV). I guess you’re using a older context version (TeXLive 2012?) where you have to use \unexpanded\def\ChapterCommand#1#2{…} 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 ___
[NTG-context] METAFUN+CONTEXT+CUSTOMIZE
I use TeXLive 2011 and I get the following error (the file name is custo.tex):mtx-context | warning: synctex is enabled mtx-context | run 1: luatex --synctex=1 --fmt=C:/texlive/2011/texmf-var/luatex-cache/context/210a96fef5fbab446fd11afa77acb026/formats/cont-en --lua=C:/texlive/2011/texmf-var/luatex-cache/context/210a96fef5fbab446fd11afa77acb026/formats/cont-en.lui --backend=pdf ./custo.tex This is LuaTeX, Version beta-0.70.1-2011061421 (rev 4277) \write18 enabled. (custo.tex ConTeXt ver: 2011.05.18 18:04 MKIV fmt: 2013.4.23 int: english/english system cont-new.mkiv loaded (C:/texlive/2011/texmf-dist/tex/context/base/cont-new.mkiv system beware: some patches loaded from cont-new.mkiv ) system custo.top loaded (custo.top) fontslatin modern fonts are not preloaded languageslanguage en is active {C:/texlive/2011/texmf-dist/fonts/map/pdftex/context/mkiv-base.map} fontspreloading latin modern fonts (second stage) (C:/texlive/2011/texmf-dist/tex/context/base/type-siz.mkiv) (C:/texlive/2011/texmf-dist/tex/context/base/type-otf.mkiv){C:/texlive/2011/texmf-dist/fonts/map/dvips/lm/lm-math.map}{C:/texlive/2011/texmf-dist/fonts/map/dvips/lm/lm-rm.map} fontsvirtual math unable to resolve name mapsfromchar fontsfallback modern rm 12pt is loaded system begin file custo.tex at line 18 structuresectioning chapter @ level 2 : 0.1 - This is a chapter ! Undefined control sequence. system tex error on line 19 in file custo.tex: Undefined control sequence ... 9 \stopuseMPgraphic 10 11 \defineoverlay[pagenumber][\useMPgraphic{pagenumber}] 12 13 \define[1]\PagenumberCommand 14 {\framed[frame=off,background=""> 15 16 \setuppagenumbering[command=\PagenumberCommand] 17 18 \starttext 19 \chapter{This is a chapter} 20 \stoptext \ChapterCommand #1#2-\startframed [frame=off,bottomframe=on,framecolor=oran... \placestructureheadnumbertext ...uctureheadtitle } }\fi \endheadplacement {\g... \dohandlestructurehead ...structureheadnumbertext \else \placestructureheadt... l.19 \chapter{This is a chapter} ? ! Undefined control sequence. system tex error on line 19 in file custo.tex: Undefined control sequence ... 9 \stopuseMPgraphic 10 11 \defineoverlay[pagenumber][\useMPgraphic{pagenumber}] 12 13 \define[1]\PagenumberCommand 14 {\framed[frame=off,background=""> 15 16 \setuppagenumbering[command=\PagenumberCommand] 17 18 \starttext 19 \chapter{This is a chapter} 20 \stoptext \ChapterCommand ...\hspace [medium]#2 \stopframed \placestructureheadnumbertext ...uctureheadtitle } }\fi \endheadplacement {\g... \dohandlestructurehead ...structureheadnumbertext \else \placestructureheadt... l.19 \chapter{This is a chapter} ? metapost initializing instance 'metafun' using format 'metafun' metapost loading 'metafun.mp' (experimental metapost version two) backend xmp using file 'C:/texlive/2011/texmf-dist/tex/context/base/lpdf-pdx.xml' pagesflushing realpage 1, userpage 1, subpage 1 system end file custo.tex at line 20 )C:/texlive/2011/texmf-dist/fonts/opentype/public/lm/lmroman12-regular.otf mkiv lua stats used config file - selfautoparent:/texmfcnf.lua;selfautoparent:/texmf/web2c/texmfcnf.lua mkiv lua stats used cache path - readable: 'C:/texlive/2011/texmf-var/luatex-cache/context/210a96fef5fbab446fd11afa77acb026' (order 1) mkiv lua stats used cache path - writable: 'C:/texlive/2011/texmf-var/luatex-cache/context/210a96fef5fbab446fd11afa77acb026' mkiv lua stats synctex tracing - synctex has been enabled (extra log file generated) mkiv lua stats input load time - 0.314 seconds mkiv lua stats stored bytecode data - 285 modules, 60 tables, 345 chunks mkiv lua stats cleaned up reserved nodes - 33 nodes, 9 lists of 423 mkiv lua stats node memory usage - 27 glue_spec mkiv lua stats node list callback tasks - 6 unique task lists, 5 instances (re)created, 2385 calls mkiv lua stats used backend - pdf (backend for directly generating pdf output) mkiv lua stats loaded patterns - en::2 mkiv lua stats callbacks - 2542 direct, 2985 indirect, 5527 total mkiv lua stats randomizer- resumed with value 0.59913937803278 mkiv lua stats lxml preparation time - 0.000 seconds, 0 nodes, 15 lpath calls, 0 cached calls mkiv lua stats result saved in file - custo.pdf mkiv
Re: [NTG-context] METAFUN+CONTEXT+CUSTOMIZE
Am 03.05.2013 um 00:45 schrieb MANUEL GONZALEZ SUAREZ gonzalezsman...@uniovi.es: I use TeXLive 2011 and I get the following error (the file name is custo.tex): Use this definition \define[2]\ChapterCommand {\framed [frame=off,bottomframe=on,framecolor=orange,width=fit] {#1\hspace[medium]#2}} In newer versions (the environment form was added a few months ago) you can use \startframed … \stopframed instead of \framed{…} which makes it easier to format code when \framed has more content. 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 ___