Re: [NTG-context] How well do ConTeXt (lua)module for other users?
Thanx Wolfgang. Is there a solid practice of naming modules? I noticed that the names appear modules including introductory letters p or t ... You also used the name p-test.lua. What does it mean? How to correctly name the module, or what other elements should it include? Best regards Jaroslav Dne 19.7.2011 17:06, Wolfgang Schuster napsal(a): Am 19.07.2011 um 16:26 schrieb Jaroslav Hajtmar: Great ... that's exactly what I needed ... Thanks very much Wolfgang. It can be somewhere on similar techniques to read more? Just links to some sample files to the dissected ... You should always read Hans bet announcements where he often mentions new features and sometimes gives examples. Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] How well do ConTeXt (lua)module for other users?
On 20-7-2011 9:40, Jaroslav Hajtmar wrote: Thanx Wolfgang. Is there a solid practice of naming modules? I noticed that the names appear modules including introductory letters p or t ... You also used the name p-test.lua. What does it mean? How to correctly name the module, or what other elements should it include? p is for private i.e. never part of the distribution t is for third party i.e. can be installed on demand - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] OT: Pdf info
Hello, this question in not straightly related to Context, but Context users may have solved it and Ctx may be used to solve it. I would need to get the following information from .pdf file(s): - number of pages, - common width and height of pages (provided that they are the same; otherwise the dimension can be e.g. zero). The final goal is to use Ctx as a .pdf joining engine - to provide this, I need to know whether the .pdf to be inserted is portrait or landscape oriented, what is its size (so if to be scaled or not) etc. So Lua inside Ctx may be used to get the required .pdf info, if necessary. If an external program was used, it should be non-interactive (command-line oriented), free and working under Windows. Does anyone have any experience with such a task? Kind regards, Lukas -- Ing. Lukáš Procházka [mailto:l...@pontex.cz] Pontex s. r. o. [mailto:pon...@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] OT: Pdf info
On 07/20/11 13:21, Procházka Lukáš Ing. - Pontex s. r. o. wrote: Hello, this question in not straightly related to Context, but Context users may have solved it and Ctx may be used to solve it. I would need to get the following information from .pdf file(s): - number of pages, - common width and height of pages (provided that they are the same; otherwise the dimension can be e.g. zero). There is the macro \getfiguredimensions which, amongst other things, sets up \noffigurepages, \figurewidth, and \figureheight. Here is an excerpt from a macro I have been using since 'forever': \newcount\imgcount % to store the number of pages \unexpanded\def\addimage#1{% \getfiguredimensions[#1.pdf]% \imgcount=\noffigurepages\relax \dorecurse {\the\imgcount} {\getfiguredimensions[#1.pdf][page=\recurselevel]% \ifdim\figurewidth\figureheight ... \fi }} 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] OT: Pdf info
2011/7/20 Procházka Lukáš Ing. - Pontex s. r. o. l...@pontex.cz: Hello, this question in not straightly related to Context, but Context users may have solved it and Ctx may be used to solve it. I would need to get the following information from .pdf file(s): - number of pages, - common width and height of pages (provided that they are the same; otherwise the dimension can be e.g. zero). The final goal is to use Ctx as a .pdf joining engine - to provide this, I need to know whether the .pdf to be inserted is portrait or landscape oriented, what is its size (so if to be scaled or not) etc. So Lua inside Ctx may be used to get the required .pdf info, if necessary. If an external program was used, it should be non-interactive (command-line oriented), free and working under Windows. Does anyone have any experience with such a task? You can use some macros (see Taco), and for external programs google for mupdf and xpdf Tthe lua pdf library with mkiv should be also useful, but I've still to play with it. -- 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] OT: Pdf info
2011/7/20 Procházka Lukáš Ing. - Pontex s. r. o. l...@pontex.cz: Hello, this question in not straightly related to Context, but Context users may have solved it and Ctx may be used to solve it. I would need to get the following information from .pdf file(s): - number of pages, - common width and height of pages (provided that they are the same; otherwise the dimension can be e.g. zero). The final goal is to use Ctx as a .pdf joining engine - to provide this, I need to know whether the .pdf to be inserted is portrait or landscape oriented, what is its size (so if to be scaled or not) etc. So Lua inside Ctx may be used to get the required .pdf info, if necessary. If an external program was used, it should be non-interactive (command-line oriented), free and working under Windows. Does anyone have any experience with such a task? You can use some macros (see Taco), and for external programs google for mupdf and xpdf Tthe lua pdf library with mkiv should be also useful, but I've still to play with it. luatex's epdf library (= poppler Lua bindings, maybe that's what Luigi meant) allows to extract all this info from a pdf file, with a bit of Lua programming. Regards, Hartmut -- Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] OT: Pdf info
On Wed, Jul 20, 2011 at 2:02 PM, Hartmut Henkel hartmut_hen...@gmx.de wrote: luatex's epdf library (= poppler Lua bindings, maybe that's what Luigi meant) allows to extract all this info from a pdf file, with a bit of Lua programming. Yes, I meant the epdf library. -- 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] vertical alignment in TOC
On 07/20/2011 12:43 AM, Andreas Harder wrote: \define[3]\ChapterList% {\bTABLE[offset=none,rulethickness=0pt,width=broad] \bTR % \bTD #1 \eTD \bTD #2 \eTD \bTD[width=1.5em,align={left,high}]\strut #3 \eTD \eTR \eTABLE} \setuplist[chapter][alternative=command,command=\ChapterList] \placelist[chapter][criterium=text] \stoptext If I got your right, this should work. Thanks Andreas, this one looks very good! Hans had sent me a more complex patch which may go into the core (something like alternative=high), but this is good to have. All best Thomas ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] markdown
On 19-7-2011 7:25, Wolfgang Schuster wrote: Can you then also add a few features: - Headings use \startstructurelevel - Paragraphs are enclosed in startparagraph/stopparagraph - emphasis and bold styles use \definehiglight command to make it possible to change the layout of markdown documents where ConTeXt is only used to produce a PDF. I uploaded a beta with a markdown module. Not being a user myself I leave it to others to provide documentation and examples. \starttext \startmarkdown % some examples needed \stopmarkdown \stoptext The code is derived from luamark (but a few 100% faster so I might have messed up). And of course, being the markdown evangelist, John will answer all questions. Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] OT: Pdf info
On Wed, 20 Jul 2011 14:02:00 +0200, Hartmut Henkel hartmut_hen...@gmx.de wrote: The lua pdf library with mkiv should be also useful, but I've still to play with it. luatex's epdf library (= poppler Lua bindings, maybe that's what Luigi meant) allows to extract all this info from a pdf file, with a bit of Lua programming. Regards, Hartmut Hello, would you provide a minimal example - if it is possible in the Ctx or Lua scope? Something like: \startluacode local info = SOMETHING.getInfo(File.pdf) local n = info.numPages local w = info.width local h = info.height \stopluacode Best regards, Lukas ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] highlighting aligned formulas
Hello, Is it possible (using ConTeXt MKII) to put a frame (and/or other highlighters) around an aligned multiline formula, and also around a single line of this equation array? (The equation number should align correctly outside the frame.) \mframed within an alignment seems to refuse the job. Digging the mailinglist brought up a 2006 hint of Hans referring to a \definealigned command which I also could not bring into action. Thanks, Andreas ps Asking as a new user it may be naive, but I still didn't figure out how to uncomment multiple lines (for debugging). ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] OT: Pdf info
On 20-7-2011 2:02, Hartmut Henkel wrote: 2011/7/20 Procházka Lukáš Ing. - Pontex s. r. o.l...@pontex.cz: Hello, this question in not straightly related to Context, but Context users may have solved it and Ctx may be used to solve it. I would need to get the following information from .pdf file(s): - number of pages, - common width and height of pages (provided that they are the same; otherwise the dimension can be e.g. zero). The final goal is to use Ctx as a .pdf joining engine - to provide this, I need to know whether the .pdf to be inserted is portrait or landscape oriented, what is its size (so if to be scaled or not) etc. So Lua inside Ctx may be used to get the required .pdf info, if necessary. If an external program was used, it should be non-interactive (command-line oriented), free and working under Windows. Does anyone have any experience with such a task? You can use some macros (see Taco), and for external programs google for mupdf and xpdf Tthe lua pdf library with mkiv should be also useful, but I've still to play with it. luatex's epdf library (= poppler Lua bindings, maybe that's what Luigi meant) allows to extract all this info from a pdf file, with a bit of Lua programming. indeed (although we still need to fill in some gaps) anyhow: local MyDocument = lpdf.epdf.load(sometext.pdf) context.starttext() local pages= MyDocument.pages local dummy= MyDocument.pages[1] -- we need lua 5.2 in order to avoid this local nofpages = #MyDocument.pages context.starttabulate { |c|c|c| } context.NC() context(page) context.NC() context(width) context.NC() context(height) context.NR() for i=1, nofpages do local page = pages[i] local bbox = page.CropBox or page.MediaBox context.NC() context(i) context.NC() context(bbox[4]-bbox[2]) context.NC() context(bbox[3]-bbox[1]) context.NR() end context.stoptabulate() context.stoptext() - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] OT: Pdf info (solved)
Hello, On Wed, 20 Jul 2011 13:29:35 +0200, luigi scarso luigi.sca...@gmail.com wrote: You can use some macros (see Taco), and for external programs google for mupdf and xpdf I installed Xpdf for Windows - http://gnuwin32.sourceforge.net/packages/xpdf.htm - and pdfinfo.exe does the job: C:\Programs.Con\Gnu4Win\XPdf\binpdfinfo c:\Lukas\Jobs\Drachov.PDPS\SO_126\Texts\TZ#.pdf Creator:pdftk 1.41 - www.pdftk.com Producer: itext-paulo-155 (itextpdf.sf.net-lowagie.com) CreationDate: 05/18/11 17:15:13 ModDate:05/18/11 17:15:13 Tagged: no Pages: 8 Encrypted: no Page size: 595 x 842 pts (A4) File size: 119898 bytes Optimized: no PDF version:1.4 Thanks all for their help. Best regards, Lukas -- Ing. Lukáš Procházka [mailto:l...@pontex.cz] Pontex s. r. o. [mailto:pon...@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] OT: Pdf info
local MyDocument = lpdf.epdf.load(sometext.pdf) context.starttext() local pages= MyDocument.pages local dummy= MyDocument.pages[1] -- we need lua 5.2 in order to avoid this local nofpages = #MyDocument.pages context.starttabulate { |c|c|c| } context.NC() context(page) context.NC() context(width) context.NC() context(height) context.NR() for i=1, nofpages do local page = pages[i] local bbox = page.CropBox or page.MediaBox context.NC() context(i) context.NC() context(bbox[4]-bbox[2]) context.NC() context(bbox[3]-bbox[1]) context.NR() end context.stoptabulate() context.stoptext() This code works perfectly, thank you Hans! Best regards, Lukas ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] markdown
On Wed, Jul 20, 2011 at 5:24 AM, Hans Hagen pra...@wxs.nl wrote: On 19-7-2011 7:25, Wolfgang Schuster wrote: The code is derived from luamark (but a few 100% faster so I might have messed up). And of course, being the markdown evangelist, John will answer all questions. With pleasure :) ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] highlighting aligned formulas
Am 20.07.2011 um 14:52 schrieb Andreas Richter: ps Asking as a new user it may be naive, but I still didn't figure out how to uncomment multiple lines (for debugging). You can comment whole paragraphs etc. with \starthiding … \stophiding Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] vertical alignment in TOC
On 20-7-2011 2:13, Thomas A. Schmitz wrote: On 07/20/2011 12:43 AM, Andreas Harder wrote: \bTD[width=1.5em,align={left,high}]\strut #3 \eTD best use endstruts as well \define[3]\ChapterList {\bTABLE[offset=none,rulethickness=0pt,width=broad] \bTR % \bTD \begstrut#1\endstrut \eTD \bTD \begstrut#2\endstrut \eTD \bTD[width=1.5em,align={left,high}]\begstrut#3\endstrut \eTD \eTR \eTABLE} - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] A cases type environment using a right brace?
On Thu, 21 Jul 2011, Alasdair McAndrew wrote: I'm trying to typeset a small column of numbers with a right brace on the right, and nothing on the left. (Sort of like the opposite to the right hand side of a cases environment). I've tried: (untested) \definemathmatrix[group][left={},right={\,\right\} }] \definemathmatrix[group][left={\left.}, right={\,\right\}}] \startgroup 10\NR 9\NR 8\NR \stopgroup \startgroup \NC 10 \NR \NC 9 \NR \NC 8 \NR \stopgroup Aditya ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] A cases type environment using a right brace?
Thanks so much, Aditya- works perfectly! -Alasdair On Thu, Jul 21, 2011 at 1:50 PM, Aditya Mahajan adit...@umich.edu wrote: On Thu, 21 Jul 2011, Alasdair McAndrew wrote: I'm trying to typeset a small column of numbers with a right brace on the right, and nothing on the left. (Sort of like the opposite to the right hand side of a cases environment). I've tried: (untested) \definemathmatrix[group][left=**{},right={\,\right\} }] \definemathmatrix[group][left=**{\left.}, right={\,\right\}}] \startgroup 10\NR 9\NR 8\NR \stopgroup \startgroup \NC 10 \NR \NC 9 \NR \NC 8 \NR \stopgroup Aditya __**__** ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/** listinfo/ntg-context http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/**projects/contextrev/http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net __**__** ___ -- Blog: http://amca01.wordpress.com Web: http://bit.ly/Alasdair Facebook: http://www.facebook.com/alasdair.mcandrew ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___