Re: [NTG-context] counter values as label names
On Mon, 3 Jan 2011, Daniel Schopper wrote: First of all thanks for the advice and sorry for my naïve posting! Here's a test file for what I try to do. The problem is that the page- and linenumbers printed by \placefootnotes all take the values of the last reference. \setupfootnotes[ location=text, numberconversion=empty, paragraph=, ] \newcount\entrycounter \entrycounter=0 \def\appentry#1#2{% \startline[line:\the\entrycounter]% \pagereference[page:\the\entrycounter]% #1% \stopline[line:\the\entrycounter]% \footnote{{\bf \at[page:\the\entrycounter]} \inline[line:\the\entrycounter] #1] #2}}% \advance\entrycounter by1% \starttext\startlinenumbering This is a sample \appentry{paragraph}{om. h1}.\\ An this is another \appentry{one}{sentence}. \stoplinenumbering \bigskip Endnotes \placefootnotes \stoptext Finally: is the format of your apparatus (endnotes) a requirement? Yes, unfortunately it is. I am not sure what you want to do, but the following at least increments the references (in MKIV) \setupfootnotes [ location=text, numberconversion=empty, paragraph=, ] \newcount\entrycounter \entrycounter=0 \def\appentry#1#2% {\expanded {\startline[line:\the\entrycounter]% \noexpand\pagereference[page:\the\entrycounter]% #1% \noexpand\stopline[line:\the\entrycounter]% \noexpand\footnote{{\bf \at[page:\the\entrycounter]} \inline[line:\the\entrycounter] #1 #2}}% \advance\entrycounter by 1\relax} \starttext \startlinenumbering This is a sample \appentry{paragraph}{om. h1}. \crlf An this is another \appentry{one}{sentence}. \stoplinenumbering \bigskip Endnotes \placefootnotes \stoptext Aditya ___ 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] counter values as label names
On Jan 3, 2011, at 7:09 PM, Daniel Schopper wrote: > \setupfootnotes[ > location=text, > numberconversion=empty, > paragraph=, > ] > \newcount\entrycounter > \entrycounter=0 > \def\appentry#1#2{% > \startline[line:\the\entrycounter]% > \pagereference[page:\the\entrycounter]% > #1% > \stopline[line:\the\entrycounter]% > \footnote{{\bf \at[page:\the\entrycounter]} > \inline[line:\the\entrycounter] #1] #2}}% > \advance\entrycounter by1% > \starttext\startlinenumbering > This is a sample \appentry{paragraph}{om. h1}.\\ > An this is another \appentry{one}{sentence}. > \stoplinenumbering > \bigskip > Endnotes > \placefootnotes > \stoptext Tricky. I can't figure out how to do it. First, the code you write can never work. You define a \newcount and set it to 0. Before your text starts, you increase this count, so now its value is 1. Then, you never touch this value again, so effectively, all your references expand to page:1 and line:1. (And, on top of it all, your file has only one line since \\ doesn't start a new line.) But even if you try to increment your counter within the definition of your macro, it won't work because it will be advanced and frozen by the time your footnotes are typeset. So this approach will not work, I'm afraid. I'm not sure this can be done in ConTeXt. Thomas ___ 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] counter values as label names
First of all thanks for the advice and sorry for my naïve posting! Here's a test file for what I try to do. The problem is that the page- and linenumbers printed by \placefootnotes all take the values of the last reference. \setupfootnotes[ location=text, numberconversion=empty, paragraph=, ] \newcount\entrycounter \entrycounter=0 \def\appentry#1#2{% \startline[line:\the\entrycounter]% \pagereference[page:\the\entrycounter]% #1% \stopline[line:\the\entrycounter]% \footnote{{\bf \at[page:\the\entrycounter]} \inline[line:\the\entrycounter] #1] #2}}% \advance\entrycounter by1% \starttext\startlinenumbering This is a sample \appentry{paragraph}{om. h1}.\\ An this is another \appentry{one}{sentence}. \stoplinenumbering \bigskip Endnotes \placefootnotes \stoptext Finally: is the format of your apparatus (endnotes) a requirement? Yes, unfortunately it is. Thanks again, Daniel ___ 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] counter values as label names
On Jan 3, 2011, at 3:11 PM, Daniel Schopper wrote: > Dear list, > this seems a really basic question (and probably not even strictly > ConTeXt-focused) - so please accept my apologies… > > I'm trying to construct a macro which first creates two labels in the text > (\start/stopline and \pagereference) with the value of a counter as the label > name and then a footnote which prints the page and line numbers of those two. > Supposedly because of my limited understanding of TeX's expansion mechanism I > haven't been able to get things working with this code: > > \setuplinenumbering[% > location=inner, > step=5, >method=page, >style=\tfxx, >align=left, >distance=1.5cm, >width=0.3cm] > \setupfootnotes[ > location=text, > numberconversion=empty, > paragraph=yes, > ] > \definenumber[entrycounter] > \setnumber[entrycounter]{0} > \def\appentry#1#2{% > \startline[line:\getnumber[entrycounter]]% > \pagereference[page:\getnumber[entrycounter]]% > #1% > \stopline[line:\getnumber[entrycounter]]% > \footnote{{\bf \at[page:\getnumber[entrycounter]]}% > \inline[line:\getnumber[entrycounter]] #1] #2}% > \incrementnumber[entrycounter]% > } > > By now I tried to adapt a LaTeX-only-solution which Uwe Lueck suggested on > the texhax-mailinglist some years ago (cf. > http://tug.org/pipermail/texhax/2006-July/006599.html) but failed quite > miserably. > I also tried the same with plain TeX registers (\newcount\entrycounter > \entrycounter=0 etc.) instead of ConTeXt counters. > Could it be easier to stuff the \pagereference and \startline-commands into > before= and after= of setupfootnotes? > Could anyone please give me a hint on this? > The most important hint: please build test files that will compile. Take out anything which isn't relevant to your problem. Knowledgeable people on this list are quite unlikely to wade through code snippets. This page http://www.minimalbeispiel.de/mini-en.html is somewhat biased towards LaTeX, but you should get the drift. > The purpose of this: I'm trying to use mkIV's page and linenumbering > facilities for a critical apparatus (in this case endnotes with page and line > references). As I didn't succeed with Hans Hagen's recent suggestion (cf. > http://www.mail-archive.com/ntg-context@ntg.nl/msg49695.html) Again, please provide relevant information. "Didn't work" is not enough information - maybe the color of your mousepad isn't quite right, maybe you forgot a closing brace, who knows? Finally: is the format of your apparatus (endnotes) a requirement? You can try and search the mail archive for "linenotes" and have a look at strc-lnt.mkiv. This will build one (or more) apparatus at the bottom of the page; I'm not sure if those can be selected in endnotes. Thomas ___ 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] still struggling with footnotes
Hi all, I am still trying to get the footnote numbers aligned in a special way: flushright, but the width depends on the width of the max footnote-number on page, so to get 1 2 and ~9 10 After reading the manuals and the source given in strc-not.lua thats how far i am at the moment: \enabletrackers[structures.notes] \setupnote[footnote][numbercommand=, way=bypage] \setupnotedefinition[footnote][location=left,distance=1em,hang=4,headalign={flushright},width=1em] \def\getmaxnote[#1]{\ctxlua{ local n = structures.notes.getn("#1",n) local current = structures.notes.get("#1",n) local cr = current.references local result = cr.realpage -- calculate the width of cr.number and store in maxwidth -- loop through the notes until act.realpage <> cr.realpage -- and for each note calculate the width, compare with maxwidh and store the max -- then set the width to the correct maxwidth -- context.setupnotedefinition({"footnote"}, {width=maxwidth}) } } \appendtoks \getmaxnote[footnote] \to\everybeforenoteinsert \showframe \starttext \dorecurse {100} { test \footnote{test } } \stoptext Now I can not figure out how to get the "real" footnote-number of the note (is there any way?) And does this approach make sense at all? Any hints welcome, i tear my hair for hours now Greetings, Achim ___ 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] export and pagebreak
Hi Hans, thanks again. At least the first tests of the new version give me the expected result. Great!! Achim Am 03.01.2011 16:19, schrieb Hans Hagen: On 3-1-2011 4:11, Achim Jander wrote: So it would be more convenient to have filter, lump, skip, but that could be also done in the postprocessing. indeed this belongs to postprocessing (if only because there is no space at a pagebreak) .. similar would be: abcdef where is no linebreak is needed it can become a space) yes, i see. In my case it is of interest to have the same breaking in that run, so i wonder if disabling the hz feature doesn't change the line-breaking ? it does Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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] export and pagebreak
On 3-1-2011 4:11, Achim Jander wrote: So it would be more convenient to have filter, lump, skip, but that could be also done in the postprocessing. indeed this belongs to postprocessing (if only because there is no space at a pagebreak) .. similar would be: abcdef where is no linebreak is needed it can become a space) yes, i see. In my case it is of interest to have the same breaking in that run, so i wonder if disabling the hz feature doesn't change the line-breaking ? it does Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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] export and pagebreak
Am 03.01.2011 15:43, schrieb Hans Hagen: On 3-1-2011 12:54, Achim Jander wrote: - would it possible to switch both (spaces and pagebreak) to on? It seems that in the Moment only one of them can be enabled. does not make much sense as equals anyway (the default is a space) Hi Hans, maybe i got something wrong, but in the given example I have now filter, lump,skip, My intent is, to convert the XML eg to EPUB and use the to give the desired Metadata. So it would be more convenient to have filter, lump, skip, but that could be also done in the postprocessing. - would it be possible to include the pagenumber as attribute? maybe, keep in mind that we cannot really structure by page as elements can span page boundaries of course, its only a nice-to have, it could get calculated in the postprocessing maybe some attributes gets lost in the hz machinery ... needs checking (in most cases doing a special export run makes sense, in which case some functionality can be turned off) yes, i see. In my case it is of interest to have the same breaking in that run, so i wonder if disabling the hz feature doesn't change the line-breaking ? Thanks, Achim ___ 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] How to get numbered cases'ed equations ?
Hi, Maybe someone had the same problem, no ? Best regards. -- Cédric On Tue, Dec 21, 2010 at 09:19, Cedric Mauclair wrote: > On Mon, Dec 20, 2010 at 16:45, Cedric Mauclair > wrote: >> Hi list, >> >> How can I get a numbered equation when using cases in MkIV? The "hack" >> proposed by Aditya in [1] doesn't work as it uses macros that no >> longer exist (\makesesctionnumber and others). The reference doesn't >> even get recorded. I precise that I don't want (well, don't need) the >> sub numbering per-line, just a regular number would do. >> >> Minimal example: >> >> \starttext >> >> My equation \in[eq:equation] and my other equation \in[eq:other-equation]. >> >> \placeformula[eq:equation] >> \startformula >> E = mc^2 >> \stopformula >> >> \placeformula[eq:equation] > Typo \placeformula[eq:other-equation]. Still doesn't work. >> \startformula >> \startcases >> \NC E = mc^2 \NC some text\NR >> \NC E = mc^2 \NC some more text\NR >> \stopcases >> \stopformula >> >> \stoptext >> >> >> Thanks. >> >> >> [1] http://dl.contextgarden.net/myway/mathalign.pdf >> >> -- Cédric >> > ___ 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] export and pagebreak
On 3-1-2011 12:54, Achim Jander wrote: - would it possible to switch both (spaces and pagebreak) to on? It seems that in the Moment only one of them can be enabled. does not make much sense as equals anyway (the default is a space) - would it be possible to include the pagenumber as attribute? maybe, keep in mind that we cannot really structure by page as elements can span page boundaries During my tests i found a strange behaviour of the export-function (not related to pagebreak-export). With certain combinations of \setupalign[hz,hanging] and body-font-size most of the text gets eaten: maybe some attributes gets lost in the hz machinery ... needs checking (in most cases doing a special export run makes sense, in which case some functionality can be turned off) Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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] counter values as label names
Dear list, this seems a really basic question (and probably not even strictly ConTeXt-focused) - so please accept my apologies… I'm trying to construct a macro which first creates two labels in the text (\start/stopline and \pagereference) with the value of a counter as the label name and then a footnote which prints the page and line numbers of those two. Supposedly because of my limited understanding of TeX's expansion mechanism I haven't been able to get things working with this code: \setuplinenumbering[% location=inner, step=5, method=page, style=\tfxx, align=left, distance=1.5cm, width=0.3cm] \setupfootnotes[ location=text, numberconversion=empty, paragraph=yes, ] \definenumber[entrycounter] \setnumber[entrycounter]{0} \def\appentry#1#2{% \startline[line:\getnumber[entrycounter]]% \pagereference[page:\getnumber[entrycounter]]% #1% \stopline[line:\getnumber[entrycounter]]% \footnote{{\bf \at[page:\getnumber[entrycounter]]}% \inline[line:\getnumber[entrycounter]] #1] #2}% \incrementnumber[entrycounter]% } By now I tried to adapt a LaTeX-only-solution which Uwe Lueck suggested on the texhax-mailinglist some years ago (cf. http://tug.org/pipermail/texhax/2006-July/006599.html) but failed quite miserably. I also tried the same with plain TeX registers (\newcount\entrycounter \entrycounter=0 etc.) instead of ConTeXt counters. Could it be easier to stuff the \pagereference and \startline-commands into before= and after= of setupfootnotes? Could anyone please give me a hint on this? The purpose of this: I'm trying to use mkIV's page and linenumbering facilities for a critical apparatus (in this case endnotes with page and line references). As I didn't succeed with Hans Hagen's recent suggestion (cf. http://www.mail-archive.com/ntg-context@ntg.nl/msg49695.html) I tried this quick and dirty way. Although it's far away from being perfect (in an ideal world the endnotes should be grouped into one paragraph per page and of course there would be more then one apparatus and so on) this seems to be a first approach to me… Cheers, Daniel ___ 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] export and pagebreak
Am 02.01.2011 15:57, schrieb Hans Hagen: On 31-12-2010 7:22, Achim Jander wrote: is it possible to get a into the exported XML? I'll send you a small patch to play wit Hello Hans, many thanks! I've tested a bit and it seems to work great! Two little suggestions for improvement: - would it possible to switch both (spaces and pagebreak) to on? It seems that in the Moment only one of them can be enabled. - would it be possible to include the pagenumber as attribute? During my tests i found a strange behaviour of the export-function (not related to pagebreak-export). With certain combinations of \setupalign[hz,hanging] and body-font-size most of the text gets eaten: \setupbackend [export=yes] \enabledirectives[structures.export.pagebreaks] \definefontfeature[default][default][% expansion=quality, protrusion=quality, ] \setupbodyfont[rm,8.5pt] %\setupbodyfont[rm,11pt] %does not work either %\setupbodyfont[rm,12pt] %this is ok \definebodyfontenvironment[8.5pt][% text=8.5pt, script=8.5pt, scriptscript=6pt, x=6pt, xx=5pt, big=28pt, small=17.3pt] \setupalign[hz,hanging] %without everything ok \starttext \input tufte \stoptext that gives the export: context='2010.12.31 08:59' version='0.10'> --fiflfiglean, synopsize, winnow the wheat from the chaff and separate the sheep from the goats. Either switching the body-font-size to 12pt or disable the \align gives the full export as expected. Very confusing. Greetings, Achim - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 ___ ___ 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] \pagenumber geeft altijd 1
2011/1/3 Wolfgang Schuster : > You stop pagenumbering and wonder why context doesn’t report the current > pagenumber. > > Line 15: \setuppagenumbering[state=stop] I thought that \setuplayout[pagenumbers] took care of that. I changed UsePageNumbers to: \def\UsePageNumbers{ \setuppagenumbering[state=start] \setuplayout[pagenumbers] \setupfootertexts[Pagina \pagenumber \space van \lastpage] } And now it works. Thanks. -- Cecil Westerhof ___ 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] Working with conditionals
2011/1/3 Vianney le Clément : > \def\Title{\dodoubleempty\doTitle} > \def\doTitle[#1][#2]{ > \ifsecondargument > \testpage[#2] > \else > \testpage[10] > \fi > \startalignment[center] > { > \blank[2*big] > \switchtobodyfont[1.5em] > \bf\em#1 > } > \blank > \stopalignment > } Works, thanks. -- Cecil Westerhof ___ 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] \pagenumber geeft altijd 1
Hello, \UsePageNumbers must be after \starttext \starttext \UsePageNumbers Is working... Jaroslav Dne 3.1.2011 11:54, Jaroslav Hajtmar napsal(a): Hello Cecil, Are you calling \UsePageNumbers macro at start? I don't see any problem ... For example this short code is working: \setupfootertexts[Page \pagenumber \space of \lastpage] \starttext \dorecurse{20}{\input tufte } \stoptext Jaroslav Dne 3.1.2011 10:32, Cecil Westerhof napsal(a): \def\UsePageNumbers{ \setuplayout[pagenumbers] \setupfootertexts[Page \pagenumber \space of \lastpage] } ___ 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 ___ ___ 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] \pagenumber geeft altijd 1
Am 03.01.2011 um 11:53 schrieb Cecil Westerhof: > Attached are the tex and pdf file. You stop pagenumbering and wonder why context doesn’t report the current pagenumber. Line 15: \setuppagenumbering[state=stop] 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 ___
Re: [NTG-context] \pagenumber geeft altijd 1
2011/1/3 Wolfgang Schuster : > > Am 03.01.2011 um 10:32 schrieb Cecil Westerhof: > >> I am using the folowing code: >> \def\UsePageNumbers{ >> \setuplayout[pagenumbers] >> \setupfootertexts[Page \pagenumber \space of \lastpage] >> } >> >> The number of pages is displayed correctly, but the pagenumber is >> always 1. What am I doing wrong? > > Make a complete example, you don’t where you call the \UsePageNumbers. Attached are the tex and pdf file. -- Cecil Westerhof test.tex Description: TeX document test.pdf Description: Adobe PDF document ___ 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] \pagenumber geeft altijd 1
Hello Cecil, Are you calling \UsePageNumbers macro at start? I don't see any problem ... For example this short code is working: \setupfootertexts[Page \pagenumber \space of \lastpage] \starttext \dorecurse{20}{\input tufte } \stoptext Jaroslav Dne 3.1.2011 10:32, Cecil Westerhof napsal(a): \def\UsePageNumbers{ \setuplayout[pagenumbers] \setupfootertexts[Page \pagenumber \space of \lastpage] } ___ 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] \pagenumber geeft altijd 1
Am 03.01.2011 um 10:32 schrieb Cecil Westerhof: > I am using the folowing code: > \def\UsePageNumbers{ > \setuplayout[pagenumbers] > \setupfootertexts[Page \pagenumber \space of \lastpage] > } > > The number of pages is displayed correctly, but the pagenumber is > always 1. What am I doing wrong? Make a complete example, you don’t where you call the \UsePageNumbers. 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 ___
Re: [NTG-context] Working with conditionals
On Mon, Jan 3, 2011 at 11:05 AM, luigi scarso wrote: > You can also use a key/value approach, which is more flexible > > \unprotect > \def\Title[#1]{ > \getparameters[CecWes@@][param1={default},param2={default2}, > param3={default3},#1] > \testpage[10] > \startalignment[center] > { > \blank[2*big] > \switchtobodyfont[1.5em] > \bf\em\getvalue{CecWes@@param1} > } > \blank > \stopalignment > } > \protect > > > \starttext > > %% param1= FOO, param2=BOO, param3=default3 > %% the order is not important > \Title[param2={BOO},param1={BOO}] sorry, typo^^^ > \Title[param2={BOO},param1={FOO}] -- luigi ___ 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] Working with conditionals
2011/1/3 Vianney le Clément : > \def\Title{\dodoubleempty\doTitle} > \def\doTitle[#1][#2]{ > \ifsecondargument > \testpage[#2] > \else > \testpage[10] > \fi > \startalignment[center] > { > \blank[2*big] > \switchtobodyfont[1.5em] > \bf\em#1 > } > \blank > \stopalignment > } > > Vianney > > On Mon, Jan 3, 2011 at 10:46, Cecil Westerhof wrote: >> I have the folowing function for a title: >> \def\Title[#1]{ >> \testpage[10] >> \startalignment[center] >> { >> \blank[2*big] >> \switchtobodyfont[1.5em] >> \bf\em#1 >> } >> \blank >> \stopalignment >> } >> >> What I would like is that there is an optional second parameter. When >> it is there, it is used in the testpage command. Otherwise the default >> value is used. How would I do this? >> >> -- >> Cecil Westerhof >> ___ >> 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 >> ___ >> > ___ > 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 > ___ > You can also use a key/value approach, which is more flexible \unprotect \def\Title[#1]{ \getparameters[CecWes@@][param1={default},param2={default2}, param3={default3},#1] \testpage[10] \startalignment[center] { \blank[2*big] \switchtobodyfont[1.5em] \bf\em\getvalue{CecWes@@param1} } \blank \stopalignment } \protect \starttext %% param1= FOO, param2=BOO, param3=default3 %% the order is not important \Title[param2={BOO},param1={BOO}] . \stoptext -- luigi ___ 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] Working with conditionals
\def\Title{\dodoubleempty\doTitle} \def\doTitle[#1][#2]{ \ifsecondargument \testpage[#2] \else \testpage[10] \fi \startalignment[center] { \blank[2*big] \switchtobodyfont[1.5em] \bf\em#1 } \blank \stopalignment } Vianney On Mon, Jan 3, 2011 at 10:46, Cecil Westerhof wrote: > I have the folowing function for a title: > \def\Title[#1]{ > \testpage[10] > \startalignment[center] > { > \blank[2*big] > \switchtobodyfont[1.5em] > \bf\em#1 > } > \blank > \stopalignment > } > > What I would like is that there is an optional second parameter. When > it is there, it is used in the testpage command. Otherwise the default > value is used. How would I do this? > > -- > Cecil Westerhof > ___ > 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 > ___ > ___ 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] How to use boxit MetaPost macros with ConTeXt minimals?
Hi, I'd like to use the boxit MetaPost macros with ConTeXt minimals. Is there a way to tackle this or do I need the chart module for that. Am I right in saying that the boxit macros give more flexibility compared to the chart module? Or is it just a matter of taste? Regards, Gerard Verhaag ___ 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] Working with conditionals
I have the folowing function for a title: \def\Title[#1]{ \testpage[10] \startalignment[center] { \blank[2*big] \switchtobodyfont[1.5em] \bf\em#1 } \blank \stopalignment } What I would like is that there is an optional second parameter. When it is there, it is used in the testpage command. Otherwise the default value is used. How would I do this? -- Cecil Westerhof ___ 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] How to get graph module (metapost) to work with ConTeXt minimals?
Wolfgang Schuster wrote: Am 31.12.2010 um 10:36 schrieb Verhaag, G.C.H.M.: So I understand that both statements: \loadmarkfile{m-graph} \usemodule[graph] are actually the same thing! Both work but they are not the same thing. \loadmarkfile loads only the given file with the extension “mkii” MkII and “mkiv” for MkIV and only used in modules. \usemodule does a lot more than this, the first is that it checks for the given module with different prefixes (the graph module has a “m-” prefix which means it’s a core module) and it also looks for file with different extension, this means it doesn’t matter if the module is called m-graph.tex, m-graph.mkiv or even t-graph.mkiv, \usemodule will always load the module while \loadmarkfile will only load m-graph.mkiv When you load a file with \loadmarkfile and the file is not present you will get a message on the terminal to give a different file name which aborts the tex run while \usemodule will only give a message on the terminal but the processing isn’t stopped, as a last thing \usemodule loads a module only once while \loadmarkfile will always read the file. Wolfgang Thanks for explaining the differences of the two statements! Regards, Gerard ___ 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] \pagenumber geeft altijd 1
I am using the folowing code: \def\UsePageNumbers{ \setuplayout[pagenumbers] \setupfootertexts[Page \pagenumber \space of \lastpage] } The number of pages is displayed correctly, but the pagenumber is always 1. What am I doing wrong? -- Cecil Westerhof ___ 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] beta: graphictext (mkiv)
Hi, Using the following code \useMPlibrary[txt] \startMPpage graphictext "FOO"; \stopMPpage results in ! Undefined control sequence. \douseMPlibrary ...stprefix #1}\makeshortfilename [\truefilename {\f!metapos... \next1 #1,->\douseMPlibrary {#1} \doprocesscommaitem \doprocesscommalist ...item \gobbleoneargument #1, ]\relax \global \advance \... l.1 \useMPlibrary[txt] ? This used to work (latest pdf is from 30.11.2010), but the macro \makeshortfilename is no longer defined in the latest beta (meta-ini.mkiv, line 853). Anyhow, I used an older backup of my tex tree to get around this. Peter ___ 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 ___