[NTG-context] Re: (any) link with document breaks Reader DC
On 6/27/24 14:04, Hans Hagen via ntg-context wrote: > On 6/27/2024 10:03 AM, Taco Hoekwater wrote: >> [...] >> I also installed a new Reader on my Windows 11 machine, and that >> one worked ok as well. It says “Continuous Release | Version >> 2024.002.20857 | 64 bit”, and it is the Win 11 specific EN (US) >> version.> > it also opens here after asking of that link is okay (same version) Many thanks for your reply, Hans. It seems that the crash only happens to me. > anyway, i noticed that the (messier by the day) user interface now > offers "AI assistent, full access" and "Generative Summary, full acess" > as well as some button in the top right corner with a weird attention > seeking coloring os maybe i should remove reader or at least start > thinking about quarantaining it in itrs own vm, one never knows At least the Spanish version doesn’t have that (yet, I’m afraid). > (it's a bit frightening to see what something as simple as pdf is > turning into: ecosystems, dependencies, business models, hypes, etc) I think this is the whole thing with AI, the vast majority of people may not be benefiting from it. 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: (any) link with document breaks Reader DC
On 6/27/24 10:03, Taco Hoekwater wrote: > [...] > On my Mac it did not crash, but that is a Reader from 2021 that I am > not willing to upgrade so I am not sure how useful that information > is. Many thanks for your reply, Taco. I suspect that macOS may not be affected by this issue. > I also installed a new Reader on my Windows 11 machine, and that one > worked ok as well. It says “Continuous Release | Version > 2024.002.20857 | 64 bit”, and it is the Win 11 specific EN (US) > version. Well, I would like to know why my case (and other people I asked) is different. Both Windows and Acrobat Reader in Spanish? 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Letter module broken?
On 6/26/24 21:33, Kip Warner wrote: > [...] > Will the modules automatically update when I run ./install.sh, or do I > need to periodically run the following? > >$ mtxrun --script install-modules --install --all Hi Kip, you need the second option. Cheers, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: “call for articles” (context meeting 2023)
On 6/24/24 07:25, Henning Hraban Ramm wrote: > [...] > Of course. Try \usemodule[cgj] – the module in the distribution is not > the same as the environment that I use for CGJ anymore, but it should > still work. I should update it, but it’s always in a preliminary state… “Work in progress” is the title of one of my projects: life. As a opinion, it might be easier to have a user module ("cg-journal") that is more accurate. This might help the writer to see the final output. But this is just my personal opinion. 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: (any) link with document breaks Reader DC
On 6/26/24 08:13, Henning Hraban Ramm wrote: > Am 25.06.24 um 22:24 schrieb Pablo Rodriguez via ntg-context: >> Sorry for asking for this, but would you be so kind to compile (or >> download the attachment) and open it with an updated Acrobat (opening >> Acrobat with the document)? >> >> I need that you double (or triple) click on the link (to the Garden) as >> fast as you can. > > Hi Pablo, > > MacOS 10.15 with Acrobat Reader 2024.002 (Build: 24.2.20857.0) Hi Hraban, many thanks for your reply, it helps me a lot. > first time, Acrobat asks for permission to open the link, after that I > can klick as often as I like, and it opens the website for every klick > (i.e. twice for a doubleclick). No crashes so far. If it asks for permission, it is working fine. It might be (a wild guess, since I don’t have access to macOS system) that the issue only happens with Windows computers. BTW, I have just consistenly experienced it on another Windows computer. > I experience frequent crashes of Acrobat Reader when I work with > annotations (correction workflow), but that’s a different problem. I see. I would really like to have at least a message from the command line (command prompt [as I guess Windows calls it]), so it might point to the cause of the crash. Again, 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] (any) link with document breaks Reader DC
Dear list, investigating the issue of why Acrobat Reader DC doesn’t recognize ConTeXt signatures, I related it to another issue. I use Acrobat Reader DC for Windows at work. DC is regularly updated. Since a year ago or so, if I open a PDF document (opening Acrobat with the document) and double-click (sometimes, it may be triple-click) too fast on a link or a signature field (either to be signed or already signed), Acrobat Reader crashes. I have tested sample documents on other computers and with other people and everybody told me Reader crashed. BTW, the document structure is perfectly fine (according to the Arlington PDF model from the PDF specification). I thought Acrobat Reader DC changed something and this was buggy. I have been consistently experiencing this issue for about a year, so I took for granted it was a common bug. I experienced the crash only with the Spanish version (the one installed on all tested computers). Although I sometimes I load the English version by pressing Ctrl when starting Acrobat, right now I cannot say whether I experienced the crash with the English version loaded. But this seemed to be not enough, since I have just found out that Acrobat Reader for Windows and macOS with the US English version may not crash (I was told). The sample document contains only a link. It has generated from the following source: \setupinteraction[state=start] \starttext \startTEXpage[offset=1dk] \protected\define[1]\myurl% {{\tt\goto{\hyphenatedurl{#1}}[url(#1)]}} \myurl{https://contextgarden.net} \stopTEXpage \stoptext Sorry for asking for this, but would you be so kind to compile (or download the attachment) and open it with an updated Acrobat (opening Acrobat with the document)? I need that you double (or triple) click on the link (to the Garden) as fast as you can. Either if this crashes Acrobat or not, I would really appreciate if you could tell me which is your OS and language version of Acrobat. I’m affraid I cannot tell yet what may be triggering the crash, but I view PDF in Windows with SumatraPDF. When I open them with Acrobat and click on any kind of link too fast, I get back to SumatraPDF (since Acrobat crashed and dissapeared). Excuse for what it seems to be a tricky issue with Acrobat (the signature being way more important than the crash ). Many thanks for your help in advance, Pablo sample-link.pdf Description: Adobe PDF document ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Inconsistencies with fonts/c2sc feature
On 6/25/24 19:53, Kirill Davidov wrote: > Yeah, I too checked it out of curiosity today, and yeah, the c2sc table > doesn't have the Latin entries. I suppose I will stick to a different > styling or go after the caps manually/with Lua. The "always" and "auto" > values help too, so thanks to you both! Hi Kirill, this font feature may work too: \startluacode fonts.handlers.otf.addfeature { name = "addedsc", type = "substitution", data = { A = "A.sc", B = "B.sc", C = "C.sc", D = "D.sc", E = "E.sc", F = "F.sc", G = "G.sc", H = "H.sc", I = "I.sc", J = "J.sc", K = "K.sc", L = "L.sc", M = "M.sc", N = "N.sc", O = "O.sc", P = "P.sc", Q = "Q.sc", R = "R.sc", S = "S.sc", T = "T.sc", U = "U.sc", V = "V.sc", W = "W.sc", X = "X.sc", Y = "Y.sc", Z = "Z.sc", }, } \stopluacode \definefontfeature[allsc][c2sc=yes, smcp=yes, addedsc=yes] But in that case, you may have c2sc and addedsc as mutually exclusive. Just in case it might 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Inconsistencies with fonts/c2sc feature
On 6/24/24 18:03, Kirill Davidov wrote: > > With STIX Two, c2sc (and smcp) works with any language as long as one > doesn't select a script in the font features, else it only works with > the chosen script. Hi Kirill, \definefontfeature [default] [default] [script=auto] may help there. > With New Computer Modern, it just doesn't work with any latin text no > matter the script chosen. I have tested https://mirrors.ctan.org/fonts/newcomputermodern/otf/NewCM10-Book.otf (released less than 10 days ago) and there is no c2sc for the Latin script. I have used FontForge and tested metrics (Metrics > New Metrics Window [Ctrl+K on my computer]). > That is, plain small caps work, caps to small caps don't. I’m afraid to say that the c2sc in the font seems to be a mess (to me at least). > What could be the reason to it? Is there anything I could do to > mitigate it? The following sample works for me (excluding Greek glyphs). script=auto, if you need to set the script (automatically). c2sc=always, if you need Greek c2sc. lowercasing=yes, since the smcp feature works for Latin glyphs. In a minimal sample: \definefontfeature [default] [default] [script=auto] \definefontfeature[allsc][c2sc=yes, smcp=yes, lowercasing=yes] \setupbodyfont[stix] \starttext \startbuffer {\language[ru]Моя любимая {\feature[+][allsc]ОС}---{\feature[+][allsc]Линукс}.}\crlf {\language[en]My favourite {\feature[+][allsc]OS} is {\feature[+][allsc]Linux}.} {\feature[+][allsc]Λινυξẞ.} \stopbuffer \getbuffer \setupbodyfont[newcomputermodern-book] \getbuffer \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: “call for articles” (context meeting 2023)
On 6/23/24 21:50, Henning Hraban Ramm wrote: >> [...] >> It would be really helpful for me to have the TeX source of an already >> published article, so I can adapt the template to my article. > [...] > Noting special, besides the header. I just thought about something similar to: \usemodule[article-basic] Or where are these start/stops (Article and Abstract) defined? This is to avoid having my own macros. 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: “call for articles” (context meeting 2023)
On 6/22/24 20:29, Henning Hraban Ramm wrote: > Hey, don’t want a journal this year? > > Pretty please… Hraban, well, I think I could write something (so I get a permanent ban on using ConTeXt ever again ). It would be really helpful for me to have the TeX source of an already published article, so I can adapt the template to my article. Many thanks for your work on this, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: (off-topic) hovering over links in Acrobat Reader
On 6/21/24 18:31, Hans Hagen wrote: > [...] > so that you can experiment a bit with it. We might at some point provide > optional descriptions per link but the quesiton is how to cleanly > interface this (easier if you use \define... instead of your own macros > for urls). Many thanks for the new options, Hans. Sorry, but I don’t know how I would have to use \define here instead of my macros. BTW, I created them long time ago to avoid having two commands (one to contain the address and another to typeset it), such as in (copied from the wiki): \useURL[anotherurl] [http://xkcd.com/224/] \from[aurl] % typesets the URL 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: weekend update
On 6/21/24 19:00, Hans Hagen via ntg-context wrote: > [...] > The last option can be handy when you don't want to make harvesting your > documents too easy for these ai bots (as in cloud based pdf stuff). It's > the first outcome of the multi-year, multi-stage, very scientific > 'inacessible pdf' project that Mikael S. and I recently started. Many thanks for the new upload, Hans. I have just tested this feature and I really like it. Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: (off-topic) hovering over links in Acrobat Reader
On 6/19/24 22:10, Wolfgang Schuster wrote: > [...] > This should be \protected\def > > \protect\def\myhref#1#2% >{...} Sorry for the mess, Wolfang and Hraban. I wasn’t aware of the mistake, since the PDF document was neither deleted not showing the colorful error word. I created the document with other commands and I rewrote them (introducing this error). Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: (off-topic) hovering over links in Acrobat Reader
On 6/19/24 21:55, Henning Hraban Ramm wrote: > Am 19.06.24 um 19:16 schrieb Pablo Rodriguez via ntg-context: >> Would you be so kind to test the attached document (and the one you may >> generate from the sample source) hovering over the link frames in >> Acrobat (ideally DC updated to latest)? >> >> At least, I would like to be sure what is going on here. >> >> Hovering over links is basic precaution before clicking them. >> >> To explain that to others, I’d rather know how Acrobat (Reader) behaves >> in these cases. > > Build 24.2.20857.0 on MacOS 10.15.7: > 1: no hover > 2: https://contextgarden.net > 3: https://contextgarden.net Many thanks for your help, Hraban. Thanks to your confirmation, I investigated the issue further (since there had to be something different with my documents). \setuptagging[state=start] is the culprit. "link" is the word displayed when links are hovered over. 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] (off-topic) hovering over links in Acrobat Reader
Dear list, I have the following source: \setupbodyfont[dejavu, sans, 24pt] \setupinteraction[state=start, style=, color=, contrastcolor=, display=new] \enabledirectives[references.border=darkgreen] \def\myurl#1% {{\tt\goto{\hyphenatedurl{#1}}[url(#1)]}} \protect\def\myhref#1#2% {\goto{\hyphenatedurl{#1}}[url(#2)]} \starttext \startTEXpage[pagestate=start, offset=1em, align=center] {\bfa Hovering Over Links} \blank[1st] \attachment[method=hidden, file={signed-a.pdf}] \goto{An embedded PDF document}[signed-a::] \blank[.5st] \myurl{https://contextgarden.net} \blank[.5st] \myhref{A link to the Garden}{https://contextgarden.net} \stopTEXpage \stoptext I also attach my output, since the first link is a link to an embedded document and not the expected link to an external document (I modified ConTeXt to get that kind of link). The issue I’m experiencing with Acrobat Reader DC on Windows (automatically updated to latest version) is that when hovering over links, I get different results. The three links are (in order from top to bottom): 1. A link to the embedded document. 2. An external link with its address as text. 3. Another external link without its address as text. Some days (as today [sorry, I don’t have access to Windows now]), hovering over the three links displayed the word "link" (even with Acrobat set to Spanish). Other days, hovering over the first link displays nothing and hovering over the two other links show their actual destination address. This behavior seems so random to me that I‘m not sure I’m not missing anything. Would you be so kind to test the attached document (and the one you may generate from the sample source) hovering over the link frames in Acrobat (ideally DC updated to latest)? At least, I would like to be sure what is going on here. Hovering over links is basic precaution before clicking them. To explain that to others, I’d rather know how Acrobat (Reader) behaves in these cases. Sorry the off-topic issue and many thanks for your help in advance, Pablo hover.pdf Description: Adobe PDF document ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: digital signing in ConTeXt
On 6/19/24 09:28, Hans Hagen via ntg-context wrote: >> [...] >> I‘m afraid I don’t know what I’m missing. > probably a couple of libraries ... > > local libfiles = os.name == "windows" > and { "libcrypto-3-x64", "libssl-3-x64" } On MSYS2 (Win10), I have both libs even on the bin directory. > or { "libcrypto", "libssl" } On Linux, I have both (from openssl-libs.x86_64 and openssl-libs.i686): /usr/lib64/libcrypto.so.3 /usr/lib64/libcrypto.so.3.2.1 /usr/lib64/libssl.so.3 /usr/lib64/libssl.so.3.2.1 /usr/lib/libcrypto.so.3 /usr/lib/libcrypto.so.3.2.1 /usr/lib/libssl.so.3 /usr/lib/libssl.so.3.2.1 This might be causing the issue, but I’m afraid Wine needs 32bit libs. I need to check this further. Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: new upload
On 6/18/24 22:15, Hans Hagen wrote: > [...] > - for pablo to test signing Many thanks for this, Hans. It might take a while, since I would like to test this for some time. Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: digital signing in ConTeXt
On 6/18/24 19:28, Pablo Rodriguez via ntg-context wrote: > [...] > I have just discovered that verify didn’t work with the binary. > > Figuring out now how to do the testing with the library. For some strange reason, I cannot get --library verification. I only get: sign pdf| verifying with the binary is not yet implemented sign pdf| signature in file 'a.pdf' doesn't match the content I‘m afraid I don’t know what I’m missing. 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: digital signing in ConTeXt
On 6/18/24 18:42, Hans Hagen via ntg-context wrote: > On 6/18/2024 6:26 PM, Pablo Rodriguez via ntg-context wrote: >> [...] >> As far as I know, this has to be a reason for digest mismatch (or a huge >> hash collision). > > could be (depends on checker) but it we change that we also need to > change the verify offset (so two patches) I have just discovered that verify didn’t work with the binary. Figuring out now how to testing with the library. >> Signatures in PDF-2.0 loose their possibility of other ranges than the >> entire file. Their use is simply not allowed. > > so more limited then to basically two ranges It makes sense and it is recommended for PDF-1.x. >>>> Sorry for insisting, but please don’t require plaintext password in the >>>> command line (again, OpenSSL prompts for it). >>> not if we use the library >> >> Weird, on both Linux64 and Win64, the openssl runner requires the >> openssl binary to be installed. > > i meant the --library option In that case, when --library is not invoked, we might avoid mandating the password in plain text. 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: digital signing in ConTeXt
On 6/18/24 10:27, Hans Hagen via ntg-context wrote: > On 6/18/2024 8:44 AM, Pablo Rodriguez via ntg-context wrote: >> [...] >> Generating certificates with OpenSSL is basically free. > > you cannot use a 'web certificate' Self-signed certificates may be used to stamp PDF documents to set both signing time and to detect modifications after signing. In fact, I’m planning to digitally stamp documents at work to ensure they aren’t modified after submission (by people or by any automated program). >> I think this may be avoided by adding a timestamp token (as unsigned >> attribute) in the PKCS#7 (as mentioned in the PDF spec). > > dunno, can test it https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008.pdf#nameddest=G11.2054251 refers to https://www.rfc-editor.org/rfc/pdfrfc/rfc3161.txt.pdf#page=20. Not sure how to get that with OpenSSL (never tried). But I may ask how to get that at their GitHub repository. >> Acrobat may be wrong in not detecting the signature (I’m investigating it). > > i think it only looks for 'official' ones I have created self-signed certificates with Acrobat Reader and signed PDF documents with both ones (cert and Acrobat) and Acrobat displayed these signatures. I have used the provided certificate to sign with pdfsig and Acrobat displayed the signature. I think Acrobat may be misbehaving here (requiring some optional content as mandatory). >> I’m afraid that the patch is needed since /ByteRange excludes a blank >> space before the value of /Contents that is in the temporary file (tmpfile). > > i need to test more Perfectly fine for me. Of course, it should be tested more. >> The blank space (marked above with the underscore) is included in the >> hashed file (tmpfile), but it is not included in the /ByteRange. >> >> This is the reason why we can only have digest mismatch. > > yes but that what i noticed when testing: mupdf, qpdf, acrobat, etc .. > trial and error is not to add that one Sorry, but I have to be missing your point completely. /ByteRange considers this part of the document to be written as: << /ByteRange [ … 006421 010520 000384 ] /Contents<3… But document is written, hashed and signed: << /ByteRange [ … 006421 010520 000384 ] /Contents <3… Of course, the value of the contents hasn’t been hashed, but the blank space between /Contents and is value has been hashed. As far as I know, this has to be a reason for digest mismatch (or a huge hash collision). >> As far as I can remember, this is mandatory for PDF-2.0 (and highly >> recommended for previous versions [although not required]). > > not sure what you mean, 2.0 demanding signing? Not at all. Sorry for my poor wording. From the PDF-1.7 spec itself (https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008.pdf#search=ByteRange): This range should be the entire file, including the signature dictionary but excluding the signature value itself (the Contents entry). Other ranges may be used but since they do not check for all changes to the document, their use is not recommended. When a byte range digest is present, all values in the signature dictionary shall be direct objects. Signatures in PDF-2.0 loose their possibility of other ranges than the entire file. Their use is simply not allowed. >> Sorry for insisting, but please don’t require plaintext password in the >> command line (again, OpenSSL prompts for it). > not if we use the library Weird, on both Linux64 and Win64, the openssl runner requires the openssl binary to be installed. 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: digital signing in ConTeXt
On 6/18/24 00:52, Hans Hagen via ntg-context wrote: > On 6/17/2024 7:51 PM, Pablo Rodriguez via ntg-context wrote: >> [...]>> 2. I cannot get any signature display in Acrobat. Does any PDF >> viewer (I >> have tested this with pdfsig from poppler and MuPDF-GL) display the >> digital signature at all? > this whole digitial signing is a bit of a scam imo ... Digital signing may be a marketing gig also, but we may only consider the pure feature as such. I mean, I’m not interested here in the legally binding value of certain digital certificates, but just in having digital signatures right. > - one has to buy a specific kind of certificate Generating certificates with OpenSSL is basically free. > - often one is supposed to use some token > > - when the root cert expires one has to resign I think this may be avoided by adding a timestamp token (as unsigned attribute) in the PKCS#7 (as mentioned in the PDF spec). > - reader has root certs built in and checking is supposed to be online > > - it doesn't come cheap and supporting / testing is not something one > can expect for free (so i can't really test it) > > ... so just some business model and not really something one can do out > of the box This is all related to certificate (legal) validity. This is out of the scope. > ... apart from ... > > - just sign with some certificate and don't expect viewers to do something Acrobat may be wrong in not detecting the signature (I’m investigating it). > concerning the suggested patches: this <whatever> boundary is a > bit fuzzy and i found that different viewers / checkers expect either or > not +/- 1 but i didn't check recently if things have improved There are two different issues here: digest mismatch and total document signing. I’m afraid that the patch is needed since /ByteRange excludes a blank space before the value of /Contents that is in the temporary file (tmpfile). I mean, here are the contens of the temporary file from the sample (tweaked to fit a single line]): << /ByteRange [ … 006421 010520 000384 ] /Contents / Byte 6421 is the s (before the underscore): << /ByteRange [ … 006421 010520 000384 ] /Contents_ / The blank space (marked above with the underscore) is included in the hashed file (tmpfile), but it is not included in the /ByteRange. This is the reason why we can only have digest mismatch. As for total document signing, it is better only to exclude from /ByteRange the value for /Contents (from < to >). As far as I can remember, this is mandatory for PDF-2.0 (and highly recommended for previous versions [although not required]). > if we know the specs and have way to test ... no big deal to fix a few > offsets I’m happy to contribute as far as I can. Sorry for insisting, but please don’t require plaintext password in the command line (again, OpenSSL prompts for it). 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Transparency in external PDFs does not work
On 6/17/24 17:07, Gerion Entrup wrote: > [...] > I use Okular/Poppler as PDF viewer. > Can I fix this somehow or is it a bug somewhere deeper? Hi Gerion, I can confirm your issue. It seems to be an issue with LMTX. LuaTeX has no problem with the file. Just in case it helps, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: digital signing in ConTeXt
On 6/17/24 20:21, Henning Hraban Ramm wrote: >> [...] > Can confirm. Many thanks for your testing, Hraban. > Before patching, I checked with … > – Acrobat Reader: doesn’t recognize a signature > – Foxit Reader: "a signature is invalid" The signature is invalid since it leaves an space outside the signing range. > After patching, I checked with … > – Acrobat Reader: doesn’t recognize a signature > – Foxit Reader: "there’s something wrong with a signature" (i.e. > different message) The certificate is self-signed. Its validity (not the correctness of the signature) is problematic to say the least. > – PDF Studio Pro 2023: shows signature, "don’t know if valid, issuer > unknown" etc. Again, as a certificate, this is a crappy. But this detects document modifications after being signed. Just in case Hans reads the message: It would be great that OpenSSL asks for the password directly. This is a basic security issue, not to leave plain-text passwords on the terminal. 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] digital signing in ConTeXt
Dear list, the latest version of LMTX can digitally sign PDF documents. It requires OpenSSL installed (since it does the crypto part). I have two issues that I would like to be tested by others. A sample certificate may be found at https://mailman.ntg.nl/archives/list/ntg-context@ntg.nl/message/ECSXLVMT3TMQBIHA2UZJPWJN7OVV5334/attachment/2/mycert.pfx (I sent it myself). Here is a sample document (actually provided by Hans): \setupinteraction[state=start] \definefield[signature][signed] \defineoverlay[signature][my signature] \starttext \startTEXpage[offset=1ts,frame=on,framecolor=darkblue] sign: \inframed[background=signature,framecolor=darkred] {\fieldbody[signature][width=3cm,option=hidden]} \stopTEXpage \stoptext After compiling the sample, you need to run: mtxrun --script pdf --sign --certificate=c.pfx --password=ABCabc doc.pdf Password will be prompted again ("ABCabc"), since it is an encrypted certificate (also for the public part). Could anyone confirm the following issues? 1. The signature I get is wrong, unless I apply this patch (https://mailman.ntg.nl/archives/list/dev-cont...@ntg.nl/message/T3OCKVZWTUTIXCSOKIFRVJ4X76MROZHE/attachment/3/byterange.diff [sent by myself to the devel list]). 2. I cannot get any signature display in Acrobat. Does any PDF viewer (I have tested this with pdfsig from poppler and MuPDF-GL) display the digital signature at all? 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: expanded doif's
On 6/17/24 16:52, Wolfgang Schuster wrote: > Hans van der Meer schrieb am 17.06.2024 um 09:01: >> I want to show an errormessage when the macro is undefined. It requires >> expansion of \xmlatt{#1}{name}. dr. van der Meer, \xmldoifatt (with ifnot and ifelse variants) should cover that case (https://www.pragma-ade.com/general/manuals/xml-mkiv.pdf#search=xmldoifatt). But I cannot make any of these conditionals work (I‘m afraid there may be an issue with their definition). \startbuffer[ifdefined] \stopbuffer \startxmlsetups xml:hvdm \xmlsetsetup{#1}{*}{xml:*} \stopxmlsetups \xmlregistersetup{xml:hvdm} \startxmlsetups xml:document \xmlflush{#1} \stopxmlsetups \startxmlsetups xml:macro \xmlatt{#1}{name}\\ \xmlatt{#1}{arg}\\ \xmldoifelseatt{#1} {name}{yes}{no}\\ \xmldoifelseatt{#1} {names}{yes}{no}\\ \stopxmlsetups \starttext \xmlprocessbuffer{hvdm}{ifdefined}{} \stoptext As a workaround \doifelsetext{\xmlatt{#1}{name}}{yes}{no} may do the trick here. I hope it helps, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] \xmlinlineverbatim not inline
Dear list, I have the following sample: \startbuffer[demo] text \stopbuffer \startxmlsetups xml:sample \xmlsetsetup{#1}{text}{xml:*} \stopxmlsetups \xmlregistersetup{xml:sample} \startxmlsetups xml:text block: a \xmlverbatim{#1} b\\ inline: a \xmlinlineverbatim{#1} b\\ block: a \xmlprettyprint{#1}{xml} b\\ inline: a \xmlinlineprettyprint{#1}{xml} b \stopxmlsetups \startxmlsetups xml:element \tt\xmlatt{#1}{class} \stopxmlsetups \starttext \xmlprocessbuffer{main}{demo}{} \stoptext With latest from 2024.06.14 09:18, \xmlinlineverbatim doesn’t display inline text, but only block text (both with LMTX and MkIV). Could anyone confirm the issue? Many thanks for your help in advance, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: comment on the wiki
On 6/13/24 04:17, Max Chernoff wrote: > Hi Pablo (and others), > > On Wed, 2024-06-12 at 18:42 +0200, Pablo Rodriguez wrote: >> Is there any way in which regular wiki contributions may help in >> removing the accounts or at least all the pages generated with these >> accounts? > > I also don't have deletion privileges, but I went through the recent > pages and deleted the spammy content. After sending my message, I saw that the Gardener group seems to have permissions to delete pages (not sure about user pages). I wonder whether this may constitute a formal request (for me and Max [always when he agrees]) to be considered as candidates for Gardeners. I know that this is not a privilege, but I would like to be able to remove spam from the wiki. 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] comment on the wiki
Dear wiki maintainers (Taco at others), I have found in the user creation log: 05:40, 7 June 2024 User account FelicaEnyeart34 was created 22:59, 26 May 2024 User account NonaAlber414387 was created 04:33, 26 May 2024 User account Tony83264596 was created 15:17, 24 May 2024 User account WallyGarth was created I‘m afraid these four users may be only spamming accounts. I don’t know whether it is worth discussing this issue, but I have two questions: Is there any way in which regular wiki contributions may help in removing the accounts or at least all the pages generated with these accounts? Is there any way to fix the display of user contributions (such as mine, https://wiki.contextgarden.net/Special:Contributions/Ousia)? I have just discovered that the problem is to search for contributions in all namespaces (set by default), which triggers the error message: Namespaces with negative values are not supported. If main namespace is selected, everything works fine. I wonder whether it would be possible to set the main namespace as default to search for user contributions. 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] suggestion: two templates for the wiki
Dear Taco and Hraban, trying to improve the XML page from the wiki, I think it would be extremely useful to have two templates for inline code: {{xml|…}}: inline XML highlighted as for blocks. {{tex|…}}: inline TeX code highlighted as for blocks. As for the second, {{cmd|…}} includes a link (not always required) and doesn‘t higlight more than the command itself. Let me know whether I can contribute in any way to this. 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: [ remove all metadata in pdf ]
On 6/10/24 17:49, vm via ntg-context wrote: > Is there a parameter for context lmtx to strip all metadata from the > generated pdf? > Or is that a better task for exiftool afterwards? \enabledirectives[backend.date=none] But this doesn’t remove all metadata. Title, Producer and XMP data still there. Just in case it helps, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Scale notation base on current font
On 6/8/24 17:09, seyal zavira wrote: > Thanks > > sorry for incomplete example > the code below shows the problem better: > \setupinteraction[state=start] As for the color, it is caused by \setupinteraction. You can remove it with: \setupinteraction[state=start, style=, color=, contrastcolor=,] This disables default style and color in links (footnote markers are links). I hope it helps, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Scale notation base on current font
On 6/8/24 13:16, seyal.zav...@gmail.com wrote: > Hi all, > > There's a problem when I want to define the note so that it's > displayed according to the size and font of the text: Not sure I’m getting your point. But this should show a difference in font size: \definenote[Mynote] \starttext \color[green]{\tfd hello \Mynote{refrence} not really required} \switchtobodyfont[36pt] \color[green]{hello \Mynote{refrence} not really required} \stoptext > but i cannot set it for \tfxx. > also it's relative to my main body font, and my current font andI > color doesn't apply to text. > for example if my current text has color red with another font the > note doesn't change according to it, and will display identical > everywhere. Could you show how the second paragraph above doesn‘t inherit both size and color from the current font? Sorry, otherwise I simply don’t get it. > And when I try to define it like this MWE: > > \definenote[Mynote][location=text,before={},] > \setupnote[Mynote] > [location=left, > textcommand= \scale [height=0.7ex] \raise 0.2ex\hbox, > ] I don’t think the text command value is right. Besides, if you intend the second paragraph from the sample, this approach looks unnecessarily complex for me. I hope it might 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: ConTeXt source from XML
On 6/8/24 09:49, Wolfgang Schuster wrote: > Denis Maier via ntg-context schrieb am 08.06.2024 um 09:14: >> [...] >> Hi, >> I've read Thomas Schmitt's My Way as an excellent introduction in XML >> processing with ConteXt, but I can't find it anywhere anymore... Does >> anyone know what happened to it? > > https://wiki.contextgarden.net/images/8/8c/xhtml.pdf Many thanks for the new reference, Wolfgang. Many thanks for mentioning it, Denis. I’m going to fix the wiki links right now (https://wiki.contextgarden.net/XML). Many thanks 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: ConTeXt source from XML
On 6/8/24 10:49, vm via ntg-context wrote: > in the document > https://wiki.contextgarden.net/images/8/8c/xhtml.pdf > > near the end an essential line got truncated: > [...] > how should this line continue ? > {\externalfigure[\xmlatt{#1}{src}][width=\ctxlua{getmeas("\xmla As this comes from https://wiki.contextgarden.net/images/8/8c/xhtml.pdf#page=16 and it seems to be previously defined on This comes from https://wiki.contextgarden.net/images/8/8c/xhtml.pdf#page=10, I would say: \startxmlsetups xml:img \placefigure [here] [\xmlatt{#1}{src}] {\xmlatt{#1}{alt}} {\externalfigure[\xmlatt{#1}{src}] [width=\ctxlua{getmeas("\xmlatt{#1}{width}")}]} \stopxmlsetups But this is my uneducated guess (and not having checked whehter this may make sense). Just in case it might 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: ConTeXt source from XML
On 6/6/24 22:53, Christoph Edenhauser wrote: >> [...] >> XPath seems to have as it primary purpose to address the nodes of XML trees. >> [...] >> If you don’t want this to happen, you have to encode them in the TEI XML >> sources. > > In my case, the connection to the original source will be lost. While > we will still try to backport corrections, the connection will be lost > at the very moment when we will annotate the source text. Dear Christoph, well, in your case, your source will be a new one, the annotated one. > At the moment I'm leaning strongly towards TEI, also because I could try > to remove the annotations via XSLT once the work is complete, diff the > result with the original source and improve it). And besides, > XML+ConTeXt looks quite elegant from the distance of my ignorance. If you are familiar with XSLT (and XPath), you will have no problem typesetting XML sources with ConTeXt. > (Although reading xml-mkiv.pdf creates a pleasant frictional heat in my > cerebral convolutions, but leaves at least as many knots in them as XML > data have nodes). Well, xml-mkiv.pdf isn’t exactly a piece of cake. It isn’t an introduction and it has to be written that way. After trying to read it for the n-th time and having learnt only very little from it (exclusively my fault), I think it assumes a good XPath background. Again, xml-mkiv.pdf is documenting the way of handling XML in ConTeXt and it has to be written that way. It is part of our task (the one reserved to final users) to compose a proper introduction on how to typeset XML sources with ConTeXt. Borrowing the title from other work, “XML in Proper ConTeXt” (actually taken from https://www.berenddeboer.net/tex/LaTeX2ConTeXt.pdf). All I can say is that I have read xml-mkiv.pdf and I know I will learn way more from this document than the huge amount of things I have already discovered reading it. >> [...] >> Having the text properly formatted and printed on paper helps a lot to >> spot errors. > > Same here: It's the paper! > (I for myself prefer for the first proof reading a page lots of white > space, in monospaced font like Courier, while my proofreader wants to > see the font that will be used in the end.) Sorry for insisting. If the text is not fully formated, it is very easy to overlook formatting errors with commands (or simple errors with commands directly). The most basic sample may read (wrong spacing after command): \starttext \ConTeXt is awesome! \stoptext This is one in a bunch of errors that may be unnoticed. Just in case it might 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: ConTeXt source from XML
On 6/5/24 20:23, Christoph Edenhauser wrote: > Dear Pablo, > > Thank you very much for your very clear, detailed and elaborate > explanations. - Over the next few days I will meditate on the ConTeXt > way to handle XML and on my workflow and take a look at lpath (never > heard of it). And somehow I have the impression that the next few days > will last a few weeks. Dear Christoph, just in case it might help to your meditation. First of all, lpaths are XPath implemented with Lua in ConTeXt. XPath seems to have as it primary purpose to address the nodes of XML trees. About your sources, the real issue here is to define whether you want TEI or TeX to be the format containing them. I mean, if you add explaining footnotes to your TeX file(s), XML won’t be source anymore. If you don’t want this to happen, you have to encode them in the TEI XML sources. One last suggestion about proofreading. This is something I learnt from personal experience. The first reading is much better to catch errors in the text than the subsequent ones. Having the text properly formatted and printed on paper helps a lot to spot errors. Reading source code is cheaper (no doubt), but the results will be poorer too. Just in case it might 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: ConTeXt source from XML
On 6/4/24 22:09, Hans Hagen wrote: > [...] > There is a xml-mkiv-tricks.tex file in the distribution (no pdf is > seems so I need to add that one.) Hans, sorry, I forgot to reply earlier. I think this is already included in https://www.pragma-ade.com/general/manuals/xml-mkiv.pdf#page=53 (as chapter 5 from xml-mkiv.pdf). The file from the distribution is the same as the one online (same SHA512, just in case). 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: ConTeXt source from XML
On 6/5/24 12:00, Christoph Edenhauser wrote: > [...] > I realise that it is somehow difficult for me to describe what I would > like to achieve, perhaps what I have in mind is not even possible. Hi Christoph, as far as I know (and as Hraban has already mentioned), this is not possible. Either XSLT or pandoc would be a way to do that. That being said, I would avoid conversion (a second source) in all cases. I use ConTeXt to typeset XML sources typing Markdown sources. pandoc generates XML and then ConTeXt typesets these XML sources. > My Question is, is it possible to generate a second context file2.tex > with the help of this first xml-mapping file1.tex, where all the > xml-nodes from the xml file are mapped to contex commands which then > looks something like this: I‘m afraid this is not possible (it works in a different way) > I would then like to edit the Text in such a more "TeXish" result > manually, e.g. insert small spaces as in ‘St.\,Martin’, explain unknown > words in \footnote{comment}, etc. Different spaces are Unicode characters. As entities, or (narrow no-breaking space and thin space, respectively). > I know you could or even should do the text corrections in the xml file, > but XML would overwhelm my proofreader. (He has learnt to leave LaTeX > code untouched, that should then work with ConTeXt code as well). So for > me, the main reason for having a TeX-ish file2.tex is, that the Text > could be corrected directly from the proofreader in this file2.tex file, > but won't do that in the xml file. I don’t mean the proofreader personally, but TeX code may not be inherenlty more readable that XML code. Compile the following: \starttext \startXML St.Martin A comprehensive treatise The medieval part of the church \stopXML \startTEX \starttext \startchapter[title=St.\, Martin] \stopchapter \startsection[title=The medieval part of the church]\stopsection \stoptext \stopTEX \stoptext I think that a text editor with reasonable highlighting for XML is key to your issue. I mean, XML sources tend to be highlighted leaving pure text as uncolored and unformatted (no bold or italics). In that case, I think the text to be proofread may be recognized as not having any format at all (besides not enclosed inside "<" and ">"). > And now a second approach to my question: > Are all these \startxmlsetups like '\startxmlsetup xml:chapter' > internally mapped to standard context commands like \startchapter > ... \stopchapter before they are converted to pdf? No, these are formatting commands after the mapping. In short, there are three steps involved in XML typesetting. First, you select which elements you would like to select from the XML source in an XML setup (with a mapping to your configuration commands). Second, you register this XML setup. Third, your configure the selected elements with ConTeXt commands. Here is a sample (using a buffer instead of an external file): \startbuffer[demo] line 1 line 2 line 3 \stopbuffer \starttext \startxmlsetups abc:def \xmlsetsetup{#1}{foo|bar}{xyz:*} \stopxmlsetups \xmlregistersetup{abc:def} \startxmlsetups xyz:foo \xmlflush{#1} \stopxmlsetups \startxmlsetups xyz:bar \startparagraph \xmlflush{#1} \stopparagraph \stopxmlsetups \xmlprocessbuffer{main}{demo}{} \stoptext First of all, XML has no hardcoded names for any element (from a certain point of view, XML are only rules on how to use the "<>" tags). This is why, and are perfectly valid element names (although they have no meaning for people). Second, the mapping may use any name for destination setups. \xmlsetsetup does the mappings, the second group of parentheses contains the lpath (an Lua version of XPath [how XML is selected]) and the third group of parentheses is setups. The command \xmlsetsetup{#1}{foo|bar}{xyz:*} above is bound to existing elements (or paths) in the XML source, but both "xyz:foo" and "xzy:bar" may read as the user wants. Third, after that you need specify the setup for each mapping (or it won’t appear in your final document). The setup is what you defined as the second part of the mapping, may it be "xml:title" or "xyz:bar". Nothing here is hardcoded. XML is not HTML (elements with meaning). In order to deal with XML, ConTeXt has to provide the tools to select elements (and more complex constructs) and map them to configurable setups. How both tools (construct selection and setup configurations) may be deployed, this is up to each individual. Hardcoding this would be a real problem in the short run. > If this is the case, can this intermediate context representation be > exported, and how would this be done? Nice try, but I’m afraid this is not how it works. I hope my explanation may be minimally clear to understand why your approach is different from what ConTeXt offers. Feel free to ask, if my explanation wasn’t clear enough. I hope it helps, Pablo
[NTG-context] Re: ConTeXt source from XML
On 6/4/24 13:51, Christoph Edenhauser wrote: > Dear list, > > I am currently trying to get into Context and XML. I would like to do > the typographical fine-tuning in Context and not in the XML document. My > question is: Is it possible to have ConTeXt output a (preliminary) > ConTeXt file instead of typesetting a PDF file, for further editing? Hi Christoph, not clear to me whether you meant an environment (a format file) with the ConTeXt generated file. In that case, this might help: context --extra=xml --analyze --template your-file.xml With that template, you may run: context --environment=xml-analyze-template.tex your-file.xml BTW, there are two typos in xml-analyze-template.tex (lines 8-9): - \startxmlsetup should read \startxmlsetups. - \xmlsetsetups should read \xmlsetsetup. But consider that this only flushes text with no formatting (you will have all text in a single paragraph. If this is not what you need, a more detailed (or simply more verbose) explanation) might help. Just in case it might 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] issue with signing
Dear list, I have the following sample \setupinteraction[state=start] \definefield[signature][signed] \defineoverlay[signature][my signature] \starttext \startTEXpage[offset=1ts,frame=on,framecolor=darkblue] sign: \inframed[background=signature,framecolor=darkred] {\fieldbody[signature][width=3cm,option=hidden]} \stopTEXpage \stoptext After compiling, I sign it with the following command (in latest from 2024.05.31 18:50): mtxrun --script pdf --sign --certificate=mycert.pfx --password=ABCabc a It requires the pass phrase (again?) and I get a signed PDF document. But Acrobat cannot find (or display) any signature in that PDF document. pdfsig (from poppler-utils-24.02.0) complains about digest mismatch: $ pdfsig a.pdf Digital Signature Info of: a.pdf Signature #1: - Signature Field Name: signature - Signer Certificate Common Name: John Doe - Signer full Distinguished Name: CN=John Doe,O=No Brainer - Signing Time: Jun 03 2024 16:24:03 - Signing Hash Algorithm: SHA-256 - Signature Type: adbe.pkcs7.detached - Signed Ranges: [0 - 6428], [10527 - 10912] - Not total document signed - Signature Validation: Digest Mismatch. mutool sign (from mupdf-1.24.1) also complains about modified document after signing: $ mutool sign -v a.pdf Verifying signature 3: Distinguished name: cn=John Doe, o=No Brainer, ou=, email=, c=XX Certificate error: Self-signed certificate. Digest error: Signature invalidated by change to document. Sorry, but what am I doing wrong here? Many thanks for your help, Pablo mycert.pfx Description: application/pkcs12 ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] slides from 2023 meeting
Hi there, just out of curiosity, are the slides from the 2023 meeting (https://meeting.contextgarden.net/2023/programme.shtml) planned for public release? 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: regular expression as lua pattern
On 5/29/24 13:00, Henning Hraban Ramm wrote: > [...] > See also Taco’s introduction to LPEG in > https://articles.contextgarden.net/journal/2019/77-98.pdf Many thanks for the reference, Hraban. I need to start digesting that to learn about LPEG. Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: regular expression as lua pattern
On 5/28/24 20:06, Hans Hagen wrote: > On 5/28/2024 6:25 PM, Tomáš Hála wrote: >> Hi Pablo, >> >> unfortunately, that it is not possible: >> >> http://lua-users.org/wiki/PatternsTutorial, section Limitations. > > \starttext > \startTEXpage[pagestate=start, offset=1em] > \startluacode > local pat = (lpeg.Cmt(lpeg.P("this") + lpeg.P("that"), > function(str,_,s) > context(s) > return #str > end) + lpeg.P(1))^1 > lpeg.match(pat,"how about this being that") > > local pat = (lpeg.Cmt(lpeg.oneof({ "this", "that" }), > function(str,_,s) > context(s) > return #str > end) + lpeg.P(1))^1 > lpeg.match(pat,"how about this being that") > \stopluacode > \stopTEXpage > \stoptext Many thanks for your reply, Hans. I will have to study it becasue LPEGs is new stuff for me. 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: regular expression as lua pattern
On 5/28/24 18:25, Tomáš Hála wrote: > Hi Pablo, > > unfortunately, that it is not possible: > > http://lua-users.org/wiki/PatternsTutorial, section Limitations. Many thanks for your reply, Tomáš. It is clear to me now. Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] regular expression as lua pattern
Dear list, I have the following sample: \starttext \startTEXpage[pagestate=start, offset=1em] \startluacode local str = "this is that" context(str:match("(this|these)")) \stopluacode \stopTEXpage \stoptext In short, I would like to know whether it is possible to have the regular expression (this|these) as a Lua pattern. I mean, I need complete strings and I haven’t found the way to do it. 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: wrong font scaling in LMTX?
On 5/26/24 20:50, Wolfgang Schuster wrote: > [...] > I get the same results with the default font mode in MkIV and LMTX but > when I add > > \enableexperiments[fonts.compact] > > the x and xx sizes are wrong. Many thanks for having fixed that in latest, both Hans and Wolfgang. Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Number in a circle
On 5/28/24 17:47, Pablo Rodriguez via ntg-context wrote: > On 5/27/24 19:10, Kip Warner wrote: >> [...] >>to say pt, for printer's55points. two letters. >> >> I'm not sure what it is referring to. > > fw is a new dimensio unit only available in LMTX (not in LuaTeX). Sorry for the noise. I didn’t see that there were new messages and the proper answer from Wolfgang among these. Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Number in a circle
On 5/27/24 19:10, Kip Warner wrote: > [...] > Thanks Wolfgang. I gave it a try on https://context-on-web.eu/, but it > failed: > >Dimensions can be in units of em, ex, in, pt, pc, cm, mm, dd, cc, >bp, dk, or54sp; but yours is a new one! I'll assume that you meant >to say pt, for printer's55points. two letters. > > I'm not sure what it is referring to. fw is a new dimensio unit only available in LMTX (not in LuaTeX). Just in case it might 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: wrong font scaling in LMTX?
On 5/26/24 20:50, Wolfgang Schuster wrote: > [...] > I get the same results with the default font mode in MkIV and LMTX but > when I add > > \enableexperiments[fonts.compact] > > the x and xx sizes are wrong. Many thanks for your reply, Wolfgang. I tend to forget that I have always compact fonts enabled by default. Only enabling or disabling it, compilation with sample goes from 2.6s when enabled to 3.2s when disabled (using --purgeall) Without your help, I would have been never detected this. 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] wrong font scaling in LMTX?
Dear list, I have the following sample: \definefontfamily[mainface][rm][TeX Gyre Pagella] \definefontfamily[mainface][ss][TeX Gyre Heros] [scale=0.125] \setupbodyfont[mainface] \starttext \startTEXpage[pagestate=start, offset=1em] \rm a\ss a\\ {\rm a\ssd a}\\ {\rm a\ssx a}\\ {\rm a\ssxx a} \stopTEXpage \stoptext Scaled \ssx and \ssxx are wrong in LMTX (not scaled at all). All font sizes are scaled fine in MkIV. In both cases, I‘m running latest from 2024.05.17 16:32. Could anyone confirm the issue? BTW, this is the first time I indent the sample sent to the list with a single character (one tab) instead of two or four spaces. If the sample is wrong displayed in the medium you use with the mailing list, please tell me and I will go back to spaces instead of tabs. 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Why is only the first frame protruding into the margin?
On 5/17/24 20:46, madiazm.eo...@gmail.com wrote: > [...] > here is the last part of my script (the prior definitions are not > problematic, since they worked when only using "miFuente". It seems to > be something in "miCorm" that produces the protruding Just a comment about typescripts. At least in how I use ConTeXt, I live happily without having to use them. See the following sample: \definefontfamily[libertin][rm][Libertinus Serif] \definefontfamily[libertin][ss][Libertinus Sans] \definefontfamily[libertin][tt][Libertinus Mono] \definefontfamily[cormora][rm][Cormorant] \setupbodyfont[cormora] \starttext \input zapf\par \switchtobodyfont[libertin] \doloopoverlist{\rm,\ss,\tt} {\recursestring\input zapf\par} \stoptext You may define font families (which are actually typeface families). I think they may be easier to use than typefaces. Just in case it might 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Why is only the first frame protruding into the margin?
On 5/17/24 20:22, madiazm.eo...@gmail.com wrote: > thanks Pablo, but this is strange > [...] > The strange thing is that it is only the first section that > protrudes, the other sections are right (as seen in the link). > Therefore it must not be the code definition, since in that case all > sections should protrude... It might be a buggy code definition, but it may be only triggered by (yet unknown) special conditions. > Over the weekend I will slowly move my code to a new file with your > code adding a bit everytime to try to spot the moment when I get this > strange behaviour and then I will write again. I hope you have already solved the issue, but I’m afraid this is the way testing for new bugs introduced in code works. > ps. I included the link because there is no attach option here in the > online-mailing-list. Sorry if it not ok. Sorry, I no Google fan. But it is essential to provide problematic code (reduced to a minimal sample) in the messages to the list, not just the output. Having the sample code, others can confirm that they are able to reproduce your issue. It wouldn’t be the first time for issues only arising in only on a single installation, on a single computer or on a single OS. The mailing list (at least when sending from a real email address) allows attachments up to 100kb. This may be enough for most minimal samples. I hope it helps, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Why is only the first frame protruding into the margin?
On 5/17/24 11:02, madiazm.eo...@gmail.com wrote: > thanks Wolfgang for your advice and sorry for being so verbose, but > since the margins are "included" in the problem I decided to put my > layout there too. > > I made your suggested changes and unfortunately it doesnt work, but > being a bit surprised by the margins I printed a copy of the page > and still worse... Hi Miguel, this should work (also in the sense of a minimal sample): \showframe\showgrid \defineframedtext[FunnyText] [frame=on, align=flushright,location=right] \def\FrameTitle#1% {\setMPtext{FunnyFrame} {\hbox spread 1em{\hss\strut \color[blue]{\tfx Apartado #1}\hss}}} \define[2]\firstHeadings{% \dontleavehmode \switchtobodyfont[miCorm]% \FrameTitle#1% \startFunnyText {\switchtobodyfont[miCorm,20.7pt] #2} \stopFunnyText} \setuphead [section] [command=\firstHeadings, indentnext=no] \starttext \startsection[title=a] b \stopsection \startsection[title=a] b \stopsection \startsection[title=a] b \stopsection \stoptext BTW, you inadvertely introduce the space here: \define[2]\firstHeadings{% \dontleavehmode \switchtobodyfont[miCorm]% \FrameTitle#1% Unless you comment the space after the right bracket, it will be included in your definition of first headings. As for external downloads, better avoid unless required. In any case, the minimal code should be part of your message. Just in case it helps, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] expansion question
Dear list, I have the following sample: \setupinteraction[state=start] \setupattachments[method=hidden] \protected\def\PDFfile[#1]% {\cldcontext{file.addsuffix("#1", "pdf")}} \starttext \doifelsefile{\PDFfile[xml-mkiv]} {yes}{no} \attachment[file={\PDFfile[xml-mkiv]}] \stoptext I need the \PDFfile definition to be \protected for only one case (that I cannot reproduce in my sample). Is there any way to define an unprotected command and invoke it as protected only for a particular case? 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: weird \inlinetypebuffer interaction
On 5/9/24 15:18, Pablo Rodriguez via ntg-context wrote: > [...] > Many thanks for your improvement, Wolfgang. > > It would be great to have it included in standard ConTeXt. Hans, many thanks for having added this to current latest (2024.05.13 19:19). Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: weird \inlinetypebuffer interaction
On 5/9/24 12:57, Wolfgang Schuster wrote: > Pablo Rodriguez via ntg-context schrieb am 08.05.2024 um 18:05: >> [...] >> Since \type doesn’t collapse hyphens, wouldn’t it be possible to add >> \nohyphencollapsing to \typeinlinebuffer just for the sake of output >> consistency? > > You can make \typeinlinebuffer behave like \type by adding a second > initializer which besides other things prevents hyphen collapsing. > > buff-ver.mkxl: > > \protected\def\buff_verbatim_type_buffer_indeed_inline#1#2% >{\cdef\currenttype{#1}% > \buff_verbatim_initialize_type_one > + \buff_verbatim_initialize_type_two Many thanks for your improvement, Wolfgang. It would be great to have it included in standard ConTeXt. 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: weird \inlinetypebuffer interaction
On 5/7/24 22:37, Wolfgang Schuster wrote: > [...] > \typebuffer disables automatic \endash and \emdash with the > \nohyphencollapsing command > but the command isn't used for \typeinlinebuffer. Many thanks for your explanation, Wolfgang. Since \type doesn’t collapse hyphens, wouldn’t it be possible to add \nohyphencollapsing to \typeinlinebuffer just for the sake of output consistency? 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: weird \inlinetypebuffer interaction
On 5/6/24 22:45, Wolfgang Schuster wrote: > Pablo Rodriguez via ntg-context schrieb am 06.05.2024 um 20:06: >> Dear list, >> >> I have the following sample: >> >>\definefontfamily[mainface][tt][TeX Gyre Termes] > > Apply the none feature when you set the monospace font, i.e. > > \definefontfamily[...][tt][...][features=none] Many thanks for your reply, Wolfgang. This solves the issue, but I have two questions. Why is this only required for \inlinetypebuffer and not for \typebuffer? Which is the exact font feature that does the hyphen ligatures? I’m interested in not disabling hz and hanging. 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] weird \inlinetypebuffer interaction
Dear list, I have the following sample: \definefontfamily[mainface][tt][TeX Gyre Termes] \setupbodyfont[mainface] \starttext \startbuffer context --purgeall \stopbuffer inline \typeinlinebuffer block: \typebuffer \stoptext As long as there is no defined font family for mono, \typeinlinebuffer doesn’t convert -- into an en-dash (the same way as \typebuffer behaves). But as in the sample above, when a font is defined for mono (at least with \definefontfamily), \typeinlinebuffer converts -- into en-dashes (different from \typebuffer). Sorry, but how could I fix this \typeinlinebuffer? This is important for me, since two hyphens is one of the most common ways to marks options when invoking programs (which I try to explain to others). BTW, \sciteinlinebuffer seems have the same problem (in the scite module). 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: unprotecting when defining in Lua
On 4/29/24 19:32, Wolfgang Schuster wrote: > Pablo Rodriguez via ntg-context schrieb am 29.04.2024 um 18:21: >> Is \protected the same as \unexpanded? > > Yes they are the same (\protected is the primitive and \unexpanded is a > copy) but this wasn't always the case. > > Original TeX didn't provide a mechanism to create protected commands > and creators of macro packages had to create their own mechanism for > this, the ConTeXt solution was \unexpanded. With the etex extensions > the \protected primitive was added and \unexpanded uses the new > primitive when you used a engine which supported it. Many thanks for your fast reply and your explanation, Wolfgang. Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: unprotecting when defining in Lua
On 4/29/24 18:04, Wolfgang Schuster wrote: > Pablo Rodriguez via ntg-context schrieb am 29.04.2024 um 17:22: >> [...] >> Which is the right way to use "interfaces.definecommand" to get a simple >> command as in standard TeX? >> >> I mean, no a non \permanent or non \protected command. > > You can't create unprotected command with interfaces.definecommand > but this not a problem because you can just use interfaces.implement > to create your command which is then unprotected by default. Using > implement instead of definecommand doesn't matter because > definecommand is just a wrapper for the implement function with the > option to create a environment. Many thanks for your fast reply, Wolfgang. I’m reading it now in cld-mkiv.pdf. Is \protected the same as \unexpanded? 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] unprotecting when defining in Lua
Dear list, I have the following sample: \starttext \startluacode function document.test(str) context(str) end interfaces.definecommand { name = "testing", protected = false, macro = document.test, } \stopluacode \meaningfull\testing \def\test#1{#1} \meaningfull\test \stoptext Which is the right way to use "interfaces.definecommand" to get a simple command as in standard TeX? I mean, no a non \permanent or non \protected command. 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: \par and \startlines
On 4/26/24 19:52, Denis Maier via ntg-context wrote: >> Wolfgang Schuster hat am 26.04.2024 19:29 CEST geschrieben: >> The inbetween setting works because ConTeXt checks at the start of >> each line whether it's empty (in this case the value is used) or not. >> >> When you add a \par you just end the current line/paragraph and it >> doesn't matter how many \par's you use because TeX just ignores them. > > I see. But there's no command that could be used to simulate an empty line? Crappy code: \starttext a\dorecurse{25}{\par}b a\dorecurse{25}{\null\par}b \stoptext Just to show it could be achieved, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: wrong spacing after command with optional arguments
On 4/26/24 19:50, Wolfgang Schuster wrote: > Pablo Rodriguez via ntg-context schrieb am 26.04.2024 um 19:04: >> I tried this approach (I hope it isn’t wrong): >> >>\starttext >>\expanded\tolerant\def\MyCommand#_#,#_#,#_#,#_{% > > The \expanded modifier is wrong (I guess you meant \unexpanded) but > which check for the number of arguments you use doesn't matter in a > document. You are right, I meant \unexpanded. > The LMTX version of the \iffourthargument etc. checks is the > \ifarguments commands where you use \or to set a case for the number of > argument passed. Many thanks for explaining this too. >> But what are these "#_" (which don’t seem to come from TeX)? > > Hans added many additions to command parameters in Luametatex and #_ > means the argument to a commands has to be enclosed in braces while #1 > allows you to pass text without it. I get it now. > You can find a list with all new command parameters in lowlevel-macros.pdf. An interesting reading for the weekend. 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: wrong spacing after command with optional arguments
On 4/26/24 18:18, Wolfgang Schuster wrote: > Pablo Rodriguez via ntg-context schrieb am 26.04.2024 um 17:29: >> What is wrong in my definition above? > > There is nothing wrong, this is just a side effect of the scanner used > with the \do...groupempty commands. To have more control about this > behavior use the \tolerant modifier for \def to change it. Many thanks for your reply, Wolfgang. I tried this approach (I hope it isn’t wrong): \starttext \expanded\tolerant\def\MyCommand#_#,#_#,#_#,#_{% \doiftextelse{#4}% {#4} {\doiftextelse{#3} {#3} {#2}}} \MyCommand{}{second}{third}{fourth},\\ \MyCommand{}{second}{third}{fourth} e,\\ \MyCommand{}{second}{third},\\ \MyCommand{}{second}{third} e,\\ \MyCommand{}{second},\\ \MyCommand{}{second} e,\\ \stoptext BTW, this is the first time I see #_ instead of #1. There is no way to search for "#_" in the wiki. Grepping the source, "#_" seems to be used for optional arguments (mainly in syst-aux.mkxl). But what are these "#_" (which don’t seem to come from TeX)? 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] wrong spacing after command with optional arguments
Dear list, I have the following sample: \starttext \def\MyCommand{\doquadruplegroupempty\doMyCommand} \def\doMyCommand#1#2#3#4{% \iffourthargument #4% \orelse\ifthirdargument #3% \else #2% \fi} \MyCommand{}{second}{third}{fourth},\\ \MyCommand{}{second}{third}{fourth} e,\\ \MyCommand{}{second}{third},\\ \MyCommand{}{second}{third} e,\\ \MyCommand{}{second},\\ \MyCommand{}{second} e,\\ \stoptext I don‘t know why only the command gets the space after right only when the four arguments are provided. What is wrong in my definition above? 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: \par and \startlines
On 4/26/24 15:33, denis.ma...@unibe.ch wrote: > Hi, > > I’m trying to typeset a poem from XML, but I can’t figure out how to > make the inbetween key working here. > > As the source is XML, I cannot just add an empty line to start a new > group of lines inside \startlines…\stoplines. I guess, there must be a > command to do that, but \par seems to have no effect here. > > How can this be done? Hi Denis, I must confess I don’t get which is your actual question. \blank works here and you know that (since you included it in your code). MkIV with \par works in your sample and LMTX with \par doesn’t. I wonder whether this might be a bug in LMTX. Just in case it might 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Why don't footnotes appear in floats or figures?
On 4/24/24 02:15, Joel via ntg-context wrote: > [...] Any idea how I can get current footnote value? Hi Joel, current footnote value can be accessed with \rawcountervalue[footnote], such as in: \starttext \dorecurse{25} {\ \footnote{Footnote \recurselevel}: \rawcountervalue[footnote]\par} \stoptext Just in case it helps, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Why are ConTeXt-SBL endnotes empty?
On 4/22/24 15:51, Joel via ntg-context wrote: > A few years back, I tried using endnotes with ConTeXt-SBL, and it failed > to compile. I'm forced to try again (due to some other issue with > footnotes), and instead of compiling to error, it compiles, but the > footnote's message ends up being empty. > > Why is it appearing empty? Is there a fix? Hi Joel, the bibliography part doesn’t work for me at all. But notes may be placed as their location is text (and you add a real footnote). This works fine: \setupnote[footnote][location=text] \starttext \input knuth \footnote{Footnote} \cite[clark1989] \placenotes[footnote] \startchapter[title=Bibliography] \placelistofpublications \stopchapter \stoptext I never used a bibliography in ConTeXt, so that part is left to you. I hope it helps, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Why don't footnotes appear in floats or figures?
On 4/22/24 02:45, Joel via ntg-context wrote: > I'm three days out from sending my work to an editor, and found some > serious problem: many footnotes just aren't rendering. Joel, please provide a minimal sample, otherwise it is really hard to help. > I've seen some 2+ year old mailing list posts suggesting ConTeXt might > have issues with footnotes; they appear to be similar to my issue--is > that still a problem? Is there a fix or workaround? Old fixes I could > finding in the mailing list don't seem to work with current versions of > ConTeXt anymore. \postponenotes and \flushnotes might be an option. \setlocalfootnotes and \placelocalfootnotes might be another option. Just in case it might 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Weird (?) float placement for specific widths of image
On 4/19/24 17:48, Denis Maier via ntg-context wrote: > Hi again, > > just a quick follow up on this one. Can anyone reproduce this? Hi Denis, I can reproduce it. > Would be good to know how this can be fixed. I have this in a real > document, and as I’m typesetting a XML source I cannot just adjust > slightly adjust the dimensions to get rid of that. It seems that you can place the figures somehow (https://www.pragma-ade.nl/general/qrcs/setup-en.pdf#page=169): See the extreme example: \showframe\showgrid\showstruts \setupexternalfigures [location={local,global,default}] \starttext \placefigure{A Cow}{\externalfigure[cow][ height=.5\textheight, ]} \placefigure{A Cow}{\externalfigure[cow][ height=.3\textheight, %height=.4\textheight, ]} \placefigure{A Cow}{\externalfigure[cow][ width=3cm, %width=2cm, ]} \placefigure[inleft]{A Cow}{\externalfigure[cow][width=2cm]} \placefigure[inright]{A Cow}{\externalfigure[cow][width=2cm]} \stoptext Just in case it helps, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: minwidth not working ?
On 4/19/24 17:51, Denis Maier via ntg-context wrote: > Hi again, > > another follow up. Can anyone confirm this issue? Is there a way to set > the minimal width of graphics? Hi Denis, maximum widht or height work fine, but their minimum counterparts seem not to be working at all: \showframe \starttext \doloopoverlist{none, width, height, maxwidth, maxheight} {\externalfigure[cow.pdf][\recursestring=.125\textwidth]} \page \doloopoverlist{none, width, height, minwidth, minheight} {\externalfigure[cow.pdf][\recursestring=.33\textwidth]} \stoptext Just to confirm the issue, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: \luaescapestring in proper Lua
On 4/11/24 18:56, Hans Hagen via ntg-context wrote: > [...] >>> \protected\def\PrintTheThing{\ctxlua{document.print_the_thing()}} >> >> Sorry, but why \protected is required or recommended here? > > depends if you want it to be expandable I see now that "still.pdf" has a full chapter (#3, titled “Scanning Input”) and page 79 explains exactly this. 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: unknown script 'mtx-context.lua' or 'mtx-mtx-context.lua
On 4/11/24 18:56, Hans Hagen via ntg-context wrote: > [...] > it searches for mtxrun.lua and context.lua in the same path so you need: > > luametatex.exe > mtxrun.exe (can be link to luametatex.exe) > context.exe (can be link to luametatex.exe) > context.lua > mtxrun.lua > > all in the same (bib) path > > ... always has been so ... But now it seems that luatex has disappeared from our bin directories. Was this intended (because of the issues with the build farm)? 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: unknown script 'mtx-context.lua' or 'mtx-mtx-context.lua
On 4/11/24 17:39, Denis Maier via ntg-context wrote: > [...] > Ok. It wasn't there. I have now copied it from my Miktex installation, but > it still does not work. (Looks like some path issue. The luatex binary from > the miktex installation seems to take priority over the one now in the > ConTeXt installation. Looks like I'm getting somewhere...) I wonder whether the path order might give priority. But in any case, I wonder whether it is intended that current latest (from the ConTeXt distribution) is intended neither to have the latest LuaTeX nor to have any LuaTeX binary at all. Hans (or Luigi), are we (just humble users) missing something here? 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: unknown script 'mtx-context.lua' or 'mtx-mtx-context.lua
On 4/10/24 22:28, Denis Maier wrote: >> [...] >> context --luatex --generate > > Thanks, Pablo. > I've tried it, but it doesn't seem to work... I get the same result on Win64 when I move the luatex binary from the tex/texmf-win64/bin/ directory. This may sound stupid, but could you check whether the bin directory contain the required binary? Sorry, "luatex --version" and even "whereis luatex" should give the same result (but on Windows, it seems to be https://ss64.com/nt/where.html). I hope it may 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: \luaescapestring in proper Lua
On 4/10/24 21:48, Hans Hagen via ntg-context wrote: > On 4/10/2024 7:49 PM, Pablo Rodriguez via ntg-context wrote: >> [...] >> I wonder whether there is a proper way in the Lua code to avoid >> [[\luaescapestring{}]] in \ctxlua. >> [...] > context(tokens.scanners.string()) Many thanks for your reply, Hans. > \protected\def\PrintTheThing{\ctxlua{document.print_the_thing()}} Sorry, but why \protected is required or recommended here? 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] \luaescapestring in proper Lua
Dear list, I have the following sample: \starttext \startluacode function document.print_the_thing(str) context(str) end \stopluacode \unexpanded\def\PrintTheThing#1{% \ctxlua{document.print_the_thing([[\luaescapestring{#1}]])}} \PrintTheThing{a \em b {c}} \stoptext I wonder whether there is a proper way in the Lua code to avoid [[\luaescapestring{}]] in \ctxlua. BTW, [[\luaescapestring{}]] in \ctxlua works better for me, since in my real world document, I’m using str:match() to check whether the string ends with interrogation or exclamation marks ("%?!$"). 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: unknown script 'mtx-context.lua' or 'mtx-mtx-context.lua
On 4/10/24 13:59, Denis Maier via ntg-context wrote: > Hi, > I wanted to test my earlier example (float placement) also with MKIV, but > context ---luatex … > give me this error message : > unknown script 'mtx-context.lua' or 'mtx-mtx-context.lua > How can I make it work? Hi Denis, as far as I know, this is required first: context --luatex --generate BTW, although LuaTeX 1.18 has been released, my Linux64 ConTeXt contains version 1.17.x. In fact, the LuaTeX binary was removed in an update some weeks (or months) ago. I had to copy it from a backup from a previous version. I hope it helps, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: incosistent output of --- dash
On 4/6/24 11:43, madiazm.eo...@gmail.com wrote: > Hi everyone, Hi Miguel, > […] > Am I missing something on the use of this ligature? I don’t think so. In some cases you may not get the ligature for a good reason: \starttyping program --option=value file.ext \stoptyping It would make no sense to get an en-dash there (but I guess you don’t mean that). But all OSes provide character maps to get single characters. And also Unicodia works fine in Windows (https://mercury13.github.io/unicodia/, just in case it might suit your needs). Having a single character (emoji, dashes or whatever) is way more readable than a character combination for a ligature or a TeX command. This single-character approach also makes easier to copy and paste text to other formats. > (the question is just out of curiosity, since I plan to create a > command that adds a hairspace after or before the dash, since I don't > like it to stick to some letters like "o"). Just consider that you should add an horizontal box (or pair both space and hyphen), otherwise you may get a line break between character and hyphen (instead of the hair space): \starttext \startTEXpage[offset=2st] \hsize\zeropoint this —\hairspace or so\hairspace— that this \hbox{—\hairspace}or so\hbox{\hairspace—} that \stopTEXpage \stoptext Just in case it might 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: error with \sc
On 4/3/24 07:16, Peter Münster wrote: > On Tue, Apr 02 2024, Andres Conrado Montoya wrote: > >> You shouldn't run context as root in any case. > > I don’t run context as root. But I need to erase the cache in > /opt/context/tex/texmf-cache as root, because the user doesn’t have the > permission to do that. Sorry, Peter, but I have a suspicion from what you wrote. >> mtxrun --script cache --erase && mtxrun --generate > > Thanks. It did not work after doing it as root, but then I saw, that > there is also a cache in the user home-directory, so I’ve done it as the > user too, and now it works. In principle, cache is only written to tex/texmf-cache. But I guess, when that directory cannot be written by the user, cache is written to $HOME/texmf. This may be why you get two cache directories (instead of only tex/texmf-cache). Cheers, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: error with \sc
On 4/2/24 21:23, Mikael Sundqvist wrote: > On Tue, Apr 2, 2024 at 9:16 PM Peter Münster wrote: >> [...] >> TIA for any hints, > > Hans wrote in his email: > -- If you have troubles (crash) you need to wipe the cache due to a > change in lua bytecode storage (no easy way to catch it). > > Did you do that? (One way is to remove tex/texmf-cache/*) Another way is to run (since your test works fine on my laptop): mtxrun --script cache --erase && mtxrun --generate The format file will be generated in the next compilation, so it will take a bit longer. Just in case it might 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: ConTeXt on RPI400
On 3/27/24 15:55, h...@hongfeng.ch wrote: > Hello Pablo, > > Tried, the problem still remains. Weird, if I remove the cache, I get a single line error message: mtxrun | unknown script 'mtx-context.lua' or 'mtx-mtx-context.lua' Could you run the "install.sh" script located at ~/WORKSPACE/TOOLS/ConTeXt/ on your computer and then "mtxrun --generate"? If you still get the error message above, could you give us the output from "whereis context"? I hope this may 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: ConTeXt on RPI400
On 3/26/24 18:43, Andres Conrado Montoya wrote: > Can you try the following: Delete the `texmf-cache` folder > inside /home/hf/WORKSPACE/TOOLS/ConTeXt/tex/, and then run `mtxrun > --generate && context --make`? In principle, the two following commands should be enough: mtxrun --script cache --erase && mtxrun --generate The format file generation will be run automatically by the next compilation. Just in case it may 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] (again) \xmlinlineprettyprinttext double hyphens
Dear list, I have the following sample: \startbuffer[demo] mtxrun --script check file \stopbuffer \startxmlsetups xml:initialize \xmlsetsetup{#1}{code}{xml:*} \stopxmlsetups \xmlregistersetup{xml:initialize} \startxmlsetups xml:code \xmlprettyprinttext{#1}{none} \xmlinlineprettyprinttext{#1}{none} \stopxmlsetups \definefontfamily[mainface][tt][TeX Gyre Cursor] [features={default}] \setupbodyfont[mainface] \starttext \xmlprocessbuffer{main}{demo}{} \stoptext Current LMTX (2024.03.11 09:34) is giving different results for double hyphens with \xmlprettyprinttext and \xmlinlineprettyprinttext. Since the output of \xmlinlineprettyprinttext is a wrong argument (in the sample), what am I missing here to get the right output with \xmlinlineprettyprinttext? 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Use of marking
On 3/21/24 19:00, Thomas Meyer wrote: > Hi Pablo and Bruce, > > thank you very much for your two solutions. That helps me enormously now. Hi Thomas, literally, »nichts zu danken«, since it was Andrés and not me who provided a solution. Cheers, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Struggling with the distance and right margin text
On 3/22/24 15:57, Ursula Hermann wrote: > Dear Pablo, > > Many thanks for your example. Sorry for writing so late. Dear Ursula, many thanks for your minimal sample. > At least I found out, how it works for me . This is the best way. > [...] > \inrightmargin{\blackrule\\{3.2.2}}\par \dontleavehmode \blackrule It is not clear to me why you need to remain in horizontal mode after a paragraph break. At least, with the following commands, I get the same results: \inoutermargin{\blackrule\\{3.2.2}} \blackrule Just in case it might 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] issue with \xmlinlineprettyprinttext
Dear list, I have the following sample: \startbuffer[demo] a --b c a --b c \stopbuffer \startxmlsetups xml:initialize \xmlsetsetup{#1}{doc|code|inlinecode}{xml:*} \stopxmlsetups \xmlregistersetup{xml:initialize} \startxmlsetups xml:doc \xmlflush{#1} \stopxmlsetups \startxmlsetups xml:code \xmlprettyprinttext{#1}{none} \stopxmlsetups \startxmlsetups xml:inlinecode \xmlinlineprettyprinttext{#1}{none} \stopxmlsetups \definefontfamily[mainface][tt][TeX Gyre Cursor] [features={default, quality}] \setupbodyfont[mainface] \starttext \xmlprocessbuffer{main}{demo}{} \type{a --b c} \stoptext Using current latest (from 2024.03.11 09:34), LMTX transforms "--" in "–" (en-dash) only with \xmlinlineprettyprinttext (LuaTeX writes the en-dash in the three cases). This issue has been driving me crazy, since it took me a while what was different here. Is there something I can do to get \xmlinlineprettyprinttext as \xmlprettyprinttext in this point? 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: issue with typing in footnotes
On 3/17/24 23:58, Wolfgang Schuster wrote: > Pablo Rodriguez via ntg-context schrieb am 17.03.2024 um 17:38: >> [...] >> As far as I know, this sample should be compiled without any issue. >> >> Could you be so kind to confirm the issue or explain me what am I missing? > > The footnote environment is just a fancy way for a command with a > argument and buffers don't like being part of arguments. > > You can put the code in buffer outside of the footnote and type the > content of the buffer in the footnote. Many thanks for your reply, Wolfgang. Everything is clear to me now. 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] issue with typing in footnotes
Dear list, I have the following sample (which was on the way of showing another issue): \starttext a \starttyping b \stoptyping c \startfootnote a \starttyping b \stoptyping c \stopfootnote \stoptext Current latest (from 2024.03.11 09:34) breaks compilation with both LMTX and LuaTeX. As far as I know, this sample should be compiled without any issue. Could you be so kind to confirm the issue or explain me what am I missing? 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: Struggling with the distance and right margin text
On 3/15/24 14:06, Ursula Hermann wrote: > Dear List, Dear Ursula, this might help you (it isn’t perfect, but you just seem to copy and paste fragments from your source files): %\showframe\showstruts \mainlanguage[de-at] \setuppagenumbering[alternative=doublesided] \definemargindata [MyInMargin][ininner] \definemarginframed[MyInMargin] [topframe=on,bottomframe=on,rulethickness=1pt,width=1.90cm] \defineframed[topruletitle] [width=max, frame=off, topframe=on, rulethickness=1pt, align={justify}, extras=\dontleavehmode] \starttext \topruletitle{\MyInMargin {1.1.1}\bf Beispiel 3.2.17. (Vertauschung von All- und Existenzquantor).} \par \input knuth\page \topruletitle{\MyInMargin{3.2.22}{\bf Theorem 3.2.22 (Rechenregeln für Quantoren)}. Seien \m P(\m x)und \input zapf b} \stoptext Sorry for saying that again, but please elaborate both your minimal samples and your descriptions of the issues you are experiencing. Some comments on the code fragments you sent. First of all, please include always code that can be compiled simply after being copied and pasted. This requires \starttext (most of the time) and \stoptext (mandatory to avoid stupid errors). > \definepapersize[MyBook][width=19cm,height=29.7cm] > \setuppapersize[MyBook][MyBook] % Prints on paper the size of MyBook > %\setuppapersize[MyBook][A4] %Would print MyBook-size pages on A4 paper > \setupbodyfont[modern, 12.50pt] If these lines are irrelevant for the issue you are experiencing, please don’t include them. > \definemargindata [MyInMargin][inleft] > \definemarginframed[MyInMargin][topframe=on,bottomframe=on,rulethickness=1pt,width=1.90cm] You define this margin framed, but your sample makes no use of it. Sorry, but I don’t get it. > \defineenumeration > [theorem] > [ > text=Theorem, > title=yes, > width=fit, > distance=0.2em, > alternative=serried, > ] > \definetextbackground[GrayBackground][ > location=paragraph, > background=color, > backgroundcolor=lightgray, > leftoffset=.5\bodyfontsize, > rightoffset=.5\bodyfontsize, > topoffset=.5\bodyfontsize, > bottomoffset=.5\bodyfontsize, > frame=off,] > \margintext{\blackrule[color=black, height=0.10ex, width=1cm]\\} > \blackrule[color=black, height=0.10ex, width=13.50cm] If your sample includes no theorem or text background, please remove these definitions when sending code. BTW, avoid include text content (such as margin and body rules [but not their definitions]) before \starttext. Also, use \clrf instead of \\ (since the mailing list displays the relevant line as ("\" instead of "\\"): > \margintext{\blackrule[color=black, height=0.10ex, width=1cm]\} Here starts your text: > \starttext > \margintext {1.1.1} > {\bf Beispiel 3.2.17. (Vertauschung von All- und Existenzquantor).} \par Your margin text is undefined. Your code has a defined margin text command, but it isn’t used. > So I have here an example from the second page: Sorry, but I’m having the impression you are using ConTeXt as a kind of command-based DTP software (which I think it isn’t at all). Or, do you define commands for each page? I think it is better to define a single margin text command and use a doublesided page setup. > \definemargindata[inrightmargin][right][margin=margin,width=.50em\rightmarginwidth,style=,color=] > \definemarginframed[MyInMargin][topframe=on,bottomframe=on,rulethickness=1pt, > width=.90cm] Again, margin text commands defined, but never used. > \blackrule[color=black, height=0.10ex, width=13.40cm] > {\blackrule[color=black, height=0.10ex, width=1cm, distance=.90cm]\par Here you open a brace that is not closed at all. At least, consider that this won’t be extremely readable for other people (this is only a sample). It also may be problematic for you, if you leave the source untouched for some weeks. > \defineenumeration > [theorem] > [ > text=Theorem, > title=yes, > width=fit, > distance=0.2em, > alternative=serried, > ] At least, it would be better not to include a definition inside content that seems to (or may) be grouped with braces. BTW, it is exactly the same definition as the one included before. It isn’t just to be removed in minimal samples, your final code doesn’t need the duplicated command definition. > \inright{3.2.22} > {\bf Theorem 3.2.22 (Rechenregeln für Quantoren)}. Seien \m P(\m x)und > > My problem here is that there is not the same distance between the the > text and the margintext . Please, always compile the minimal samples that you send to the list. This is simply to ensure other list subscribers will get the same results as you. After adding a final \stoptext command, I had to run: mtxrun --script check source-sample.tex This allowed me to spot the problem with the unclosed brace (mentioned before). > And now the margintext should be on the right side. I get the second margin text on the right side (after all,
[NTG-context] Re: update
On 3/11/24 18:48, Hans Hagen wrote: > Hi, > > Todays update has a fix for the compact mode slant interference (as > explained by Wolfgang a few days ago). Hopefully that works out well. Many thanks for that fix, Hans. Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: issue with module update
On 3/11/24 17:17, Taco Hoekwater wrote: >> On 11 Mar 2024, at 16:57, Pablo Rodriguez wrote: >> [...] >> Is there something I am missing here? > > One of your releases had “changed-name” as its release ‘number’. > > The modules site does not know how to deal with non-numeric release > names all that well; it made a mess of its symlinking stage. > > I fixed the symlink manually, it should be fine now. Really sorry for causing you problems when updating the modules, Taco. I had no idea that non-numeric releases were problematic with symbolic linking. I made that change to avoid having two releases with the same date (I think this also may give issues with symlinks). Well, I realize that if I make a wrong release, I have to number the new version with only numbers (and maybe points instead of hyphens). Sorry again for giving problems and many thanks for your work, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] issue with module update
Dear list, I have just updated a module named PresVoz. I get the standard directory (https://modules.contextgarden.net/dl/presvoz/) and (https://modules.contextgarden.net/dl/presvoz-{%version%}.zip), but no https://modules.contextgarden.net/dl/presvoz.zip (with current version). So when updating the module, I get it only uninstalled. The two most recent updates (this one and the one before) had this issue. Is there something I am missing here? Many thanks your 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: weird character normalization in the wiki
On 3/11/24 09:31, Taco Hoekwater wrote: >> On 9 Mar 2024, at 09:35, Pablo Rodriguez via ntg-context >> wrote: >> >> Sure, they may be a workaround to type codepoints instead of characters >> (such as with \utfchar{0x1fbb}, but wouln’t it be possible to disable >> that character normalization in the wiki? > > AFAIK, Wikimedia’s Unicode normalisation can not be turned off. Hi Taco, then I have to use the woraround. 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: \em issue in MkXL (2024.03.05 11:26)
On 3/10/24 10:46, Hans Hagen via ntg-context wrote: > [...] > using the low level commands > > \glyphscale > \glyphxscale > \glyphyscale > \glyphslant > \glyphweight > > directly can have side efects when at an outer level these are also set, > so you need to accumulate, like > [...] > which you will now wikify... Many thanks for your reply, Hans. I will wikify this, once I figure out where it can fit in the wiki (in due time, since ConTeXt is more and more complex for me lately and my free time is less and less these days). I only used \enableexperiments[fonts.compact] and then \em. I thought when I (mis)read your messages that compact fonts is the way to go in LMTX. This was the reason I enabled them (the sooner we test new features today, the less issues will be faced with them tomorrow). \glyphslant came into the conversation after experiencing an issue triggered by enabling compact fonts. Sorry for being explicitly verbose, but I intend to have the \em behavior also fixed in compact fonts. 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: \em issue in MkXL (2024.03.05 11:26)
On 3/9/24 16:04, Wolfgang Schuster wrote: > Pablo Rodriguez via ntg-context schrieb am 08.03.2024 um 19:39: >> [...] >>\enableexperiments[fonts.compact] >> >> Which seeems weird to me. Or at least, I thought I read that Hans >> enabled it by default in LMTX. > > AFAIR Hans uses the setting in his own documents. I have been using it for a while. I hope the issue with \glyphslant might be fixed to enable it again. >> Then my question is whether this was caused by simply enabling compact >> fonts or by doing it twice. > > The results happen when you use compact mode and is a result of > \glyphslant which keeps the value of the italic style even when you > switch back to the upright style. Many thanks for your explaination, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] weird character normalization in the wiki
Dear list, https://wiki.contextgarden.net/Greek#Monotonic_and_Acute_Accent includes two samples that should display the difference betweeen the monotonic accent and the polytonic acute accent (which generate two different characters for each such accented vowel). Excluding other implications, these are two different characters. In some fonts each pair of different characters for each accented letter lead to the same glyph, in other fonts those glyphs are different. This sample shows the difference (there should display two slightly different accents [unless there is some character normalization on the way]): \definefontfamily[mainface][rm][EBGaramond] \setupbodyfont[mainface, 500pt] \definecolor [tred] [r=1,t=.5,a=1] \definecolor [tblue] [b=1,t=.25,a=1] \starttext \startTEXpage[offset=1ex] \startoverlay {\color[tred]{Ά}} {\color[tblue]{Ά}} \stopoverlay \stopTEXpage \stoptext The problem that I have is tricky. Thanks to character normalization (at least in Firefox), searching for "á" will also find "a" (unless “Match diacritics” is enabled). I’m afraid the wiki is performing some character normalization, which renders samples in https://wiki.contextgarden.net/Greek#Monotonic_and_Acute_Accent useless. Searching for "Ά" in https://wiki.contextgarden.net/Greek should give not more than 4 matches (not case-sensitive and with “Match diacritics” [or similar filter for your browser] enabled). I‘m afraid I get none. While editing the article searching for "Ά" (case-insensitive and not normalizing characters), gave me 4 matches, but only in the source (no ocurrence was found in the preview). Once changes are saved, "Ά" occurrences dissapear (since they seem to be normalized). Sure, they may be a workaround to type codepoints instead of characters (such as with \utfchar{0x1fbb}, but wouln’t it be possible to disable that character normalization in the wiki? 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: \em issue in MkXL (2024.03.05 11:26)
On 3/8/24 19:09, Wolfgang Schuster wrote: > Pablo Rodriguez via ntg-context schrieb am 08.03.2024 um 18:50: >> [...] >> LMTX gets b, c and d in slanted form. >> >> LuaTeX gets only b and c in slanted form. > [...] > I get b and d in italic which is the expected output. Sorry, my LuaTeX is getting slanted b and d ("c" was my typo). But I see what was causing my issue (line from ~/texmf/texmf-local/cont-loc.mkxl): \enableexperiments[fonts.compact] Which seeems weird to me. Or at least, I thought I read that Hans enabled it by default in LMTX. Then my question is whether this was caused by simply enabling compact fonts or by doing it twice. 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] \em issue in MkXL (2024.03.05 11:26)
Dear list, the following latest gets differents results when compiled with MkXL and MkIV (in current latest from 2024.03.05 11:26): \definefontfamily[mainface][rm][TeX Gyre Termes] [features={default, quality}, it={style: regular, features:{default, quality, slanted}}, sl={style: regular, features:{default, quality, slanted}}] \setupbodyfontenvironment [default] [em=italic] \setupbodyfont[mainface] \starttext \startTEXpage[offset=1em] a\\ \em b\\ \em c\\ \em d\\ \stopTEXpage \stoptext LMTX gets b, c and d in slanted form. LuaTeX gets only b and c in slanted form. I think LMTX may have an issue here. Could anyone be so kind to confirm this? 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___