Re: [NTG-context] How to know in which page I'm?
Am 21.08.2012 um 01:56 schrieb john Culleton j...@wexfordpress.com: On Mon, 20 Aug 2012 23:09:11 +0200 Wolfgang Schuster wolfgang.schus...@gmail.com wrote: Am 20.08.2012 um 22:41 schrieb Xan dxpubl...@telefonica.net: Hi, I want to print a message depending if the page is even or odd. In pseudocode: \if \inpage.\iseven { This page is even } \else { This page is odd } How can I do that in ConTeXt? http://www.ntg.nl/pipermail/ntg-context/2012/067632.html Wolfgang Will the plain text way still work? \ifodd\pageno foo \else bar \fi This works only correct when used used in the page header or footer texts which are added after the page is finished and then you can use context’s \doifoddpageelse command. When used in the running text the test can fail when you have a text which ends at the top of the page which was processed by tex when it was on the previous page and the output was moved to the next page because there wasn’t enough space. 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] test for (negative) number
On Mon, 20 Aug 2012 20:11:32 +0200, Sietse Brouwer sbbrou...@gmail.com wrote: Hi Peter, I recommend using the following handy little idiom: \ctxlua{commands.doifelse(-45 0)}{big}{small} % small It lets you do all sorts of things that are tricky in TeX: \ctxlua{ commands.doifelse( string.len( -45 ) 5 ) }{long}{short} Cheers, Sietse ... Has been wikified - http://wiki.contextgarden.net/Command/doif...; Lukas ___ 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] Stable versions of MkIV
On Mon, Aug 20, 2012 at 6:26 PM, Sietse Brouwer wrote: Hi all, The current stable MkIV, the MkIV on the wiki, and the MkIV in TeX Live are quite different things. MkIV 2011.005.18 -- result of first-setup.sh --current MkIV 2011.10.008 -- version on the wiki MkIV 2012.005.29 -- version in TeX Live 2012, AFAICT (Mojca?) Usually it works better if you CC me since there are a lot of emails I recently skip reading (based on subject). 1. Why not declare the version in TeX Live to be stable? I know Mojca puts some work into making it as bug-free as possible. It was Hans who has put the work into it, but I don't know why he didn't release a public current release. I applied some minor patches over 2012.05.29 based on later ConTeXt version, so it's not *exactly* that version, but I had no idea what to do about the date. I have no idea how Hans uploads current versions, but I could make a zip, upload it to CTAN and make it available as current in minimals. (If I forget to do that in less than a week, please remind me.) 3. Is there a list of past stable versions somewhere? Probably the best answer would be the (unofficial) git repository: http://gitorious.org/context/context I also have a repository on https://github.com/mojca/context It's not updated though - I update from gitorious from time to time, but not automatically. I tried to make sure that even the oldest version have some consistency. I can't find one, and without it the ability to go to a specific stable version with `sh ./first-setup.sh --context=date` seems a bit useless. (Can't really imagine a use in general, though.) http://minimals.contextgarden.net/current/context/ Some time ago a new stable version came out at least once per week and betas were rare, for testing features. I think that we asked Hans not to release current versions with testing features so often, so that people don't end up with broken ConTeXt. As a consequence he started releasing betas with that pace, but sadly he forgets to release current versions every now and then :( But anyway, manually interfering and making sure that the same version as in TeX Live ends up in minimals (and on the wiki) would not be such a bad idea. 4. (Less important.) context.mkiv defines \contextversion as e.g. `2012.08.11 14:11`, but \contextversionnumber in mult-ini.mkiv still prepends a zero to the month or day. (It checks whether 08 10, which is true even if the leading zero is present.) This causes the extra zeros you saw in the version numbers above. Can this be changed without breakage ensuing? That's for Hans or Wolfgang ... Mojca ___ 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] test for (negative) number
Am 21.08.2012 um 08:32 schrieb Procházka Lukáš l...@pontex.cz: On Mon, 20 Aug 2012 20:11:32 +0200, Sietse Brouwer sbbrou...@gmail.com wrote: Hi Peter, I recommend using the following handy little idiom: \ctxlua{commands.doifelse(-45 0)}{big}{small} % small It lets you do all sorts of things that are tricky in TeX: \ctxlua{ commands.doifelse( string.len( -45 ) 5 ) }{long}{short} Cheers, Sietse ... Has been wikified - http://wiki.contextgarden.net/Command/doif…; For functions in the commands namespace you can write e.g. \ctxcommand{doifelse(…)}{…}{…} instead of \ctxlua{commands.doifelse(…)}{…}{…}. 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] Stable versions of MkIV
Am 21.08.2012 um 08:42 schrieb Mojca Miklavec mojca.miklavec.li...@gmail.com: On Mon, Aug 20, 2012 at 6:26 PM, Sietse Brouwer wrote: Hi all, The current stable MkIV, the MkIV on the wiki, and the MkIV in TeX Live are quite different things. MkIV 2011.005.18 -- result of first-setup.sh --current MkIV 2011.10.008 -- version on the wiki MkIV 2012.005.29 -- version in TeX Live 2012, AFAICT (Mojca?) Usually it works better if you CC me since there are a lot of emails I recently skip reading (based on subject). 1. Why not declare the version in TeX Live to be stable? I know Mojca puts some work into making it as bug-free as possible. It was Hans who has put the work into it, but I don't know why he didn't release a public current release. I applied some minor patches over 2012.05.29 based on later ConTeXt version, so it's not *exactly* that version, but I had no idea what to do about the date. I have no idea how Hans uploads current versions, but I could make a zip, upload it to CTAN and make it available as current in minimals. (If I forget to do that in less than a week, please remind me.) 3. Is there a list of past stable versions somewhere? Probably the best answer would be the (unofficial) git repository: http://gitorious.org/context/context I also have a repository on https://github.com/mojca/context It's not updated though - I update from gitorious from time to time, but not automatically. I tried to make sure that even the oldest version have some consistency. I can't find one, and without it the ability to go to a specific stable version with `sh ./first-setup.sh --context=date` seems a bit useless. (Can't really imagine a use in general, though.) http://minimals.contextgarden.net/current/context/ Some time ago a new stable version came out at least once per week and betas were rare, for testing features. I think that we asked Hans not to release current versions with testing features so often, so that people don't end up with broken ConTeXt. As a consequence he started releasing betas with that pace, but sadly he forgets to release current versions every now and then :( But anyway, manually interfering and making sure that the same version as in TeX Live ends up in minimals (and on the wiki) would not be such a bad idea. 4. (Less important.) context.mkiv defines \contextversion as e.g. `2012.08.11 14:11`, but \contextversionnumber in mult-ini.mkiv still prepends a zero to the month or day. (It checks whether 08 10, which is true even if the leading zero is present.) This causes the extra zeros you saw in the version numbers above. Can this be changed without breakage ensuing? That's for Hans or Wolfgang … \ifx\contextversion\undefined \def\contextversion {unknown} \def\contextversionnumber{0} \else %\def\contextversionnumber#1.#2.#3 #4:#5\relax{#1\ifnum#210 0\fi#2\ifnum#310 0\fi#3 #4:#5} \def\contextversionnumber#1.#2.#3 #4:#5\relax{#1\ifnum#210 0\fi\purenumber{#2}\ifnum#310 0\fi\purenumber{#3} #4:#5} \edef\contextversionnumber{\expandafter\contextversionnumber\contextversion\relax\space\contextmark} \fi \starttext \contextversionnumber \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 ___
Re: [NTG-context] How to know in which page I'm?
Al 20/08/12 23:09, En/na Wolfgang Schuster ha escrit: Am 20.08.2012 um 22:41 schrieb Xan dxpubl...@telefonica.net: Hi, I want to print a message depending if the page is even or odd. In pseudocode: \if \inpage.\iseven { This page is even } \else { This page is odd } How can I do that in ConTeXt? http://www.ntg.nl/pipermail/ntg-context/2012/067632.html Wolfgang Thank yoy very much, Wolfgang. Xan. ___ 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] test for (negative) number
Thanks for all the answers so far. The 'doifelse' should do the trick. I was hoping for a system macro, but if there is none, I have to program it myself. :-) Peter Am 21.08.2012 08:56, schrieb Wolfgang Schuster: Am 21.08.2012 um 08:32 schrieb Procházka Lukáš l...@pontex.cz: On Mon, 20 Aug 2012 20:11:32 +0200, Sietse Brouwer sbbrou...@gmail.com wrote: Hi Peter, I recommend using the following handy little idiom: \ctxlua{commands.doifelse(-45 0)}{big}{small} % small It lets you do all sorts of things that are tricky in TeX: \ctxlua{ commands.doifelse( string.len( -45 ) 5 ) }{long}{short} Cheers, Sietse ... Has been wikified - http://wiki.contextgarden.net/Command/doif…; For functions in the commands namespace you can write e.g. \ctxcommand{doifelse(…)}{…}{…} instead of \ctxlua{commands.doifelse(…)}{…}{…}. 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 ___ ___ 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] Stable versions of MkIV
On 20-8-2012 18:26, Sietse Brouwer wrote: The current stable MkIV, the MkIV on the wiki, and the MkIV in TeX Live are quite different things. MkIV 2011.005.18 -- result of first-setup.sh --current MkIV 2011.10.008 -- version on the wiki MkIV 2012.005.29 -- version in TeX Live 2012, AFAICT (Mojca?) 1. Why not declare the version in TeX Live to be stable? I know Mojca puts some work into making it as bug-free as possible. Yes, that was the idea .. at the same time mojca was setting up a git repository and we wanted to synchronize the stable and repository launch .. we're just too busy I guess. So, I have no problem with promoting the tl version to current. 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] Runtime Error (TeXLive and ConTeXt )
On 20-8-2012 17:21, Hrothgar Boyce wrote: TeXLive Version: 2012 (--all updated to August 20th, 2012) Platform: CYGWIN_NT-6.0 1.7.16(0.262/5/3) 2012-07-20 22:55 The attempted command which ends in an error is: texexec -o pdf 659-water-stations.tex This results in: PANIC: unprotected error in call to Lua API (zlib library version does not match - header: 1.2.5, library: 1.2.7) However /usr/include/zlib.h is for version 1.2.7, not the 1.2.5 mentioned in the error message. Any idea of how to fix this, so I can run ConTexT? It's more a pdftex error I guess. Maybe you have multiple cygwins in your paths (I remember that that gives similar issues with e.g. rsync.). 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] Stable versions of MkIV
On 21-8-2012 08:42, Mojca Miklavec wrote: Some time ago a new stable version came out at least once per week and betas were rare, for testing features. I think that we asked Hans not to release current versions with testing features so often, so that people don't end up with broken ConTeXt. As a consequence he started releasing betas with that pace, but sadly he forgets to release current versions every now and then :( I know .. the problem is that I am cleaning up all the code (the status can be seen in status-mkiv.pdf) and have to find a moment of stability as such a cleanup is often leading to temporsry issues (due to renaming) 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] Stable versions of MkIV
On 21-8-2012 09:04, Wolfgang Schuster wrote: That's for Hans or Wolfgang … \ifx\contextversion\undefined \def\contextversion {unknown} \def\contextversionnumber{0} \else %\def\contextversionnumber#1.#2.#3 #4:#5\relax{#1\ifnum#210 0\fi#2\ifnum#310 0\fi#3 #4:#5} \def\contextversionnumber#1.#2.#3 #4:#5\relax{#1\ifnum#210 0\fi\purenumber{#2}\ifnum#310 0\fi\purenumber{#3} #4:#5} \edef\contextversionnumber{\expandafter\contextversionnumber\contextversion\relax\space\contextmark} \fi \starttext \contextversionnumber \stoptext fixed - 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] test for (negative) number
... I also found another solution reposter before: \ctxlua{commands.testcase(condition)} { If true...} {If false} Note that both blocks (if-true and if-false) are mandatory. Considering Wolfgang's last answer, it would be better to write: \ctxcommand{testcase(condition)} { If true...} {If false} Lukas On Mon, 20 Aug 2012 20:11:32 +0200, Sietse Brouwer sbbrou...@gmail.com wrote: Hi Peter, I recommend using the following handy little idiom: \ctxlua{commands.doifelse(-45 0)}{big}{small} % small It lets you do all sorts of things that are tricky in TeX: \ctxlua{ commands.doifelse( string.len( -45 ) 5 ) }{long}{short} Cheers, Sietse ___ 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] test for (negative) number
On 21-8-2012 17:13, Procházka Lukáš wrote: I also found another solution reposter before: \ctxlua{commands.testcase(condition)} { If true...} {If false} yes, but testcase is an unfortunate name and sort of obsolete (so best use doifelse) - 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] Stable versions of MkIV
On Tue, Aug 21, 2012 at 11:41 AM, Hans Hagen pra...@wxs.nl wrote: I know .. the problem is that I am cleaning up all the code (the status can be seen in status-mkiv.pdf) and have to find a moment of stability as such a cleanup is often leading to temporsry issues (due to renaming) no status-mkiv.pdf in the directory; status-mkiv.tex doesn't compile because status-namespaces.lua and status-registers.lua don't exist yet. commenting those sections out solves the problem, or if you want to get fancy there's a patch below that checks if the files exist. Cheers, Sietse context.starttitle { title = messy namespaces } - local namespaces = dofile(status-namespaces.lua) +local namespaces = io.exists(status-namespaces.lua) and +dofile(status-namespaces.lua) or { } + +if not io.exists(status-namespaces.lua) then +context(\\type{status-namespaces.lua} does not exist yet.) +end for namespace, data in table.sortedhash(namespaces) do if valid[namespace] then else context(namespace) end context.par() end context.stoptitle() context.starttitle { title = messy registers } - local namespaces = dofile(status-registers.lua) +local registers = io.exists(status-registers.lua) and +dofile(status-registers.lua) or { } + +if not io.exists(status-registers.lua) then +context(\\type{status-registers.lua} does not exist yet.) +end ___ 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] subformulas: error in latest beta
Am Aug 19, 2012 um 11:55 AM schrieb Hans Hagen: You can put this in cont-new.mkiv (after \unprotect): \def\strc_formulas_handle_sub_numbering {\let\strc_formulas_handle_sub_numbering\relax % else error \doiftextelse\currentsubformulasuffix {\strc_counters_setown_sub\v!formula\plustwo\currentsubformulasuffix} {\strc_counters_increment_sub\v!formula\plustwo}% \placecurrentformulanumber} Thanks Hans! Works nicely (as always). Just as minor comment in case someone faces the same problem: There's already a \def\strc_formulas_handle_sub_numbering in cont-new.mkiv (line 36; ConTeXt ver: 2012.08.16 22:20 MKIV fmt: 2012.8.21). So to make this fix work I had to redefine / replace the original command instead of just putting it there. Cheers, Andreas ___ 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] Struggling with ConTeXt
On Tue, 21 Aug 2012, Olivier Binda wrote: 3) I'm flowing text around mathematical text with graphic ornaments (overlay) but the bounding box from metapost (red) and from TeX (black) on the following minimal example aren't the same which produce all kinds of flowing text issues. is there a way/an option for framedtexts with overlay to get the max width/height size of the main content + overlays ? Can you create a minimal example showing what you are trying to do? The following example is a bit confusing (where is \MPstring{Content} set? Why use framedtext instead of framed? What is \framed[fit] supposed to do? etc). \startusableMPgraphic{myFrame} numeric o, l, m ; path a, b ; pair c ; picture d; d = textext.rt(\MPstring{Content}) ; draw (unitsquare xyscaled (OverlayWidth,OverlayHeight) shifted (-OverlayWidth/2,-OverlayHeight/2)) withpen pencircle scaled 1pt withcolor green; You could also use draw OverlayBox withpen ... draw (d enlarged 2cm) withcolor red withpen pencircle scaled 2pt; draw boundingbox currentpicture withpen pencircle scaled .1mm dashed evenly withcolor blue ; \stopusableMPgraphic \defineoverlay[myOverlay][\useMPgraphic{myFrame}] \defineframedtext[myStatement][frame=off] \setupframedtexts[myStatement][backgroundcolor=lightgray,background=myOverlay,width=\textwidth,autowidth=force] \starttext \framed[fit]{\startmyStatement TEST \stopmyStatement} \stoptext You can try \framed[strut=no]{...} and add \setupframedtext[...][offset=overlay]. See http://wiki.contextgarden.net/Command/setupframed for details. 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 ___