[NTG-context] Re: upload
On 8/9/2023 9:29 PM, Rik Kabel wrote: On 8/9/2023 11:42 AM, Hans Hagen wrote: Hi, I uploaded a new lmtx. There are some new features that wil be revealed in the future (likely after the meeting) but here is one: Two problems with this upload. First, page number suppression no longer works. Second, table captions are not displayed. indeed, probably a fix tomorrow - 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 / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: upload
On 8/9/2023 11:42 AM, Hans Hagen wrote: Hi, I uploaded a new lmtx. There are some new features that wil be revealed in the future (likely after the meeting) but here is one: Two problems with this upload. First, page number suppression no longer works. Second, table captions are not displayed. \setuppagenumbering [alternative=doublesided,location=] \setupcaption[style=sans,headstyle=sans] \starttext \startchapter[title={Page Numbering Test}] \startplacetable[location={here,spit,force},title={Title?}] \starttabulate[|rp|lp|] \HL \NC tufte \NC \input tufte \NC \AR \NC ward \NC \input ward \NC \AR \NC montgomery \NC \input montgomery \NC \AR \HL \stoptabulate \stopplacetable \dorecurse{7}{ \input tufte \par} \stopchapter \stoptext -- RIk ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Cron /var/www/aanhet.net/context/bin/cron/context-mirror
receiving incremental file list ./ ctan.lsr document-2.htm download-1.htm download-2.htm logo-ade.png logo-cts.png logo-pod.png rss.xml show-fil.pdf context/latest/ context/latest/cont-lmt.zip context/latest/cont-mpd.zip context/latest/cont-ppc.zip context/latest/cont-sci.zip context/latest/cont-tmf.zip context/latest/cont-tst.7z context/latest/cont-tst.tar.xz context/latest/cont-tst.zip general/manuals/ general/manuals/lowlevel-grouping.pdf general/manuals/lowlevel-macros.pdf sent 176,523 bytes received 40,431,915 bytes 3,248,675.04 bytes/sec total size is 562,360,213 speedup is 13.85 Running archiver: New dir: /var/www/aanhet.net/context//htdocs/archives/context-2023-08-09.18 233679568 /var/www/aanhet.net/context//htdocs/archives/context-2023-08-09.18/latest 126745317 /var/www/aanhet.net/context//htdocs/archives/context-2023-08-09.18/current 360428981 /var/www/aanhet.net/context//htdocs/archives/context-2023-08-09.18 360428981 total ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] upload
Hi, I uploaded a new lmtx. There are some new features that wil be revealed in the future (likely after the meeting) but here is one: \starttext \defineoverlay [test] [\color [blue] {TEST \inframed [foregroundcolor=red] {xxx} TEST}] \framed [background=test, foregroundstyle=\switchtobodyfont[small]] {test} \stoptext From now on many commands accept (properly) nested [] inside commands that use [] as fences (like the setup commands) where it makes sense. It is up to the user to decide to use {} (as before) or not but it is less error prone. It is now also possible to nest setups as in \starttext \startsetups one \startsetups [three] HERE \stopsetups \stopsetups \startsetups two \startsetups [three] THERE \stopsetups \stopsetups \setups[one] \setups[three] \setups[two] \setups[three] \stoptext As part of the ongoing improvements on math rendering we added some classic lm/cm kerns (between upperacse and periods / commas) in the goodie files. Some lowlevel manuals have been extended, explaining experimental 'named cross macro nesting parameter referencing' and 'constrained cq. retained assignments', but that is only relevant for those interested in overcoming some limitations in the traditional engines. 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 / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: Tracker for hyphens at the end of lines
On 8/9/2023 12:10 PM, denis.ma...@unibe.ch wrote: Keith, you can also check hyphenations using a script: -- check-hyphens.lua --[[ analyze hyphenations based on a ConTeXt log file enable hyphenation tracking in the ConTeXt file with \enabletrackers[hyphenation.applied] then run this script with lua check-hyphens.lua input_file whitelist.ending for the input_file we assume .log, so no need to add this for the whitelist a file ending has to be supplied the whitelist is optional ]] -- local lines = string.splitlines(io.loaddata("oeps.tex")or "") or { } -- local pprint = require('pprint') function main (input_file, whitelist_file) local lines = lines_from(input_file .. ".log") local whitelist = {} if whitelist_file == nil then whitelist = {} else whitelist = lines_from(whitelist_file) end --pprint (lines) --pprint (whitelist) local filteredWordlist = filterHyphenationsWordlist (cleanLines (getHyphenationLines(lines)), whitelist) -- pprint(filteredWordlist) saveResultsToFile(filteredWordlist, 'check-hyphens.log') end -- see if the file exists -- http://lua-users.org/wiki/FileInputOutput -- see if the file exists function file_exists(file) local f = io.open(file, "rb") if f then f:close() end return f ~= nil end -- get all lines from a file, returns an empty -- list/table if the file does not exist function lines_from(file) if not file_exists(file) then return {} end local lines = {} for line in io.lines(file) do lines[#lines + 1] = line end return lines end -- String testing function starts_with(str, start) return str:sub(1, #start) == start end -- get relevant lines function getHyphenationLines(lines) local lines_with_hyphenations = {} for k,v in pairs(lines) do if (starts_with(v, "hyphenated") and not string.find(v, "start hyphenated words") and not string.find(v, "stop hyphenated words")) then table.insert(lines_with_hyphenations, v) end end return lines_with_hyphenations end -- String cleaning -- wrapper functions function cleanLines (xs) local cleanedLines = {} for k,v in pairs(xs) do table.insert(cleanedLines, cleanLine(v)) end return cleanedLines end function cleanLine (x) return removeTrailingPunctuation(getWord(x)) end -- 1. Start reading at colon function getWord(x) -- wir lesen aber Zeichen 26 return string.sub(x,26) end -- 2. Remove trailing punctuation function removeTrailingPunctuation (x) if string.find(x, ',') then return x:sub(1, -2) else return x end end -- test if word is in second list function inList (x, list) for k,v in ipairs(list) do if v == x then return true end end return nil end -- Filter hyphenated words based on second list (whitelist) function filterHyphenationsWordlist (xs, list) local result = {} for k,v in ipairs(xs) do if not inList(v, list) then table.insert (result, v) end end return result end function saveResultsToFile(results, output_file) -- Opens a file in write mode output_file = io.open("check_hyphens.log", "w") -- sets the default output file as output_file io.output(output_file) -- iterate oiver for k,v in ipairs(results) do io.write(v..'\n') end -- closes the open file io.close(output_file) end -- Run main(arg[1], arg[2]) Ok, a little lua lesson, if you don't mind. xxx.tex \enabletrackers[hyphenation.applied] \starttext \input tufte \stoptext xxx.tmp re-fine xxx.lua local function check(logname,whitename) if not logname then return end local data = io.loaddata(logname) or "" if data == "" then return end local blob = string.match(data,"start hyphenated words(.-)stop hyphenated words") if not blob then return end local white = table.tohash(string.splitlines(whitename and io.loaddata(whitename) or "")) for n, s in string.gmatch(blob,"(%d+) *: (%S+)") do if white[s] then -- were good else print(n,s) end end end check(environment.files[1],environment.files[2]) -- print("TEST 1") -- check("xxx.log") -- print("TEST 2") -- check("xxx.log","xxx.tmp") --- >mtxrun --script xxx xxx.log 1 dis-tinguish 1 harmo-nize 1 re-fine >mtxrun --script xxx xxx.log xxx.tmp 1 dis-tinguish 1 harmo-nize That said, i wonder if we should add the filename, just in case one includes 20 files and a whitelist could be an option to the tracker. Now the good news is that the tracker is actually already a bit more clever. After a run you will see xxx-hyphenation-n
[NTG-context] Re: Triaging tikz error: Cannot parse this coordinate
On 8/9/2023 1:00 PM, Xavier B. wrote: Yes. The problem is syntactic: with \startscope[shift={(\p)}] it works. that's one way to look at it, kind of like (10,20) shifted (10,100) which looks somewhat weird (does {\p} actually work?) one can wonder why the coordinate is not expanded without encapsulating () which should not that hard to do 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 / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: Tracker for hyphens at the end of lines
Keith, you can also check hyphenations using a script: -- check-hyphens.lua --[[ analyze hyphenations based on a ConTeXt log file enable hyphenation tracking in the ConTeXt file with \enabletrackers[hyphenation.applied] then run this script with lua check-hyphens.lua input_file whitelist.ending for the input_file we assume .log, so no need to add this for the whitelist a file ending has to be supplied the whitelist is optional ]] -- local lines = string.splitlines(io.loaddata("oeps.tex")or "") or { } -- local pprint = require('pprint') function main (input_file, whitelist_file) local lines = lines_from(input_file .. ".log") local whitelist = {} if whitelist_file == nil then whitelist = {} else whitelist = lines_from(whitelist_file) end --pprint (lines) --pprint (whitelist) local filteredWordlist = filterHyphenationsWordlist (cleanLines (getHyphenationLines(lines)), whitelist) -- pprint(filteredWordlist) saveResultsToFile(filteredWordlist, 'check-hyphens.log') end -- see if the file exists -- http://lua-users.org/wiki/FileInputOutput -- see if the file exists function file_exists(file) local f = io.open(file, "rb") if f then f:close() end return f ~= nil end -- get all lines from a file, returns an empty -- list/table if the file does not exist function lines_from(file) if not file_exists(file) then return {} end local lines = {} for line in io.lines(file) do lines[#lines + 1] = line end return lines end -- String testing function starts_with(str, start) return str:sub(1, #start) == start end -- get relevant lines function getHyphenationLines(lines) local lines_with_hyphenations = {} for k,v in pairs(lines) do if (starts_with(v, "hyphenated") and not string.find(v, "start hyphenated words") and not string.find(v, "stop hyphenated words")) then table.insert(lines_with_hyphenations, v) end end return lines_with_hyphenations end -- String cleaning -- wrapper functions function cleanLines (xs) local cleanedLines = {} for k,v in pairs(xs) do table.insert(cleanedLines, cleanLine(v)) end return cleanedLines end function cleanLine (x) return removeTrailingPunctuation(getWord(x)) end -- 1. Start reading at colon function getWord(x) -- wir lesen aber Zeichen 26 return string.sub(x,26) end -- 2. Remove trailing punctuation function removeTrailingPunctuation (x) if string.find(x, ',') then return x:sub(1, -2) else return x end end -- test if word is in second list function inList (x, list) for k,v in ipairs(list) do if v == x then return true end end return nil end -- Filter hyphenated words based on second list (whitelist) function filterHyphenationsWordlist (xs, list) local result = {} for k,v in ipairs(xs) do if not inList(v, list) then table.insert (result, v) end end return result end function saveResultsToFile(results, output_file) -- Opens a file in write mode output_file = io.open("check_hyphens.log", "w") -- sets the default output file as output_file io.output(output_file) -- iterate oiver for k,v in ipairs(results) do io.write(v..'\n') end -- closes the open file io.close(output_file) end -- Run main(arg[1], arg[2]) > -Ursprüngliche Nachricht- > Von: Keith McKay > Gesendet: Dienstag, 1. August 2023 20:22 > An: mailing list for ConTeXt users > Betreff: [NTG-context] Re: Tracker for hyphens at the end of lines > > Thanks Hans! > > I'm never disappointed, always amazed with ConTeXt! > > This is just what I was looking for. > > Best Wishes > > Keith McKay > > On 01/08/2023 18:10, Hans Hagen via ntg-context wrote: > > On 8/1/2023 4:54 PM, Keith McKay wrote: > >> Hi colleagues, > >> > >> Is there a tracker for highlighting hyphens at the end of lines > >> similar the way underfull and overfull boxes can be displayed with a > >> coloured bar at the end of the offending line? > >> > >> I have looked at the wiki page "Reviewing hyphenation" and it has a > >> solution for mkii from 2009 which, I would think, won't be suitable > >> for present day ConTeXt. I have tried searching for hyphens using > >> Skim and Adobe Acrobate viewers but although they find hyphenation in > >> line they don't recognise hyphens at the edge of lines. > >> > >> Any help would be appreciated. > > I suppose you would be disappointed it there was no tracker ... > > > > \enabletrackers[hyphenation.applied.console] > > \enabletrackers[hyphenation.applied.visualize] > > > > you even get a file with the hyphenated words > > > > You can see all of them with > > > > \disabledirectives[backend.cleanup.flatten] > > \bitwiseflip \normalizelinemode -\flattendiscretionariesnormalizecode
[NTG-context] Re: Triaging tikz error: Cannot parse this coordinate
On 8/8/23 20:57, Hans Hagen wrote: > On 8/8/2023 7:43 PM, Hans Hagen wrote: >> On 8/8/2023 6:13 PM, Xavier B. wrote: >>> After some time, I could write a minimal example with tikz with >>> strange error: Cannot parse this coordinate. >>> >>> Can someone help me to find the bug? >>> >>> I attach the file and the log. >>> >>> Help very appreciate >>> I run >> \starttikzpicture >> \foreach \p in {(6,2)} >> { >> \tracingall >> \startscope[shift={\p}] >> \draw[color=green!60, thick] (0,0) -- (1,1); >> \stopscope >> } >> \stoptikzpicture >> >> looks like some parsing issue, are you sure that you can assign \p to >> shift this way? > ok, i found it but i'm not going to make it custom to fix tikz > > you need to use this: > > \normalexpanded{\noexpand\startscope[shift={\p}]} > > instead of > > \startscope[shift={\p}] > > this can be automated with (maybe we need a m-fixz module for that) > > % fix > > \appendtoks > \let\normaltikzstartscope\startscope > \def\startscope[#1]% > {\normalexpanded > {\noexpand\normaltikzstartscope[#1]}}% > \to \everyinsidetikzpicture > > % end of fix > > but for that you need to use the attached module so that we hook it in > aftert tikz sets itself up > > the fix you can put in your style or in a cont-loc.mkxl in a local tree This is likely going to break all kinds of stuff, because not everything in \startscope[...] can always be expanded. Also the brackets are optional in the original definition of \startscope, so a \dosingleempty would at least be in order: \appendtoks \let\normaltikzstartscope\startscope \def\dostartscope[#1]% {\normalexpanded {\noexpand\normaltikzstartscope[#1]}}% \def\startscope{\dosingleempty\dostartscope}% \to \everyinsidetikzpicture In fact, pgfkeys has a handler for expanding keys before doing assignment to work around exactly these situations: \startscope[shift/.expanded={\p}] No redefinition needed. We could also do \edef or \romannumeral expansion in the shift key in TikZ, but I'm not sure whether that would break someone's code. Cheers, Henri > > 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 / > https://www.ntg.nl/mailman/listinfo/ntg-context > webpage : https://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : https://contextgarden.net > ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___