Re: [NTG-context] query re placing a float
Found the answer— location={here,left,3*hang} does what I want nicely. Sorry for the noise. Alan 2017-04-06 14:27 GMT-04:00 Alan Bowen: > I have a paragraph of text and I would like to place a float to the left > so that there a some lines above the float, some beside, and some below. Is > there a way to do this? > > What I have so far breaks the paragraph in two: one before the float and > one beside it (with a few lines below). If I invoke the float before the > paragraph, there are no lines above the float. > > \starttext > Quisque facilisis erat a dui. Nam malesuada ornare dolor. Cras gravida, > diam sit amet rhoncus ornare, erat elit consectetuer erat, id egestas pede > nibh eget odio. Proin tincidunt, velit vel porta elementum, magna diam > molestie sapien, non aliquet massa pede eu diam. Aliquam iaculis. Fusce et > ipsum et nulla tristique facilisis. Donec eget sem sit amet ligula viverra > gravida.% > \startplacefigure[title={A cow}, > location={here,left}, > align=middle, > number=yes] > {\externalfigure[cow.pdf][width=.45\textwidth]} > \stopplacefigure > Fusce ultrices, neque id dignissim ultrices, tellus mauris dictum elit, > vel lacinia enim metus eu nunc. Quisque facilisis erat a dui. Nam malesuada > ornare dolor. Cras gravida, diam sit amet rhoncus ornare, erat elit > consectetuer erat, id egestas pede nibh eget odio. Proin tincidunt, velit > vel porta elementum, magna diam molestie sapien, non aliquet massa pede eu > diam. Aliquam iaculis. Fusce et ipsum et nulla tristique facilisis. Donec > eget sem sit amet ligula viverra gravida. Etiam vehicula urna vel turpis. > Suspendisse sagittis ante a urna. Morbi a est quis orci consequat rutrum. > Nullam egestas feugiat felis. Integer adipiscing semper ligula. Nunc > molestie, nisl sit amet cursus convallis, sapien lectus pretium metus, > vitae pretium enim wisi id lectus. Donec vestibulum. Etiam vel nibh. Nulla > facilisi. Mauris pharetra. Donec augue. Fusce ultrices, neque id dignissim > ultrices, tellus mauris dictum elit, vel lacinia enim metus eu nunc. > > \stoptext > > Alan > ___ 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] query re placing a float
I have a paragraph of text and I would like to place a float to the left so that there a some lines above the float, some beside, and some below. Is there a way to do this? What I have so far breaks the paragraph in two: one before the float and one beside it (with a few lines below). If I invoke the float before the paragraph, there are no lines above the float. \starttext Quisque facilisis erat a dui. Nam malesuada ornare dolor. Cras gravida, diam sit amet rhoncus ornare, erat elit consectetuer erat, id egestas pede nibh eget odio. Proin tincidunt, velit vel porta elementum, magna diam molestie sapien, non aliquet massa pede eu diam. Aliquam iaculis. Fusce et ipsum et nulla tristique facilisis. Donec eget sem sit amet ligula viverra gravida.% \startplacefigure[title={A cow}, location={here,left}, align=middle, number=yes] {\externalfigure[cow.pdf][width=.45\textwidth]} \stopplacefigure Fusce ultrices, neque id dignissim ultrices, tellus mauris dictum elit, vel lacinia enim metus eu nunc. Quisque facilisis erat a dui. Nam malesuada ornare dolor. Cras gravida, diam sit amet rhoncus ornare, erat elit consectetuer erat, id egestas pede nibh eget odio. Proin tincidunt, velit vel porta elementum, magna diam molestie sapien, non aliquet massa pede eu diam. Aliquam iaculis. Fusce et ipsum et nulla tristique facilisis. Donec eget sem sit amet ligula viverra gravida. Etiam vehicula urna vel turpis. Suspendisse sagittis ante a urna. Morbi a est quis orci consequat rutrum. Nullam egestas feugiat felis. Integer adipiscing semper ligula. Nunc molestie, nisl sit amet cursus convallis, sapien lectus pretium metus, vitae pretium enim wisi id lectus. Donec vestibulum. Etiam vel nibh. Nulla facilisi. Mauris pharetra. Donec augue. Fusce ultrices, neque id dignissim ultrices, tellus mauris dictum elit, vel lacinia enim metus eu nunc. \stoptext Alan ___ 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] Problem loading a DLL with the latest Ctx beta
On 4/6/2017 11:03 AM, Procházka Lukáš Ing. wrote: Hello Akira, you mention possibility of --shell-escape at http://tug.org/pipermail/luatex/2017-March/006410.html. How exactly do you mean to combine "ffi" and "--shell-escape" to work with latest ConTeXt/LuaTeX? (I tried (rather amateurishly) to run "context --shell-escape WinTest.mkiv" - but it didn't help.) context doesn't use --shell-escape (control over executables happens via the sandbox mechanism) BTW: WinCon.dll contains some functions to print COLORED text to the console screen and enables some basic WinAPI functions (like capturing window bitmap) to Lua; I've been using especially colored printing in combination with ConTeXt ("warnings" in magenta, "errors" in red...). local ansicolor = { r = function(s) return "[0;31m" .. s .."[0;1m" end, g = function(s) return "[0;32m" .. s .."[0;1m" end, b = function(s) return "[0;34m" .. s .."[0;1m" end, c = function(s) return "[0;36m" .. s .."[0;1m" end, m = function(s) return "[0;35m" .. s .."[0;1m" end, y = function(s) return "[0;33m" .. s .."[0;1m" end } local formatters = string.formatters utilities.strings.formatters.add(formatters, "cr", [[cr(%s)]], { cr = ansicolor.r }) utilities.strings.formatters.add(formatters, "cg", [[cg(%s)]], { cg = ansicolor.g }) utilities.strings.formatters.add(formatters, "cb", [[cb(%s)]], { cb = ansicolor.b }) utilities.strings.formatters.add(formatters, "cc", [[cc(%s)]], { cc = ansicolor.c }) utilities.strings.formatters.add(formatters, "cm", [[cm(%s)]], { cm = ansicolor.m }) utilities.strings.formatters.add(formatters, "cy", [[cy(%s)]], { cy = ansicolor.y }) print(ansicolor.r("red")) print(ansicolor.g("green")) print(ansicolor.b("blue")) print(ansicolor.c("cyan")) print(ansicolor.m("magenta")) print(ansicolor.y("yellow")) logs.writer(formatters["this is in %!cr! or %!cg! or %!cb! or %s"]("red","green","blue","oeps")) logs.report("whatever","this is in %!cr! or %!cg! or %!cb! or %s","red","green","blue","oeps") (you can also use mtxrun --ansi ) Any way to re-enable user DLL loading into ConTeXt, even in the future, would be appreciated... Best regards, Lukas On Thu, 06 Apr 2017 00:05:28 +0200, Akira Kakutowrote: I encountered problem loading WinCon.dll (a module that I wrote and I've been using for several years) In the new lua(jit)tex, one cannot use DLL modules. See my mail in http://tug.org/pipermail/luatex/2017-March/006410.html http://tug.org/pipermail/luatex/2017-March/006413.html Reason: I could not build usable binaries for the new sources by linking dynamically lua-5.2.4 or luajit. Thus I changed to link lua-5.2.4 etc. statically. Best, Akira ___ 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 ___ -- - 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] Problem loading a DLL with the latest Ctx beta
How exactly do you mean to combine "ffi" and "--shell-escape" to work with latest ConTeXt/LuaTeX? In usual luatex, ffi needs --shell-escape, since ffi is dangerous from the point of view of the security. As you know, ConTeXt allows --shell-escape, so the following works with context test.tex. % % context test.tex % \starttext \placeformula \startformula j_1(2.387) = \startluacode local ffi = require("ffi") ffi.cdef[[ double _j1(double x); ]] local mscrt = ffi.load("msvcrt") tex.print(mscrt._j1(2.387)) \stopluacode \stopformula \stoptext In the above example, a function _j1(x) in msvcrt.dll is evaluated. The msvcrt.dll must be loaded as above, because standard C library is linked statically. The following DLLs can be used without loading, because luatex knows them: SHLWAPI.dll WSOCK32.dll USER32.dll ADVAPI32.dll SHELL32.dll KERNEL32.dll WS2_32.dll GDI32.dll Note that you may not be able to use "DLL Lua Modules" in this way. I don't know details. Try various cases. Best, Akira ___ 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] Problem loading a DLL with the latest Ctx beta
Hello Akira, you mention possibility of --shell-escape at http://tug.org/pipermail/luatex/2017-March/006410.html. How exactly do you mean to combine "ffi" and "--shell-escape" to work with latest ConTeXt/LuaTeX? (I tried (rather amateurishly) to run "context --shell-escape WinTest.mkiv" - but it didn't help.) BTW: WinCon.dll contains some functions to print COLORED text to the console screen and enables some basic WinAPI functions (like capturing window bitmap) to Lua; I've been using especially colored printing in combination with ConTeXt ("warnings" in magenta, "errors" in red...). Any way to re-enable user DLL loading into ConTeXt, even in the future, would be appreciated... Best regards, Lukas On Thu, 06 Apr 2017 00:05:28 +0200, Akira Kakutowrote: I encountered problem loading WinCon.dll (a module that I wrote and I've been using for several years) In the new lua(jit)tex, one cannot use DLL modules. See my mail in http://tug.org/pipermail/luatex/2017-March/006410.html http://tug.org/pipermail/luatex/2017-March/006413.html Reason: I could not build usable binaries for the new sources by linking dynamically lua-5.2.4 or luajit. Thus I changed to link lua-5.2.4 etc. statically. Best, Akira ___ 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 ___ -- Ing. Lukáš Procházka | mailto:l...@pontex.cz Pontex s. r. o. | mailto:pon...@pontex.cz | http://www.pontex.cz | IDDS:nrpt3sn Bezová 1658 147 14 Praha 4 Tel: +420 241 096 751 (+420 720 951 172) Fax: +420 244 461 038 ___ 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] side caption top aligned on grid -- not implemented?
At http://tex.stackexchange.com/q/362215/6819 I asked: How can I place the top line of the caption (location={left, high}) on the grid and have it align with the figure at same height. I hoped this to be solvable by some simple instructions that I just haven’t been able to figure out. But Henri Menke suggested in a comment that the mechanism might not be implemented. Is this really the case? And if so: is there any way to achieve the alignment anyway? I’d greatly appreciate any help as this is an important requirement for my present project! Best regards, Florian. Florian Grammel Copenhagen, Denmark ___ 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 ___