Re: [NTG-context] Unexpected behavior of subsection labels
Jairo A. del Rio schrieb am 07.10.2019 um 00:18: Here is my "minimal" example. As I need fallbacks, they remain. Only the fallback for greek is needed, anything else can be removed. [...] As before, TOC shows "α Vaya" but subsection headers only show "Vaya", without Greek letters. By the way, Quivira supports Greek characters, so I don't know where the problem comes from. Below is a much shorter version of your example to demonstrate the problem. The problem is a check in the section command which fails when the character comes from a fallback font. I will post a even simpler version of the problem for Hans to fix. \setuphead [section] [conversion=g] \definefallbackfamily [mainface] [rm] [DejaVu Serif] [range=greekandcoptic] \definefontfamily [mainface] [rm] [Latin Modern Roman] \definefontfamily [mainface] [mm] [Latin Modern Math] \setupbodyfont [mainface] \starttext \placecontent \section{wow} \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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] issue with JavaScript in Acrobat
Hi Pablo, I used JS in Acrobat 7 and still have the documentation and some sample code – I don’t know if Adobe keeps it online. If you like, I can send it to you off list. Greetlings, Hraban --- https://www.fiee.net http://wiki.contextgarden.net https://www.dreiviertelhaus.de GPG Key ID 1C9B22FD ___ 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 ___
Re: [NTG-context] issue with JavaScript in Acrobat
Hi Peter, many thanks for your explanation. I’m translating (I mean, I’m trying to translate) a method that worked perfectly fine with milliseconds in ActionScript 2. This is the main reason why the transitions are recorded in milliseconds. The issue that I discovered now is that (even if I call it “milliseconds”), the time unit variable “msecs” has milliseconds only when app.setInterval is set to 1. I don’t know how to use a system clock in JS (or in Acrobat). But this is only a test to check how it works. Many thanks for the advice on setting the interval to 10 ms. I realized that I could divide the transitions by ten and it worked fine. No human can spot the difference even in 0.1 secs. That simple math operation wasn’t obvious to me (background in humanities 😅). Many thanks again for your help, Pablo On 10/7/19 1:21 PM, Peter Rolf wrote: > Hi Pablo > > Nearly no experience with JavaScript, no working Acrobat version > installed (no testing possible). So take the following with a grain of > salt... > > I guess it's just the too small call interval of the "step_clock" > function. Calling it a thousand times per second doesn't seem to work. > If the function is called a hundred times per second only, your clock > counter is also incremented only a hundred times. > > I would use a system clock value instead (difference between start time > and current time), so you can limit the call interval to a more > reasonable value (1/10s). > > > Regards, Peter > > > Am 06.10.2019 um 21:13 schrieb Pablo Rodriguez: >> Dear list, >> >> I have this minimal sample: >> >> \setupinteraction[state=start] >> \setupinteractionscreen[option=max] >> \startJSpreamble {varia} used now >> var transitions = [1000, >> 2000, >> 3000, >> 4000, >> 5000, >> 6000, >> 7000, >> 8000, >> 9000]; >> >> var msecs = 0; >> >> function step_clock() { >> try { ++msecs ; >> if ((msecs >= (transitions[this.pageNum]/10)) && ( this.pageNum >> < this.numPages )) { ++this.pageNum; }; >> } catch (e) {} >> } >> >> advance = app.setInterval ("step_clock()", 1); >> advance.count = 0; >> \stopJSpreamble >> \starttext >> \dorecurse{10}{\startTEXpage[pagestate=start, offset=1em] >> \pagenumber >> \stopTEXpage} >> \stoptext >> >> Acrobat is required. And I have an issue with it >> >> Each slide takes a full second (1000 milliseconds). But the conditional >> in step_clock() needs to divide the elements from transitions array by >> ten. Otherwise it is ten times slower. >> >> Am I missing something here? Or why is "step_clock()" ten times slower >> than it should be? >> >> Many thanks for your help, >> >> Pablo -- http://www.ousia.tk ___ 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 ___
Re: [NTG-context] Printing catchword or kustode
> Am 2019-10-07 um 19:13 schrieb Rik Kabel : > > On 8/10/2019 10:14, Hans Hagen wrote: >> On 8/10/2019 2:25 PM, Jan Ulrich Hasecke wrote: >>> Hi all, >>> >>> Visiting a museum in Straßburg I saw an old book from Gutenbergs times >>> where the >>> first word of the next page was printed below the last line of the current >>> page. >>> >>> The word, sometimes only a syllable of the first word from the next page, is >>> called catchword or Kustode. They used it to ensure that they bind the >>> pages in >>> the right order. >>> >>> I think that it can also be of help if you read a book. >>> >>> Is this possible with ConTeXt? >> not that hard to implement if really needed > > Here is a vote for implementing it. I find myself writing catchwords by hand > on speeches I have to give. An automated system of generating them would be > most welcome. > > I suggest that they should optionally be sensitive to the page spread. That > is, for two-sided documents there should be an option to print them only on > recto pages. Perhaps some tuning for length, defaulting to one word, as well. > Placement is traditionally in the bottom inside of the outside margin > (directly below the text block, flush right). > > I do not know if this practice is found in RTL languages, but I do not see > why it would not be adaptable to them as well. It is already implemented, look for the catchword module. Strangely I can’t find it ATM, but since I listed it in my book it was there, and we talked about it at the meeting. Wikipedia says, catchwords were in use *especially* in Arab books. Greetlings, Hraban --- https://www.fiee.net http://wiki.contextgarden.net https://www.dreiviertelhaus.de GPG Key ID 1C9B22FD ___ 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 ___
Re: [NTG-context] Printing catchword or kustode
On 8/10/2019 10:14, Hans Hagen wrote: On 8/10/2019 2:25 PM, Jan Ulrich Hasecke wrote: Hi all, Visiting a museum in Straßburg I saw an old book from Gutenbergs times where the first word of the next page was printed below the last line of the current page. The word, sometimes only a syllable of the first word from the next page, is called catchword or Kustode. They used it to ensure that they bind the pages in the right order. I think that it can also be of help if you read a book. Is this possible with ConTeXt? not that hard to implement if really needed Here is a vote for implementing it. I find myself writing catchwords by hand on speeches I have to give. An automated system of generating them would be most welcome. I suggest that they should optionally be sensitive to the page spread. That is, for two-sided documents there should be an option to print them only on recto pages. Perhaps some tuning for length, defaulting to one word, as well. Placement is traditionally in the bottom inside of the outside margin (directly below the text block, flush right). I do not know if this practice is found in RTL languages, but I do not see why it would not be adaptable to them as well. -- Rik ___ 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 ___
[NTG-context] changing an XML node and reprocess it (or xmlflushing a string)
Hello, i'm using XML and i find useful specifying a fraction made of text this way: text for numerator/text for denominator With some lua, i can transform it into \frac{\text{text for numerator}}{\text{text for denominator}} which typesets something like this: text for numerator text for denominator Suppose you want to add some styling to the texts, like this: text for numerator/text for denominator You should split the span node into two elements and the xmlflush them. This is my M(not)WE: \startbuffer[text] A paragraph with a fraction made of text with styles: a fraction made of text/with styles inside. \stopbuffer \startluacode local sub = string.sub local sfind = string.find local xmltext = xml.text local xmlconvert = xml.convert local function numeratorDenominator( text ) local before, after = sfind( text, "[^<]/[^>]" ) local num, den if before and after then num = sub( text, 1, before ) den = sub( text, after ) end return num, den end function xml.functions.textfraction( t ) local text = xmltext( t, '' ) local num, den = numeratorDenominator( text ) if num and den then local fontstyle = tokens.getters.macro( "fontstyle" ) local xml_num = xmlconvert( num ) local xml_den = xmlconvert( den ) --context( "$\\frac{\\text{\\" ..fontstyle .. " " .. num .. "}}{\\text{\\" ..fontstyle .. " " .. den .. "}}$" ) context( "$\\frac{\\text{\\" ..fontstyle .. " " ) context( num ) -- context.xmlprocessstring( xml_num ) context( "}}{\\text{\\" ..fontstyle .. " " ) context( den ) -- context.xmlprocessstring( xml_den ) context( "}}$" ) else context.xmlflush( t ) end end \stopluacode \startxmlsetups xml:textsetups \xmlsetsetup{#1}{*}{+} \xmlsetsetup{#1}{p|i|red}{xml:*} \xmlsetsetup{#1}{{span.fraction}}{xml:fraction} \stopxmlsetups \xmlregistersetup{xml:textsetups} \startxmlsetups xml:p \xmlflush{#1}\par \stopxmlsetups \startxmlsetups xml:i {\it \xmlflush{#1}} \stopxmlsetups \startxmlsetups xml:red {\red \xmlflush{#1}} \stopxmlsetups \startxmlsetups xml:fraction \xmlfunction{#1}{textfraction} \stopxmlsetups \starttext \xmlprocessbuffer{main}{text}{} \stoptext Massi ___ 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 ___
Re: [NTG-context] After a long time I tried:
On 10/7/2019 2:04 PM, Ursula Hermann wrote: Dear List! I have tried: \starttext {This is me} \startMPcode input mptrees; u:=0.4cm; dirlabel:=90; abscoord:=true; endlabelspace:=0.5cm; draw startlabel("$S$"); draw tree[1][1]((-5.5u,4u),(5.5u,8u))("NP","","VP",""); \stopMPcode \stoptext But there is a mistake, i dont know where, and whats wrong. After compiling (I have WinEdt as Editor), with Context, got wrong, I tried it with mp.exe, i get the following warning: Command Line: C:\Users\Hermann\Downloads\context-mswin\tex\texmf-mswin\bin\context.exe --synctex=-1 "context-test.tex" Startup Folder: C:\Users\Hermann\My Documents mtx-context | run 1: luametatex --fmt="C:/Users/Hermann/Downloads/context-mswin/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en" --jobname="context-test" --lua="C:/Users/Hermann/Downloads/context-mswin/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.lui" --c:currentrun=1 --c:fulljobname="./context-test.tex" --c:input="./context-test.tex" --c:kindofrun=1 --c:maxnofruns=9 --c:synctex="-1" --c:texmfbinpath="C:/Users/Hermann/Downloads/context-mswin/tex/texmf-mswin/bin" "cont-yes.mkiv" This is LuaMetaTeX, Version 2.00.0 open source > level 1, order 1, name 'cont-yes.mkiv' system > system > ConTeXt ver: 2019.10.04 17:53 MKIV beta fmt: 2019.10.7 int: english/english system > system > 'cont-new.mkiv' loaded open source > level 2, order 2, name 'C:/Users/Hermann/Downloads/context-mswin/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv' system > beware: some patches loaded from cont-new.mkiv close source > level 2, order 2, name 'C:/Users/Hermann/Downloads/context-mswin/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv' system > files > jobname 'context-test', input './context-test', result 'context-test' fonts > latin modern fonts are not preloaded languages > language 'en' is active system > synctex functionality is enabled, expect 5-10 pct runtime overhead! open source > level 2, order 3, name './context-test.tex' fonts > preloading latin modern fonts (second stage) fonts > 'fallback modern-designsize rm 12pt' is loaded metapost > initializing instance 'metafun:1' using format 'metafun' and method 'default' metapost > loading 'metafun' as 'C:/Users/Hermann/Downloads/context-mswin/tex/texmf-context/metapost/context/base/mpiv/metafun.mpxl' using method 'default' metapost > initializing number mode 'scaled' metapost log > metapost log > loading metafun, including plain.mp version 1.004 for metafun iv and xl metapost log > mplib warning: table expected from 'open_file' mtx-context | fatal error: return code: -1073741819 Best regards Uschi Hermann PS: I have done the beta version of cont-tmf today , and have installed wipe the texmf-cache path and remake the formats (you ran into the bytecode incompatibility issues) Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] After a long time I tried:
Dear List! I have tried: \starttext {This is me} \startMPcode input mptrees; u:=0.4cm; dirlabel:=90; abscoord:=true; endlabelspace:=0.5cm; draw startlabel("$S$"); draw tree[1][1]((-5.5u,4u),(5.5u,8u))("NP","","VP",""); \stopMPcode \stoptext But there is a mistake, i dont know where, and whats wrong. After compiling (I have WinEdt as Editor), with Context, got wrong, I tried it with mp.exe, i get the following warning: Command Line: C:\Users\Hermann\Downloads\context-mswin\tex\texmf-mswin\bin\context.exe --synctex=-1 "context-test.tex" Startup Folder: C:\Users\Hermann\My Documents mtx-context | run 1: luametatex --fmt="C:/Users/Hermann/Downloads/context-mswin/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en" --jobname="context-test" --lua="C:/Users/Hermann/Downloads/context-mswin/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.lui" --c:currentrun=1 --c:fulljobname="./context-test.tex" --c:input="./context-test.tex" --c:kindofrun=1 --c:maxnofruns=9 --c:synctex="-1" --c:texmfbinpath="C:/Users/Hermann/Downloads/context-mswin/tex/texmf-mswin/bin" "cont-yes.mkiv" This is LuaMetaTeX, Version 2.00.0 open source > level 1, order 1, name 'cont-yes.mkiv' system > system > ConTeXt ver: 2019.10.04 17:53 MKIV beta fmt: 2019.10.7 int: english/english system > system > 'cont-new.mkiv' loaded open source > level 2, order 2, name 'C:/Users/Hermann/Downloads/context-mswin/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv' system > beware: some patches loaded from cont-new.mkiv close source> level 2, order 2, name 'C:/Users/Hermann/Downloads/context-mswin/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv' system > files > jobname 'context-test', input './context-test', result 'context-test' fonts > latin modern fonts are not preloaded languages > language 'en' is active system > synctex functionality is enabled, expect 5-10 pct runtime overhead! open source > level 2, order 3, name './context-test.tex' fonts > preloading latin modern fonts (second stage) fonts > 'fallback modern-designsize rm 12pt' is loaded metapost> initializing instance 'metafun:1' using format 'metafun' and method 'default' metapost> loading 'metafun' as 'C:/Users/Hermann/Downloads/context-mswin/tex/texmf-context/metapost/context/base/mpiv/metafun.mpxl' using method 'default' metapost> initializing number mode 'scaled' metapost log> metapost log> loading metafun, including plain.mp version 1.004 for metafun iv and xl metapost log> mplib warning: table expected from 'open_file' mtx-context | fatal error: return code: -1073741819 Best regards Uschi Hermann PS: I have done the beta version of cont-tmf today , and have installed context-mswin, what I do every week. _ ConTeXt Compilation Report (Pages: 0) Errors: 0 Warnings: 0 Bad Boxes: 0 ___ 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 ___
Re: [NTG-context] arrows in FLOW charts
On 10/7/2019 1:49 PM, Henning Hraban Ramm wrote: I can’t answer that, but I guess you’d better use the nodes module, it supersedes the flowcharts one. Both are maintained (and serve a somewhat different audience and usage) I'm sure that long time power user Willi knows all the answers ... Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] arrows in FLOW charts
Hi Thomas, I can’t answer that, but I guess you’d better use the nodes module, it supersedes the flowcharts one. Best, Hraban > Am 2019-10-07 um 13:39 schrieb Thomas A. Schmitz : > > Hi all, > > I may be missing something really obvious: is it possible to change the shape > of single connection lines in the flowchart module? Let’s say in the > following example, I want the connection between test2 and test3 dashed and > blue. Can this be done? > > Thanks, and best wishes > > Thomas > > \usemodule[chart] > > \setupFLOWcharts [nx=1, > ny=3] > > \setupFLOWlines [color=red] > > \startFLOWchart [example] > \startFLOWcell >\name {test1} >\location {1,1} >\shape {action} >\text {test 1} >\connection [bt] {test2} > \stopFLOWcell > \startFLOWcell >\name {test2} >\location {1,2} >\shape {action} >\text {test 2} >\connection [bt] {test3} > \stopFLOWcell > \startFLOWcell >\name {test3} >\location {1,3} >\shape {action} >\text {test 3} > \stopFLOWcell > \stopFLOWchart > > \starttext > \FLOWchart [example] > \stoptext > ___ > 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 > ___ ___ 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 ___
[NTG-context] arrows in FLOW charts
Hi all, I may be missing something really obvious: is it possible to change the shape of single connection lines in the flowchart module? Let’s say in the following example, I want the connection between test2 and test3 dashed and blue. Can this be done? Thanks, and best wishes Thomas \usemodule[chart] \setupFLOWcharts [nx=1, ny=3] \setupFLOWlines [color=red] \startFLOWchart [example] \startFLOWcell \name {test1} \location {1,1} \shape {action} \text {test 1} \connection [bt] {test2} \stopFLOWcell \startFLOWcell \name {test2} \location {1,2} \shape {action} \text {test 2} \connection [bt] {test3} \stopFLOWcell \startFLOWcell \name {test3} \location {1,3} \shape {action} \text {test 3} \stopFLOWcell \stopFLOWchart \starttext \FLOWchart [example] \stoptext ___ 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 ___
Re: [NTG-context] issue with JavaScript in Acrobat
Hi Pablo Nearly no experience with JavaScript, no working Acrobat version installed (no testing possible). So take the following with a grain of salt... I guess it's just the too small call interval of the "step_clock" function. Calling it a thousand times per second doesn't seem to work. If the function is called a hundred times per second only, your clock counter is also incremented only a hundred times. I would use a system clock value instead (difference between start time and current time), so you can limit the call interval to a more reasonable value (1/10s). Regards, Peter Am 06.10.2019 um 21:13 schrieb Pablo Rodriguez: > Dear list, > > I have this minimal sample: > > \setupinteraction[state=start] > \setupinteractionscreen[option=max] > \startJSpreamble {varia} used now > var transitions = [1000, > 2000, > 3000, > 4000, > 5000, > 6000, > 7000, > 8000, > 9000]; > > var msecs = 0; > > function step_clock() { > try { ++msecs ; > if ((msecs >= (transitions[this.pageNum]/10)) && ( this.pageNum > < this.numPages )) { ++this.pageNum; }; > } catch (e) {} > } > > advance = app.setInterval ("step_clock()", 1); > advance.count = 0; > \stopJSpreamble > \starttext > \dorecurse{10}{\startTEXpage[pagestate=start, offset=1em] > \pagenumber > \stopTEXpage} > \stoptext > > Acrobat is required. And I have an issue with it > > Each slide takes a full second (1000 milliseconds). But the conditional > in step_clock() needs to divide the elements from transitions array by > ten. Otherwise it is ten times slower. > > Am I missing something here? Or why is "step_clock()" ten times slower > than it should be? > > Many thanks for your help, > > Pablo > -- > http://www.ousia.tk > ___ > 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 > ___ > ___ 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 ___