[NTG-context] glyph width and bearings of a given glyph?
Dear list, how can I get the value in Lua of width and the bearings of a given glyph (such as Ὧ)? 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 ___
[NTG-context] Issues using publications subsystem for non-bibliographic database
List, I am trying to use the publications subsystem to support a non-bibliographic database, as chapter 10 of mkiv-publications suggests one can. My example is a database of quotations. I have been partially successful, which is another way of saying there are some issues I have not been able to resolve. First, what goes into a specification lua file (I think that is what the document suggests I need) that says my author field should be handled as a bibliographic author field? There is some processing: {Schopenhauer, Arthur} gets displayed as ArthurSchopenhauer (with no space). Specifying an authorconversion in \setupbtx has no effect, so it looks like I have to do something else. Second, how can I link one entry to another. The example shows my almost-working attempt, adding a linking key (translation in the example) and recursively using it in processing. This fails, but when I use the literal equivalent, it works. (And the recursion does not seem to be the problem.) I know that this description is not clear, but the example should demonstrate the issue. Finally, the document loses all data from the quotation database when \placebtxrendering for that database is omitted. I apologize for the larger-than-usual example size. %{[( \startbuffer[quotesources] @book{Schopenhauer1862v2, title = {Parerga und Paralipomena}, subtitle= {Kleine Philosophische Schriften}, publisher = {A. W. Hahn}, year= {1862}, volume = {2}, volumes = {2}, author = {Arthur Schopenhauer}, editor = {Julius Frauenstädt}, address = {Berlin}, language= {german}, } @book{SchopenhauerPayne2000, title = {Parerga and Paralipomena}, subtitle= {Short Philosophical Essays}, publisher = {Oxford University Press Clarendon Press}, address = {New York and Oxford}, year= {2000}, author = {Arthur Schopenhauer}, volumes = {2}, origyear= {1974}, origlanguage= {german}, translator = {Eric F. J. Payne}, } \stopbuffer \startbuffer[quotedatabase] @quote{qSchopA02, extract = {Es wäre gut Bücher kaufen, wenn man die Zeit, sie zu lesen, mitkaufen könnte, aber man verweschelt meistens den Ankauf der Bücher mit dem Aneignen ihres Inhalts.}, author = {Schopenhauer, Arthur}, born= {1788}, died= {1860}, work= {\cite[title][sources::Schopenhauer1862v2]}, year= {1862}, location= {chapter\btxnbsp24}, translation = {\cite[tag][qPayneE01]}, attribnote = {The selection was inserted posthumously into the work, probably based on notes Schopenhauer left, by Julius Frauenstädt, his literary executor, and has appeared in different locations in various editions.}, } @quote{qPayneE01, extract = {Buying books would be a good thing if one could also buy the time to read them in: but as a rule the purchase of books is mistaken for the appropriation of their contents.}, author = {Eric F. J. Payne}, born= {1895}, died= {1983}, year= {1974/2000}, work= {\cite[title][sources::SchopenhauerPayne2000]}, page= {559}, } \stopbuffer \loadbtxdefinitionfile [apa] \usebtxdefinitions [apa] \usebtxdataset [sources] [quotesources.buffer] \definebtxrendering [sources] [apa] [group=bib, dataset=sources] \setupbtx [sources] [specification=apa, dataset=sources] \usebtxdataset [quotedb] [quotedatabase.buffer] \definebtxrendering [quotedb] [group=quotes, sorttype=cite, numbering=no, dataset=quotedb] \setupbtx [specification=quotedb, authorconversion=normalshort, dataset=quotedb] \startsetups btx:quotedb:cite:attribnote {\rm\btxfield{attribnote}} \stopsetups \startsetups btx:quotedb:cite:born {\rm\btxfield{born}} \stopsetups \startsetups btx:quotedb:cite:died {\rm\btxfield{died}} \stopsetups \startsetups btx:quotedb:cite:location {\rm\btxfield{location}} \stopsetups \startsetups btx:quotedb:cite:page {\rm\btxfield{page}} \stopsetups \startsetups btx:quotedb:cite:work {\rm\btxfield{work}} \stopsetups \startsetups btx:quotedb:cite:extract {\rm\btxfield{extract}} \stopsetups \startsetups btx:quotedb:cite:title {\rm\it\btxfield{title}} \stopsetups \startsetups btx:quotedb:list:quote \limitatetext{\btxfield{extract}}{\textwidth}{\unknown} \blank[none] -\btxspace\btxflush{author}
Re: [NTG-context] question about fonts.handlers.otf.addfeature
On 12/6/18 11:03 PM, Hans Hagen wrote: > On 12/6/2018 9:55 PM, Pablo Rodriguez wrote: >> Dear list, >> >> as far as I know, fonts.handlers.otf.addfeature has the following types: >> substitution, alternate, multiple, ligature, kern and chainsubstitution. >> >> Is there a type of feature that simply moves a single glyph when activated? > > i think that there are examples in the test suite of pairwise or single > positioning You are right, Hans. \startluacode fonts.handlers.otf.addfeature { name = "stest", type = "single", data = { a = { -500, 0, -500, 0 }, } } \stopluacode Sorry, but I forgot to consider the test suite. 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] question about fonts.handlers.otf.addfeature
On 12/6/2018 9:55 PM, Pablo Rodriguez wrote: Dear list, as far as I know, fonts.handlers.otf.addfeature has the following types: substitution, alternate, multiple, ligature, kern and chainsubstitution. Is there a type of feature that simply moves a single glyph when activated? i think that there ae examples in the test suite of pairwise or single positioning -- - 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] question about fonts.handlers.otf.addfeature
Dear list, as far as I know, fonts.handlers.otf.addfeature has the following types: substitution, alternate, multiple, ligature, kern and chainsubstitution. Is there a type of feature that simply moves a single glyph when activated? 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] indenting after placefigure
On 12/6/18 9:38 PM, Hans van der Meer wrote: > Thanks, indeed this does the trick. > But I wonder: Has \placefigure then a default [indentnext=no] instead > of abstaining from meddling with the indent setting? This might be similar to indenting after headings. To get the paragraphs indented after them, \setupheads[indentnext] is required. The "indenting" key inherits its value from \setupindenting, but "indentnext" doesn’t. I hope it helps, 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] indenting after placefigure
Thanks, indeed this does the trick. But I wonder: Has \placefigure then a default [indentnext=no] instead of abstaining from meddling with the indent setting? dr. Hans van der Meer > On 6 Dec 2018, at 21:25, Pablo Rodriguez wrote: > > On 12/6/18 6:10 PM, Hans van der Meer wrote: >> I used \setupindenting[always,medium]. This works everywhere except >> after a figure placed with \placefigure. Why does placing the figure >> suppress the indent after it? And how can this behaviour be changed? > > I wonder whehter \setupfloat[figure][indentnext=yes] would work here. > > I hope it may 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 ___
Re: [NTG-context] indenting after placefigure
On 12/6/18 6:10 PM, Hans van der Meer wrote: > I used \setupindenting[always,medium]. This works everywhere except > after a figure placed with \placefigure. Why does placing the figure > suppress the indent after it? And how can this behaviour be changed? I wonder whehter \setupfloat[figure][indentnext=yes] would work here. I hope it may 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 ___
[NTG-context] indenting after placefigure
I used \setupindenting[always,medium]. This works everywhere except after a figure placed with \placefigure. Why does placing the figure suppress the indent after it? And how can this behaviour be changed? dr. Hans van der Meer ___ 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] Typing Unicode subscript and superscript numbers
> On 6 Dec 2018, at 15:23, Wolfgang Schuster > wrote: > > The force key is valid for the \definefallbackfamily command, e.g. > > \definefallbackfamily [...] [...] [range={...},force=yes] I tried to test it with the code below, but then it selects the stixtwomath glyphs. So possibly the force override is used only if the font has the glyph, instead of giving an error. \definefallbackfamily [mainface] [math] [stix] [range={00B2-00B3,00B9,02070-0208F},force=yes] \definefontfamily [mainface] [math] [stixtwomath] ___ 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] Typing Unicode subscript and superscript numbers
Hans Åberg schrieb am 06.12.18 um 15:18: On 2 Dec 2018, at 19:01, Hans Hagen wrote: This super/supscript stuff is a bit more tricky because when a superscript 2 is in the font, and a superscript 3 isn't, using a fake ^3 alongside that ^2 quite certainly will look bad because the 2 is normally of a different design that a scaled down 2, so one then has to replace them all. Then there is the question of scale and move (up/down). This issue shows up with the STIX and STIX2 fonts, as the former has the superscript digits ¹ ² ³, but not the other which came to Unicode later in a different range. Although I have some experiemntal (font) magic on my computer it will probably take till next year before it will show up in a beta. I use the code below, which seems fine, as the two fonts are close to each other. But it seems that one cannot add [force=yes] to ensure they all come from the same font as on the command \definefontfallback. This command would otherwise be good to pick replacements for certain glyphs. \definefallbackfamily [mainface] [serif] [stixtwotext] [range={00B2-00B3,00B9,02070-0208F}] The force key is valid for the \definefallbackfamily command, e.g. \definefallbackfamily [...] [...] [range={...},force=yes] 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] Typing Unicode subscript and superscript numbers
> On 2 Dec 2018, at 19:01, Hans Hagen wrote: > > This super/supscript stuff is a bit more tricky because when a superscript 2 > is in the font, and a superscript 3 isn't, using a fake ^3 alongside that ^2 > quite certainly will look bad because the 2 is normally of a different design > that a scaled down 2, so one then has to replace them all. Then there is the > question of scale and move (up/down). This issue shows up with the STIX and STIX2 fonts, as the former has the superscript digits ¹ ² ³, but not the other which came to Unicode later in a different range. > Although I have some experiemntal (font) magic on my computer it will > probably take till next year before it will show up in a beta. I use the code below, which seems fine, as the two fonts are close to each other. But it seems that one cannot add [force=yes] to ensure they all come from the same font as on the command \definefontfallback. This command would otherwise be good to pick replacements for certain glyphs. \definefallbackfamily [mainface] [serif] [stixtwotext] [range={00B2-00B3,00B9,02070-0208F}] \definefallbackfamily [mainface] [mono] [stixtwotext] [range={00B2-00B3,00B9,02070-0208F}] \definefallbackfamily [mainface] [math] [stixtwomath] [range={00B2-00B3,00B9,02070-0208F}] \definefontfamily [mainface] [serif] [stix] \definefontfamily [mainface] [mono] [stix] \definefontfamily [mainface] [math] [stix] ___ 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] color check
it is the behaviour of the (old) osx preview app for sure. when looking at the pdf, the thumbnails are correct, however when focussing on the page it turns green. its getting more urgent to move to Linux ;-) .F > On 6 Dec 2018, at 11:12, luigi scarso wrote: > > > > On Thu, Dec 6, 2018 at 10:55 AM Floris van Manen wrote: > while experimenting with the sample transparency color code > > > \definecolor [transparentred] [r=1,t=.5,a=1] > \definecolor [transparentblue] [b=1,t=.5,a=1] > \definecolor [solidyellow] [y=1,t=1,a=1] > > \starttext > > \startTEXpage > ~This is some sample text that goes behind the rectangles\hskip-80mm > \blackrule[width=18mm,height=10mm,depth=10mm,color=solidyellow]\hskip-6mm > \blackrule[width=18mm,height=20mm,depth=1mm,color=transparentred]\hskip-6mm > \blackrule[width=18mm,height=10mm,depth=10mm,color=transparentblue]\hskip-6mm > \blackrule[width=18mm,height=20mm,depth=1mm,color=solidyellow]\hskip27mm > \stopTEXpage > > \stoptext > > > > i get the intended result. > > > > if i change the yellow t value to .99 > \definecolor [solidyellow] [y=1,t=0.99,a=1] > some green layer pops up. > > > > as this is all about software, there is a reason to this. > it cold be the OSX preview program too, of course. > can someone explain to me ? > :-) > > here is ok under ubuntu > Can you convert pdf to png ? This should show almost the same png. > > You can also prepend > \nopdfcompression > and post the pdf. > > \nopdfcompression > \definecolor [transparentred] [r=1,t=.5,a=1] > \definecolor [transparentblue] [b=1,t=.5,a=1] > \definecolor [solidyellow] [y=1,t=1,a=1] > > \starttext > > \startTEXpage > \definecolor [solidyellow] [y=1,t=1,a=1] > ~This is some sample text that goes behind the rectangles\hskip-80mm > \blackrule[width=18mm,height=10mm,depth=10mm,color=solidyellow]\hskip-6mm > \blackrule[width=18mm,height=20mm,depth=1mm,color=transparentred]\hskip-6mm > \blackrule[width=18mm,height=10mm,depth=10mm,color=transparentblue]\hskip-6mm > \blackrule[width=18mm,height=20mm,depth=1mm,color=solidyellow]\hskip27mm > \stopTEXpage > > > \startTEXpage > \definecolor [solidyellow] [y=1,t=0.99,a=1] > ~This is some sample text that goes behind the rectangles\hskip-80mm > \blackrule[width=18mm,height=10mm,depth=10mm,color=solidyellow]\hskip-6mm > \blackrule[width=18mm,height=20mm,depth=1mm,color=transparentred]\hskip-6mm > \blackrule[width=18mm,height=10mm,depth=10mm,color=transparentblue]\hskip-6mm > \blackrule[width=18mm,height=20mm,depth=1mm,color=solidyellow]\hskip27mm > \stopTEXpage > > > \stoptext > > -- > luigi > 10.53.21.PNG> at > 10.48.56.PNG>___ > 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 > ___ signature.asc Description: Message signed with OpenPGP using GPGMail ___ 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] 'figures.getinfo()' not to exit ConTeXt
Procházka Lukáš Ing. schrieb am 06.12.18 um 11:20: Hello, I'm using the following code, mentioned here some time ago, to get some info about PDF: \startluacode figures.getinfo = function(name, page) if type(name) == "string" then name = { name = name, page = page } end if name.name then local data = figures.push(name) --figures.identify() local ok, res = pcall(figures.identify) print(">>1", ok, res) --figures.check() local ok, res = pcall(figures.check) print(">>2", ok, res) figures.pop() return data end end local data = figures.getinfo("NonExisting.pdf") \stopluacode The problem is that once the PDF file doesn't exist, the function causes ConTeXt to exit, even when I enclose 'figure.check()' into the 'pcall' (to be handled like try/catch mechanism). Is there a way so that the function 'figures.getinfo()' does't exit ConTeXt, it just returns 'nil', or even gives info which directories (or even which file types) were searched? You can use the \doifelsefigure command for a simple check \setupexternalfigure[location={local,global,default}] \starttext \doifelsefigure{cow}{YES}{NO} \doifelsefigure{mill}{YES}{NO} \doifelsefigure{bridge}{YES}{NO} \stoptext or the following stripped down version of the underlying Lua code of the \doifelsefigure command \setupexternalfigure[location={local,global,default}] \starttext \startluacode local cow = figures.getinfo("cow") if figures.get("status","status",0) == 0 then context("NO") context.par() else context("YES") context.par() end local mill = figures.getinfo("mill") if figures.get("status","status",0) == 0 then context("NO") context.par() else context("YES") context.par() end local bridge = figures.getinfo("bridge") if figures.get("status","status",0) == 0 then context("NO") context.par() else context("YES") context.par() end \stopluacode \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] 'figures.getinfo()' not to exit ConTeXt
Are you sure that data is not nil here? If so, this function returns nil. dr. Hans van der Meer > On 6 Dec 2018, at 11:20, Procházka Lukáš Ing. wrote: > > Hello, > > I'm using the following code, mentioned here some time ago, to get some info > about PDF: > > > \startluacode > figures.getinfo = function(name, page) >if type(name) == "string" then >name = { name = name, page = page } >end >if name.name then >local data = figures.push(name) > >--figures.identify() > local ok, res = pcall(figures.identify) > print(">>1", ok, res) > >--figures.check() > local ok, res = pcall(figures.check) > print(">>2", ok, res) > >figures.pop() >return data >end > end > > local data = figures.getinfo("NonExisting.pdf") > > \stopluacode > > > The problem is that once the PDF file doesn't exist, the function causes > ConTeXt to exit, even when I enclose 'figure.check()' into the 'pcall' (to be > handled like try/catch mechanism). > > Is there a way so that the function 'figures.getinfo()' does't exit ConTeXt, > it just returns 'nil', or even gives info which directories (or even which > file types) were searched? > > TIA. > > Best regards, > > Lukas > > > -- > Ing. Lukáš Procházka | mailto:l...@pontex.cz > Pontex s. r. o. | mailto:pon...@pontex.cz | http://www.pontex.cz | IDDS: > nrpt3sn | IČO: 40763439 > Bezová 1658 > 147 14 Praha 4 > > Mob.: +420 702 033 396 > > ___ > 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 ___
Re: [NTG-context] 'figures.getinfo()' not to exit ConTeXt
On Thu, Dec 6, 2018 at 11:54 AM Procházka Lukáš Ing. wrote: > Hello Luigi, > > BTW: Ctx tells me "attempt to call a nil value (global 'report')" on > "report("unknown file %a",fileone)" - do I have to enable/load something? > > should be something like local report = logs.reporter("my application") -- 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] 'figures.getinfo()' not to exit ConTeXt
Hello Luigi, On Thu, 06 Dec 2018 11:23:25 +0100, luigi scarso wrote: On Thu, Dec 6, 2018 at 11:17 AM Procházka Lukáš Ing. wrote: Hello, I'm using the following code, mentioned here some time ago, to get some info about PDF: \startluacode figures.getinfo = function(name, page) if type(name) == "string" then name = { name = name, page = page } end if name.name then local data = figures.push(name) --figures.identify() local ok, res = pcall(figures.identify) print(">>1", ok, res) --figures.check() local ok, res = pcall(figures.check) print(">>2", ok, res) figures.pop() return data end end local data = figures.getinfo("NonExisting.pdf") \stopluacode The problem is that once the PDF file doesn't exist, the function causes ConTeXt to exit, even when I enclose 'figure.check()' into the 'pcall' (to be handled like try/catch mechanism). Is there a way so that the function 'figures.getinfo()' does't exit ConTeXt, it just returns 'nil', or even gives info which directories (or even which file types) were searched? TIA. something like that (untested), eventaully to be wrapped in a your function local fileone = "NonExisting.pdf" local data if not lfs.isfile(fileone) then report("unknown file %a",fileone) well, yes, this should work; but \externalfigure uses a mechanism to lookup for a file which combines paths specified by "location=", "directory=", "order=" and maybe some more. And whilst \externalfigure should find a file (whose location may not be known exactly, it just may use e.g. "directory=" spec), simple "lfs.isfile(fileone)" could not find the file since the exact path has not been specified. IOW, I need to combine searching-for-file mechanism which is used inside \externalfigure with 'figures.getinfo()' so the 'getinfo()' should return 'nil' when no file (being specified like in \externalfigure, i.e. with no exact path, even without extension) is found. BTW: Ctx tells me "attempt to call a nil value (global 'report')" on "report("unknown file %a",fileone)" - do I have to enable/load something? Lukas else data = figures.getinfo("NonExisting.pdf") end -- Ing. Lukáš Procházka | mailto:l...@pontex.cz Pontex s. r. o. | mailto:pon...@pontex.cz | http://www.pontex.cz | IDDS: nrpt3sn | IČO: 40763439 Bezová 1658 147 14 Praha 4 Mob.: +420 702 033 396 ___ 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] align in setuphead
Pablo Rodriguez schrieb am 06.12.18 um 11:14: On 12/6/18 7:36 AM, Jan U. Hasecke wrote: Hi all, why aligns left to right and right to left in this example? \setuphead [title] [align=left] Hi Jan U., flushleft is the value to get left aligninig. I read the explanation somewhere. Left and right aligned to the right and left. They are kept for compatibility. left = ragged left right = ragged right 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] 'figures.getinfo()' not to exit ConTeXt
On Thu, Dec 6, 2018 at 11:17 AM Procházka Lukáš Ing. wrote: > Hello, > > I'm using the following code, mentioned here some time ago, to get some > info about PDF: > > > \startluacode > figures.getinfo = function(name, page) > if type(name) == "string" then > name = { name = name, page = page } > end > if name.name then > local data = figures.push(name) > > --figures.identify() > local ok, res = pcall(figures.identify) > print(">>1", ok, res) > > --figures.check() > local ok, res = pcall(figures.check) > print(">>2", ok, res) > > figures.pop() > return data > end > end > > local data = figures.getinfo("NonExisting.pdf") > > \stopluacode > > > The problem is that once the PDF file doesn't exist, the function causes > ConTeXt to exit, even when I enclose 'figure.check()' into the 'pcall' (to > be handled like try/catch mechanism). > > Is there a way so that the function 'figures.getinfo()' does't exit > ConTeXt, it just returns 'nil', or even gives info which directories (or > even which file types) were searched? > > TIA. > > something like that (untested), eventaully to be wrapped in a your function local fileone = "NonExisting.pdf" local data if not lfs.isfile(fileone) then report("unknown file %a",fileone) else data = figures.getinfo("NonExisting.pdf") end -- 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] 'figures.getinfo()' not to exit ConTeXt
Hello, I'm using the following code, mentioned here some time ago, to get some info about PDF: \startluacode figures.getinfo = function(name, page) if type(name) == "string" then name = { name = name, page = page } end if name.name then local data = figures.push(name) --figures.identify() local ok, res = pcall(figures.identify) print(">>1", ok, res) --figures.check() local ok, res = pcall(figures.check) print(">>2", ok, res) figures.pop() return data end end local data = figures.getinfo("NonExisting.pdf") \stopluacode The problem is that once the PDF file doesn't exist, the function causes ConTeXt to exit, even when I enclose 'figure.check()' into the 'pcall' (to be handled like try/catch mechanism). Is there a way so that the function 'figures.getinfo()' does't exit ConTeXt, it just returns 'nil', or even gives info which directories (or even which file types) were searched? TIA. Best regards, Lukas -- Ing. Lukáš Procházka | mailto:l...@pontex.cz Pontex s. r. o. | mailto:pon...@pontex.cz | http://www.pontex.cz | IDDS: nrpt3sn | IČO: 40763439 Bezová 1658 147 14 Praha 4 Mob.: +420 702 033 396 ___ 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] align in setuphead
On 12/6/18 7:36 AM, Jan U. Hasecke wrote: > Hi all, > > why aligns left to right and right to left in this example? > > \setuphead [title] [align=left] Hi Jan U., flushleft is the value to get left aligninig. I read the explanation somewhere. Left and right aligned to the right and left. They are kept for compatibility. I hope it helps, 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] color check
On Thu, Dec 6, 2018 at 10:55 AM Floris van Manen wrote: > while experimenting with the sample transparency color code > > > \definecolor [transparentred] [r=1,t=.5,a=1] > \definecolor [transparentblue] [b=1,t=.5,a=1] > \definecolor [solidyellow] [y=1,t=1,a=1] > > \starttext > > \startTEXpage > ~This is some sample text that goes behind the rectangles\hskip-80mm > \blackrule[width=18mm,height=10mm,depth=10mm,color=solidyellow]\hskip-6mm > \blackrule[width=18mm,height=20mm,depth=1mm,color=transparentred]\hskip-6mm > > \blackrule[width=18mm,height=10mm,depth=10mm,color=transparentblue]\hskip-6mm > \blackrule[width=18mm,height=20mm,depth=1mm,color=solidyellow]\hskip27mm > \stopTEXpage > > \stoptext > > > > i get the intended result. > > > if i change the yellow t value to .99 > \definecolor [solidyellow] [y=1,t=0.99,a=1] > some green layer pops up. > > > as this is all about software, there is a reason to this. > it cold be the OSX preview program too, of course. > can someone explain to me ? > :-) > > here is ok under ubuntu Can you convert pdf to png ? This should show almost the same png. You can also prepend \nopdfcompression and post the pdf. \nopdfcompression \definecolor [transparentred] [r=1,t=.5,a=1] \definecolor [transparentblue] [b=1,t=.5,a=1] \definecolor [solidyellow] [y=1,t=1,a=1] \starttext \startTEXpage \definecolor [solidyellow] [y=1,t=1,a=1] ~This is some sample text that goes behind the rectangles\hskip-80mm \blackrule[width=18mm,height=10mm,depth=10mm,color=solidyellow]\hskip-6mm \blackrule[width=18mm,height=20mm,depth=1mm,color=transparentred]\hskip-6mm \blackrule[width=18mm,height=10mm,depth=10mm,color=transparentblue]\hskip-6mm \blackrule[width=18mm,height=20mm,depth=1mm,color=solidyellow]\hskip27mm \stopTEXpage \startTEXpage \definecolor [solidyellow] [y=1,t=0.99,a=1] ~This is some sample text that goes behind the rectangles\hskip-80mm \blackrule[width=18mm,height=10mm,depth=10mm,color=solidyellow]\hskip-6mm \blackrule[width=18mm,height=20mm,depth=1mm,color=transparentred]\hskip-6mm \blackrule[width=18mm,height=10mm,depth=10mm,color=transparentblue]\hskip-6mm \blackrule[width=18mm,height=20mm,depth=1mm,color=solidyellow]\hskip27mm \stopTEXpage \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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] color check
indeed, it’s probably related to the preview of osx 10.11.6 version. e.g. if i paste the pdf into this mail, i shows up correctly. t4test.pdf Description: Adobe PDF document > On 6 Dec 2018, at 11:02, Taco Hoekwater wrote: > > Hi Floris, > >> >> if i change the yellow t value to .99 >> \definecolor [solidyellow] [y=1,t=0.99,a=1] >> some green layer pops up. >> >> > > Test works OK for me, with the two ConTeXt releases I tried: > > current version: 2016.11.24 12:05 > current version: 2018.12.01 13:20 > > macOS Mojave 10.14.1 > > Best wishes, > Taco > > ___ > 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 > ___ signature.asc Description: Message signed with OpenPGP using GPGMail ___ 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] color check
On 12/6/18 10:55 AM, Floris van Manen wrote: > while experimenting with the sample transparency color code > [...] > if i change the yellow t value to .99 > \definecolor [solidyellow] [y=1,t=0.99,a=1] > some green layer pops up. > > as this is all about software, there is a reason to this. > it cold be the OSX preview program too, of course. > can someone explain to me ? > :-) Hi Floris, this is an Apple Preview issue. I wonder what it might be doing wrong. Evince, mupdf-gl and acroread for Linux display it fine (see the attached image). 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] color check
Hi Floris, > > if i change the yellow t value to .99 > \definecolor [solidyellow] [y=1,t=0.99,a=1] > some green layer pops up. > > Test works OK for me, with the two ConTeXt releases I tried: current version: 2016.11.24 12:05 current version: 2018.12.01 13:20 macOS Mojave 10.14.1 Best wishes, Taco ___ 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] color check
while experimenting with the sample transparency color code \definecolor [transparentred] [r=1,t=.5,a=1] \definecolor [transparentblue] [b=1,t=.5,a=1] \definecolor [solidyellow] [y=1,t=1,a=1] \starttext \startTEXpage ~This is some sample text that goes behind the rectangles\hskip-80mm \blackrule[width=18mm,height=10mm,depth=10mm,color=solidyellow]\hskip-6mm \blackrule[width=18mm,height=20mm,depth=1mm,color=transparentred]\hskip-6mm \blackrule[width=18mm,height=10mm,depth=10mm,color=transparentblue]\hskip-6mm \blackrule[width=18mm,height=20mm,depth=1mm,color=solidyellow]\hskip27mm \stopTEXpage \stoptext i get the intended result. if i change the yellow t value to .99 \definecolor [solidyellow] [y=1,t=0.99,a=1] some green layer pops up. as this is all about software, there is a reason to this. it cold be the OSX preview program too, of course. can someone explain to me ? :-) .F signature.asc Description: Message signed with OpenPGP using GPGMail ___ 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] Ending strings with non-break space in lang-txt.lua
On 12/6/2018 10:26 AM, Marco Patzer wrote: On Thu, 6 Dec 2018 09:34:57 +0100 Hans Hagen wrote: Also, how about: \at{\labeltext{atpage}}[#1] indeed, that is the command to use Don't get too hung up on that command. That was just a quick way to demonstrate the point and create an MWE. can you experiment with this \unexpanded\def\leftofreferencecontent {\removeunwantedspaces \nobreakspace \ignorespaces} This fixes the MWE, but it doesn't prevent all "unfortunate" line breaks caused by the spaces. At least it doesn't if \labeltext is used separately to obtain the translated strings. Currently I use (in one of my modules): \def\foo{\labeltext\v!atpage\currentreferencepage} This works (as by your suggestion): \def\foo{\labeltext\v!atpage \removeunwantedspaces\nobreakspace\ignorespaces \currentreferencepage} Which basically replaces the space with a non-break space after the fact. So I wonder if it's not a better solution to fix the initial definitions. But I might be mistaken or I'm overlooking something where this might cause issues. it then interferes with mechanisms that inject spaces themselves (as \at{...}[] (i'll add am auto check space and replace by nonbreak space trick) 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] Ending strings with non-break space in lang-txt.lua
On Thu, 6 Dec 2018 09:34:57 +0100 Hans Hagen wrote: > > Also, how about: > > > > \at{\labeltext{atpage}}[#1] > > indeed, that is the command to use Don't get too hung up on that command. That was just a quick way to demonstrate the point and create an MWE. > can you experiment with this > > \unexpanded\def\leftofreferencecontent >{\removeunwantedspaces > \nobreakspace > \ignorespaces} This fixes the MWE, but it doesn't prevent all "unfortunate" line breaks caused by the spaces. At least it doesn't if \labeltext is used separately to obtain the translated strings. Currently I use (in one of my modules): \def\foo{\labeltext\v!atpage\currentreferencepage} This works (as by your suggestion): \def\foo{\labeltext\v!atpage \removeunwantedspaces\nobreakspace\ignorespaces \currentreferencepage} Which basically replaces the space with a non-break space after the fact. So I wonder if it's not a better solution to fix the initial definitions. But I might be mistaken or I'm overlooking something where this might cause issues. Marco ___ 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] Ending strings with non-break space in lang-txt.lua
On 12/5/2018 10:29 PM, Alan Braslau wrote: On Wed, 5 Dec 2018 19:47:31 +0100 Marco Patzer wrote: Hi! I've got a few unfortunate line breaks in my documents. In particular, breaks are introduced in between the string “page” and the number: See figure 1 at page 2. The reason is that many strings in lang-txt.lua end in a space, rather than a non-break space: ["atpage"]={ ["labels"]={ … ["en"]="at page ", … I fixed this by defining \setuplabeltext [en] [atpage=at page\nbsp] So I wonder: Does it ever make sense to have a regular space at the end of those commands? I just skimmed through the file and most, if not all, strings ending in a space would actually benefit from having it replaced by a non-break space IMO. Example: \def\pageref#1%% {\in{figure}[#1] \labeltext{atpage}\at[#1]} \starttext \hsize 3cm See \pageref{foo}. \page \startplacefigure [reference=foo] \stopplacefigure \stoptext I agree, it drives me nuts to see p. 5 or in Figure 8 etc. Also, how about: \at{\labeltext{atpage}}[#1] indeed, that is the command to use (and does this make the space in the label redundant?) In any case it is a bit sloppy... can you experiment with this \unexpanded\def\leftofreferencecontent {\removeunwantedspaces \nobreakspace \ignorespaces} - 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] commands manual (setup-en.pdf) organized by topic
On 12/6/2018 7:30 AM, Jan U. Hasecke wrote: Am 05.12.18 um 19:01 schrieb Wolfgang Schuster: You can get a list of the files with context --extra=setups --list and create a document with a limited number of commands from certain categories with context --extra=setups delimitedtext,narrow Cool! Neat factsheet to print out, if you give a workshop about ConTeXt. I am looking for a small text explaining the naming system of the commands, because I only partly understand the interdependence of eg. singular and plural commands. mostly historic (we don't want to drop compatibility) What is the difference of singular and plural commands like \setupfloat and \setupfloats. Does the singular always inherit from the plural? And why? in most cases they're synonyms I have a limited understanding of the \defineX \setupX and \X line, but would love to hear more. just try one command, say \defineframed \setupframed ... the concepts are the same (only a few commands for practical reasons behave different) And lately I often see here that setups are named like "foo:bar". What is the meaning of the double colon? variants (same command, different options) or instances So what I would often need is a How-to-read-the-setup-en-pdf. 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 ___