Re: [NTG-context] \jobname and \doifelse
On 11/6/22 11:21, Hans Hagen via ntg-context wrote: > [...] > More relevan tis that you'r on TeX where catcodes matter > (here letter vs other) > >\doifelse{\inputfilebarename}{oeps} > {yes}{no} > >\doifelse{\detokenize\expandafter{\jobname}}{\detokenize{oeps}} > {yes}{no} Many thanks for your explanation, Hans. I think I have to start studying basic notions in TeX. Many thanks for your help again, Pablo ___ 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 ___
Re: [NTG-context] \jobname and \doifelse
On 11/5/22 16:55, Wolfgang Schuster via ntg-context wrote: > Pablo Rodriguez via ntg-context schrieb am 05.11.2022 um 16:30: >> >>\doifelse{\jobname}{a} >> {yes}{no} >> >> I get "no" as in TeX and "yes" with Lua, being "a.tex" the source file. >> >> The TeX conditional used to work before. >> > Are you sure the check worked in the past? Many thanks for your reply, Wolfgang. I thought this used to work before. Now I realize I have to check the use of \doif{\jobname} and \doifelse{\jobname} in all my documents. > The content of \jobname has catcode 12 while you "a" you check against > has catcode 11, and even when \jobname result in "a" they are different > because the catcodes differ. I see now. Not that I fully understand what catcodes are, but \doifsamestringelse should be what I have used here (as suggested in https://wiki.contextgarden.net/System_Macros/Branches_and_Decisions#.5Cdoifsamestringelse.2C.5Cdoifsamestring.2C.5Cdoifnotsamestring). Just a final question: \doif compares both strings and catcodes and \doifsamestring compares only strings. Or am I missing something here too. Many thanks for your help, Pablo ___ 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 ___
Re: [NTG-context] \jobname and \doifelse
On 11/5/2022 4:30 PM, Pablo Rodriguez via ntg-context wrote: Dear list, using current latest (2022.10.22 11:23), I have the following sample: \starttext \doifelse{\jobname}{a} {yes}{no} \jobname \startluacode if tex.jobname == "a" then context("yes") else context("no") end \stopluacode \stoptext I get "no" as in TeX and "yes" with Lua, being "a.tex" the source file. The TeX conditional used to work before. Am I missing something or have I hit a bug? I’m on Linux64 (if this may be relevant). More relevan tis that you'r on TeX where catcodes matter (here letter vs other) \doifelse{\inputfilebarename}{oeps} {yes}{no} \doifelse{\detokenize\expandafter{\jobname}}{\detokenize{oeps}} {yes}{no} 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 ___
Re: [NTG-context] \jobname and \doifelse
Pablo Rodriguez via ntg-context schrieb am 05.11.2022 um 16:30: Dear list, using current latest (2022.10.22 11:23), I have the following sample: \starttext \doifelse{\jobname}{a} {yes}{no} \jobname \startluacode if tex.jobname == "a" then context("yes") else context("no") end \stopluacode \stoptext I get "no" as in TeX and "yes" with Lua, being "a.tex" the source file. The TeX conditional used to work before. Am I missing something or have I hit a bug? Are you sure the check worked in the past? The content of \jobname has catcode 12 while you "a" you check against has catcode 11, and even when \jobname result in "a" they are different because the catcodes differ. You can see the same result in the example below where the second check compares two a with different catcodes (11 and 12) while the first check has the same catcode (11) for both a's. \starttext \edef\A{a} \edef\B{a} \ifx\A\B yes \else no \fi \begingroup \catcode`a=12 \gdef\B{a} \endgroup \ifx\A\B yes \else no \fi \stoptext Wolfgang ___ 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] \jobname and \doifelse
Dear list, using current latest (2022.10.22 11:23), I have the following sample: \starttext \doifelse{\jobname}{a} {yes}{no} \jobname \startluacode if tex.jobname == "a" then context("yes") else context("no") end \stopluacode \stoptext I get "no" as in TeX and "yes" with Lua, being "a.tex" the source file. The TeX conditional used to work before. Am I missing something or have I hit a bug? I’m on Linux64 (if this may be relevant). Many thanks for your help, Pablo ___ 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 ___
Re: [NTG-context] How to remove \jobname-mpgraph.dddd?
On 22-10-2010 2:03, Mojca Miklavec wrote: I have a silly question - how do I remove mpgraph files now that ctxtools is gone and context --purge doesn't know about them? context doesn't need to know about mpgraph files as long as MKIV is not generating them, but if there is no mkii-only --purge alternative hm, when I find the time I'll add it to context-the-lua-script 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] How to remove \jobname-mpgraph.dddd?
On 22 oct. 2010, at 02:03, Mojca Miklavec wrote: I have a silly question - how do I remove mpgraph files now that ctxtools is gone and context --purge doesn't know about them? context doesn't need to know about mpgraph files as long as MKIV is not generating them, but if there is no mkii-only --purge alternative ... I have fifty files \jobname-mpgraph.4000 ... \jobname-mpgraph.3951 and even though I can use rm, --purge would be a lot more convenient. Mojca Hi Mojca, If you are working on a Mac, with TeXShop, I can tell you what I do: my mkiv.engine file contains the following: #!/bin/bash source /Volumes/OK/context-minimal/tex/setuptex context $1 rm -f *.tui *.log *.tuo *.xdv *.mp *.tmp *.top *-mpgraph.* *-mpgraph-temp.dvi *.tuc So that after running context, the only file which is kept is \jobname.pdf (however this may be dangerous if you are using MetaPost with file suffixes *.mp. In my case since everything is done through context and files *.tex, I have no problem). Best regards: OK___ 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] How to remove \jobname-mpgraph.dddd?
I have a silly question - how do I remove mpgraph files now that ctxtools is gone and context --purge doesn't know about them? context doesn't need to know about mpgraph files as long as MKIV is not generating them, but if there is no mkii-only --purge alternative ... I have fifty files \jobname-mpgraph.4000 ... \jobname-mpgraph.3951 and even though I can use rm, --purge would be a lot more convenient. Mojca ___ 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 to remove \jobname-mpgraph.dddd?
On Fri, Oct 22, 2010 at 2:03 AM, Mojca Miklavec mojca.miklavec.li...@gmail.com wrote: I have a silly question - how do I remove mpgraph files now that ctxtools is gone and context --purge doesn't know about them? context doesn't need to know about mpgraph files as long as MKIV is not generating them, but if there is no mkii-only --purge alternative ... I have fifty files \jobname-mpgraph.4000 ... \jobname-mpgraph.3951 and even though I can use rm, --purge would be a lot more convenient. Does mtxrun textutil --purgeall work ? -- 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 ___
[NTG-context] foldername instead of jobname
Hi, marking=on often uses \jobname. My file's name is not as important as its respective folder name. Is it possible to read and reuse this folder's name? Thanks, Steffen ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] foldername instead of jobname
Steffen Wolfrum wrote: Hi, marking=on often uses \jobname. My file's name is not as important as its respective folder name. Is it possible to read and reuse this folder's name? In mkii you would have to do something with \write18, I fear. In mkiv you can simply do: \edef\foldername{\ctxlua{tex.sprint(lfs.currentdir())}} (assuming the jobname file lives inside the current directory) 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] foldername instead of jobname
Am 11.07.2008 um 22:44 schrieb Taco Hoekwater: In mkiv you can simply do: \edef\foldername{\ctxlua{tex.sprint(lfs.currentdir())}} (assuming the jobname file lives inside the current directory) quite comfortable ;o) st. ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Pagesize papersize: Writing jobname/date outside page area
Thomas A. Schmitz wrote: On Apr 17, 2007, at 3:39 PM, Tobias Burnus wrote: Hello, I have pagesize papersize and use crop marks. What I actually miss is the possibility to put text (Project name, date/time) outside the page. Currently, ConTeXt only prints there the colour bars, the page numbers and the crop marks. Example: http://glossary.ippaper.com/default.asp?req=glossary/term/ 1972catitemid= As a work around I currently misuse the footer, but I'm afraid that I will forget to remove it for the final version. (Just for curiosity and nothing I need: Does ConTeXt also support register marks?) Tobias I'm not sure if this is what you're looking for, but I wrote a module for my own use that has similar features. It's fairly brief, so I just include the code here. It's used like this: \usemodule[crop][Mark=Camera,Info=yes] It should be easy to modify the definitions. \def\pagecutmarksymbol{\the\realpageno} \def\pagecutmarklength{.5cm} \let\pagecutmarktoptext\empty \let\pagecutmarkbottomtext \empty \setuplayout[marking=text] \setuplayout[marking=empty] \setuplayout[marking=color] \setuplayout[marking=on] - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
[NTG-context] Pagesize papersize: Writing jobname/date outside page area
Hello, I have pagesize papersize and use crop marks. What I actually miss is the possibility to put text (Project name, date/time) outside the page. Currently, ConTeXt only prints there the colour bars, the page numbers and the crop marks. Example: http://glossary.ippaper.com/default.asp?req=glossary/term/1972catitemid= As a work around I currently misuse the footer, but I'm afraid that I will forget to remove it for the final version. (Just for curiosity and nothing I need: Does ConTeXt also support register marks?) Tobias ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Pagesize papersize: Writing jobname/date outside page area
On Apr 17, 2007, at 3:39 PM, Tobias Burnus wrote: Hello, I have pagesize papersize and use crop marks. What I actually miss is the possibility to put text (Project name, date/time) outside the page. Currently, ConTeXt only prints there the colour bars, the page numbers and the crop marks. Example: http://glossary.ippaper.com/default.asp?req=glossary/term/ 1972catitemid= As a work around I currently misuse the footer, but I'm afraid that I will forget to remove it for the final version. (Just for curiosity and nothing I need: Does ConTeXt also support register marks?) Tobias I'm not sure if this is what you're looking for, but I wrote a module for my own use that has similar features. It's fairly brief, so I just include the code here. It's used like this: \usemodule[crop][Mark=Camera,Info=yes] It should be easy to modify the definitions. Best Thomas %%% module t-crop%%% \startmodule[crop] \unprotect \setupmodule[Mark=Cross,Info=no] \processaction[\currentmoduleparameter{Mark}] [Camera= \def\CropMark{Camera}, Cross= \def\CropMark{Cross}, \v!unknown= \def\CropMark{\relax}, \v!default= \def\CropMark{Cross}] \processaction[\currentmoduleparameter{Info}] [yes= \def\InfoMark{Info}, no= \def\InfoMark{}, \v!unknown= \def\InfoMark{}, \v!default= \def\InfoMark{}] \setupbackgrounds[page][background={\CropMark,\InfoMark}] % We define names for the elements of our cropmarks. \defineoverlay[Cross][\reuseMPgraphic{Cross}] \defineoverlay[Camera][\reuseMPgraphic{Camera}] \defineoverlay[Info][{\getbuffer[info]}] \startbuffer[info] \vbox to \paperheight \bgroup \vskip -1 cm \framed[frame=off,align=high]{\tt \tx \jobname - \currentdate [y,/,mm,/,dd]\ - \currenttime\ - \realfolio\ of \lastpage} \egroup \stopbuffer \startreusableMPgraphic{Cross} StartPage; %topleft z5ctl = ulcorner Page ; z6ctl = (x5ctl - 1cm,y5ctl) ; z7ctl = (x5ctl + 1cm,y5ctl) ; z8ctl = (x5ctl,y5ctl - 1cm) ; z9ctl = (x5ctl,y5ctl + 1cm) ; draw z6ctl--z7ctl ; draw z8ctl--z9ctl ; %topright z5ctr = urcorner Page ; z6ctr = (x5ctr - 1cm,y5ctr) ; z7ctr = (x5ctr + 1cm,y5ctr) ; z8ctr = (x5ctr,y5ctr - 1cm) ; z9ctr = (x5ctr,y5ctr + 1cm) ; draw z6ctr--z7ctr ; draw z8ctr--z9ctr ; %bottomright z5cbr = lrcorner Page ; z6cbr = (x5cbr - 1cm,y5cbr) ; z7cbr = (x5cbr + 1cm,y5cbr) ; z8cbr = (x5cbr,y5cbr - 1cm) ; z9cbr = (x5cbr,y5cbr + 1cm) ; draw z6cbr--z7cbr ; draw z8cbr--z9cbr ; %bottomleft z5cbl = llcorner Page ; z6cbl = (x5cbl - 1cm,y5cbl) ; z7cbl = (x5cbl + 1cm,y5cbl) ; z8cbl = (x5cbl,y5cbl - 1cm) ; z9cbl = (x5cbl,y5cbl + 1cm) ; draw z6cbl--z7cbl ; draw z8cbl--z9cbl ; \stopreusableMPgraphic \startreusableMPgraphic{Camera} StartPage; %topleft z5tl = ulcorner Page ; z6tl = (x5tl - 0.2cm,y5tl) ; z7tl = (x5tl - 1.2cm,y5tl) ; z8tl = (x5tl - 0.8cm,y5tl) ; z9tl = (x5tl - 1 cm,y5tl - 0.2cm) ; z10tl = (x5tl - 1 cm,y5tl + 0.2cm) ; draw z6tl--z7tl ; draw z8tl..z9tl..z7tl..z10tl..cycle ; draw z9tl--z10tl ; z11tl = (x5tl,y5tl + 0.2cm) ; z12tl = (x5tl,y5tl + 1.2cm) ; z13tl = (x5tl,y5tl + 0.8cm) ; z14tl = (x5tl - 0.2cm,y5tl + 1cm) ; z15tl = (x5tl + 0.2cm,y5tl + 1cm) ; draw z11tl--z12tl ; draw z12tl..z14tl..z13tl..z15tl..cycle ; draw z14tl--z15tl ; %topright z5tr = urcorner Page ; z6tr = (x5tr + 0.2cm,y5tr) ; z7tr = (x5tr + 1.2cm,y5tr) ; z8tr = (x5tr + 0.8cm,y5tr) ; z9tr = (x5tr + 1 cm,y5tr - 0.2cm) ; z10tr = (x5tr + 1 cm,y5tr + 0.2cm) ; draw z6tr--z7tr ; draw z8tr..z9tr..z7tr..z10tr..cycle ; draw z9tr--z10tr ; z11tr = (x5tr,y5tr + 0.2cm) ; z12tr = (x5tr,y5tr + 1.2cm) ; z13tr = (x5tr,y5tr + 0.8cm) ; z14tr = (x5tr - 0.2cm,y5tr + 1cm) ; z15tr = (x5tr + 0.2cm,y5tr + 1cm) ; draw z11tr--z12tr ; draw z12tr..z14tr..z13tr..z15tr..cycle ; draw z14tr--z15tr ; %bottomleft z5bl = llcorner Page ; z6bl = (x5bl - 0.2cm,y5bl) ; z7bl = (x5bl - 1.2cm,y5bl) ; z8bl = (x5bl - 0.8cm,y5bl) ; z9bl = (x5bl - 1 cm,y5bl - 0.2cm) ; z10bl = (x5bl - 1 cm,y5bl + 0.2cm) ; draw z6bl--z7bl ; draw z8bl..z9bl..z7bl..z10bl..cycle ; draw z9bl--z10bl ; z11bl = (x5bl,y5bl - 0.2cm) ; z12bl = (x5bl,y5bl - 1.2cm) ; z13bl = (x5bl,y5bl - 0.8cm) ; z14bl = (x5bl - 0.2cm,y5bl - 1cm) ; z15bl = (x5bl + 0.2cm,y5bl - 1cm) ; draw z11bl--z12bl ; draw z12bl..z14bl..z13bl..z15bl..cycle ; draw z14bl--z15bl ; %bottomright z5br = lrcorner Page ; z6br = (x5br + 0.2cm,y5br) ; z7br = (x5br + 1.2cm,y5br) ; z8br = (x5br + 0.8cm,y5br) ; z9br = (x5br + 1 cm,y5br - 0.2cm) ; z10br = (x5br + 1 cm,y5br + 0.2cm) ; draw z6br--z7br ; draw z8br..z9br..z7br..z10br..cycle ; draw z9br--z10br ; z11br = (x5br,y5br - 0.2cm) ; z12br = (x5br,y5br - 1.2cm) ; z13br = (x5br,y5br - 0.8cm) ; z14br = (x5br - 0.2cm,y5br - 1cm) ; z15br = (x5br + 0.2cm,y5br - 1cm) ; draw z11br--z12br ; draw z12br..z14br..z13br..z15br..cycle ; draw z14br--z15br ; \stopreusableMPgraphic \protect \stopmodule \endinput ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Pagesize papersize: Writing jobname/date outside page area
Thomas A. Schmitz wrote: I'm not sure if this is what you're looking for, but I wrote a module for my own use that has similar features. That is exactly what I was looking for. (For colour registering marks, one would have to print the marks in all colours (usually CMYK and/or spot colours). But as I was only curious about register marks and I print only in black and white, I don't mind.) Thanks Thomas, Tobias ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] installation: -jobname pdfetex option
Ed L Cashin [EMAIL PROTECTED] writes: ... Texexec still just shows a usage message. I bet I have to change something in texexec.ini, but I couldn't find it last time I looked. I'll look again. Now by doing pdfetex \cont-en test.tex I'm able to see the example that made me want to upgrade. It turned out that when I copied the new perl files to the bin directory, there were some old symlinks there, and texutil was overwriting texexec. That was hard to figure out! ... but only because I wasn't reading the usage message carefully. It did say texutil. :) -- --Ed L Cashin| PGP public key: [EMAIL PROTECTED]| http://noserose.net/e/pgp/ ___ ntg-context mailing list [EMAIL PROTECTED] http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] installation: -jobname pdfetex option (was Re: [NTG-context] columns and alignment at the bottom)
At 16:26 17/10/2003, you wrote: I looked around a bit in the archives, but I'm not sure which zip that is, so I decided to go ahead and upgrade my whole tetex to 2.0.2. I went to pragma-ade and followed the links to find pdftex 14h. http://www.pragma-ade.com/context/linuxtex.zip to give you some bin only test bed i also put there: http://www.pragma-ade.com/context/linux.zip Hans ___ ntg-context mailing list [EMAIL PROTECTED] http://www.ntg.nl/mailman/listinfo/ntg-context