[NTG-context] Re: [ how to force hyphenation all words ]
On Thu, 16 Nov 2023 21:40:08 +0100 vm via ntg-context wrote: > Is there a command in context to force every word in a text to > hyphenate? e.g to typeset a text with "ge-dach-ten-streep-jes" Like this? \starttext \hyphenatedword{\samplefile{knuth}} \stoptext Marco ___ 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] [ how to force hyphenation all words ]
Is there a command in context to force every word in a text to hyphenate? e.g to typeset a text with "ge-dach-ten-streep-jes" Thanks .Floris ___ 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: How to make words searchable without diacritics
This is perfect, as it works also with mupdf-gl and firefox! Thank you, Hans Kind regards Marcus Vinicius On Mon, Aug 7, 2023 at 4:58 PM Hans Hagen wrote: > > On 8/7/2023 8:58 PM, Marcus Vinicius Mesquita wrote: > > @ Ulrike: This is what my client wants, and the client is always right. > You can try this: > > \starttext > > \protected\def\ProofOfConcept#1#2% >{{#1\llap{\effect[hidden]{#2 > > test test \ProofOfConcept{föö}{foo} test > > \stoptext > > but forget about hyphenation (actualtext probably also doesn't always > work well across lines in viewers). > > Hans > > - >Hans Hagen | PRAGMA ADE >Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl > - > > ___ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / > https://www.ntg.nl/mailman/listinfo/ntg-context > webpage : https://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : https://contextgarden.net > ___ -- Todas as coisas fatigam o corpo, salvo a música, que não fatiga nem o corpo nem seus membros, por ser descanso da alma, primavera do coração, distração do aflito, entretenimento do solitário, e viático do viajante. Kunnâsh al-Hâ'ik (Cancioneiro de al-Hâ'ik) ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: How to make words searchable without diacritics
On 8/7/2023 8:58 PM, Marcus Vinicius Mesquita wrote: @ Ulrike: This is what my client wants, and the client is always right. You can try this: \starttext \protected\def\ProofOfConcept#1#2% {{#1\llap{\effect[hidden]{#2 test test \ProofOfConcept{föö}{foo} test \stoptext but forget about hyphenation (actualtext probably also doesn't always work well across lines in viewers). Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: How to make words searchable without diacritics
@ Ulrike: This is what my client wants, and the client is always right. Regards Marcus Vinicius On Mon, Aug 7, 2023 at 2:23 PM Henning Hraban Ramm wrote: > > Am 07.08.23 um 14:17 schrieb Marcus Vinicius Mesquita: > > Thank you for the answers, Bruce, Pablo and Hraban. I was not aware of > > ActualText. > > > > I work on a manjaro linux, and I tested the example Pablo sent on > > several programs: > > > > mupdf-gl or mupdf: fails! [mupdf-gl is what I customarily use for its > > blazing speed] > > firefox: fails > > vivaldi: passes > > okular: passes > > qpdfview: passes > > evince: passes > > Thank you for researching! I’ll include this in my viewer matrix. (But > probably not before the ConTeXt meeting.) > > > But \pdfbackendactualtext is actually just what I needed since it can > > be used also for other things like: > > > > \starttext > > what a \pdfbackendactualtext{\hyphenatedword{wonderful}}{wonderful} text > > \stoptext > > I’m not sure but I’d guess ActualText is also suitable for alternative > texts (AltText) of images? Wouldn’t it make sense to have an alttext key > in \externalfigure for accessibility (PDF/UA)? > > Hraban > ___ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / > https://www.ntg.nl/mailman/listinfo/ntg-context > webpage : https://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : https://contextgarden.net > ___ -- Todas as coisas fatigam o corpo, salvo a música, que não fatiga nem o corpo nem seus membros, por ser descanso da alma, primavera do coração, distração do aflito, entretenimento do solitário, e viático do viajante. Kunnâsh al-Hâ'ik (Cancioneiro de al-Hâ'ik) ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: How to make words searchable without diacritics
Am 07.08.23 um 14:17 schrieb Marcus Vinicius Mesquita: Thank you for the answers, Bruce, Pablo and Hraban. I was not aware of ActualText. I work on a manjaro linux, and I tested the example Pablo sent on several programs: mupdf-gl or mupdf: fails! [mupdf-gl is what I customarily use for its blazing speed] firefox: fails vivaldi: passes okular: passes qpdfview: passes evince: passes Thank you for researching! I’ll include this in my viewer matrix. (But probably not before the ConTeXt meeting.) But \pdfbackendactualtext is actually just what I needed since it can be used also for other things like: \starttext what a \pdfbackendactualtext{\hyphenatedword{wonderful}}{wonderful} text \stoptext I’m not sure but I’d guess ActualText is also suitable for alternative texts (AltText) of images? Wouldn’t it make sense to have an alttext key in \externalfigure for accessibility (PDF/UA)? Hraban ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: How to make words searchable without diacritics
Am Mon, 7 Aug 2023 09:17:19 -0300 schrieb Marcus Vinicius Mesquita: > Thank you for the answers, Bruce, Pablo and Hraban. I was not aware of > ActualText. > > But \pdfbackendactualtext is actually just what I needed since it can > be used also for other things like: I don't think that it would be a good idea to use ActualText for this. You are effectivly changing the content and meaning of your text, not only for search, but also for copy, screen reader, html export etc. If you think it is okay to claim that the text is filia and then the accents are irrelevant, then why don't you print filia directly? -- Ulrike Fischer http://www.troubleshooting-tex.de/ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: How to make words searchable without diacritics
Thank you for the answers, Bruce, Pablo and Hraban. I was not aware of ActualText. I work on a manjaro linux, and I tested the example Pablo sent on several programs: mupdf-gl or mupdf: fails! [mupdf-gl is what I customarily use for its blazing speed] firefox: fails vivaldi: passes okular: passes qpdfview: passes evince: passes But \pdfbackendactualtext is actually just what I needed since it can be used also for other things like: \starttext what a \pdfbackendactualtext{\hyphenatedword{wonderful}}{wonderful} text \stoptext Best regards Marcus Vinicius On Mon, Aug 7, 2023 at 3:13 AM Henning Hraban Ramm wrote: > > Am 06.08.23 um 20:37 schrieb Pablo Rodriguez: > > Hans provides this jewel in back-imp-pdf.mkxl and back-pdf.mkiv (adapter > > for your needs): > > > >\starttext > >text \pdfbackendactualtext{whatever you want}{filia} text > >\stoptext > > > > > In any case, the PDF viewer used to search must have ActualText implemented. > > Exactly. And e.g. Apple’s PDF library has not; it is used not only by > Preview.app, but also by Skim and TeXshop. (I should check this with > other viewers/libs.) > > Hraban > > ___ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / > https://www.ntg.nl/mailman/listinfo/ntg-context > webpage : https://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : https://contextgarden.net > ___ -- Todas as coisas fatigam o corpo, salvo a música, que não fatiga nem o corpo nem seus membros, por ser descanso da alma, primavera do coração, distração do aflito, entretenimento do solitário, e viático do viajante. Kunnâsh al-Hâ'ik (Cancioneiro de al-Hâ'ik) ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: How to make words searchable without diacritics
Am 06.08.23 um 20:37 schrieb Pablo Rodriguez: Hans provides this jewel in back-imp-pdf.mkxl and back-pdf.mkiv (adapter for your needs): \starttext text \pdfbackendactualtext{whatever you want}{filia} text \stoptext In any case, the PDF viewer used to search must have ActualText implemented. Exactly. And e.g. Apple’s PDF library has not; it is used not only by Preview.app, but also by Skim and TeXshop. (I should check this with other viewers/libs.) Hraban ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: How to make words searchable without diacritics
On 8/5/23 21:16, Marcus Vinicius Mesquita wrote: > Dear List, > > I have a lot of latin words in a document with the length of the > vowels indicated by diacritics, for example: fīlĭa. > > Is it possible somehow to make these words searchable without the diacritics? > That is, if I make a search for filia in the final pdf file, fīlĭa > would also be found? Dear Marcus Vinicius, in PDF (the format itself), ActualText is a way of providing a text replacement for the displayed element. If you use ActualText, the string you search is the text replacement you provide. That way, you could find literally “whatever you want” (being "filia" its ActualText). Hans provides this jewel in back-imp-pdf.mkxl and back-pdf.mkiv (adapter for your needs): \starttext text \pdfbackendactualtext{whatever you want}{filia} text \stoptext That being said, I think this is the wrong approach to your issue. Firefox also disables diacritics by default (at least for me, this is not a minor issue). In any case, the PDF viewer used to search must have ActualText implemented. 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://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: How to make words searchable without diacritics
In Adobe Reader there is an option Preferences › Categories › Search › [ ] Ignore Diacritics and Accents which you can tick to search on the underlying letter only. If the search is for your own use only then this might be a solution rather than change the generated PDF. > On 5 Aug 2023, at 20:16, Marcus Vinicius Mesquita > wrote: > > Dear List, > > I have a lot of latin words in a document with the length of the > vowels indicated by diacritics, for example: fīlĭa. > > Is it possible somehow to make these words searchable without the diacritics? > That is, if I make a search for filia in the final pdf file, fīlĭa > would also be found? — Bruce Horrocks Hampshire, UK ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] How to make words searchable without diacritics
Dear List, I have a lot of latin words in a document with the length of the vowels indicated by diacritics, for example: fīlĭa. Is it possible somehow to make these words searchable without the diacritics? That is, if I make a search for filia in the final pdf file, fīlĭa would also be found? Regards Marcus Vinicius -- Todas as coisas fatigam o corpo, salvo a música, que não fatiga nem o corpo nem seus membros, por ser descanso da alma, primavera do coração, distração do aflito, entretenimento do solitário, e viático do viajante. Kunnâsh al-Hâ'ik (Cancioneiro de al-Hâ'ik) ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] Adding support for German language to the Words conversion
Hi Marcus, any news on that? Seems like you didn’t send your work to Hans or it didn’t arrive. Happy new year, Hraban Am 31.10.22 um 10:05 schrieb Wolfgang Schuster via ntg-context: Hi Marcus, do you have an update on the support for german verbose numbers? Wolfgang Hans Hagen via ntg-context schrieb am 10.10.2022 um 23:44: On 10/10/2022 9:21 PM, Marcus Christopher Ludl via ntg-context wrote: Hello all, this is my first contribution to this mailing list. Recently, when I posted a question on StackExchange.com regarding adding support for another language (German) to the "Words" conversion in ConTeXt (see here: https://tex.stackexchange.com/questions/657534/how-to-add-support-for-another-language-german-to-the-words-conversion-in-cont), @mickep suggested that I post the patched file (core-con.lua) to the mailing list, once I have it finished, so that it can be added for all to use. So, now that I'm confident my code works well, I would like to do just that. How should I proceed? Should I just send the file including my new code as an attachement to the mailing list? Or would it be preferrable to paste only the new parts of the code inline into an e-mail? Is that even the correct mailing list or would it be better to send this to dev-cont...@ntg.nl? just mail them to me and wolfgang and we'll have a look at it Hans ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] Adding support for German language to the Words conversion
Hi Marcus, do you have an update on the support for german verbose numbers? Wolfgang Hans Hagen via ntg-context schrieb am 10.10.2022 um 23:44: On 10/10/2022 9:21 PM, Marcus Christopher Ludl via ntg-context wrote: Hello all, this is my first contribution to this mailing list. Recently, when I posted a question on StackExchange.com regarding adding support for another language (German) to the "Words" conversion in ConTeXt (see here: https://tex.stackexchange.com/questions/657534/how-to-add-support-for-another-language-german-to-the-words-conversion-in-cont), @mickep suggested that I post the patched file (core-con.lua) to the mailing list, once I have it finished, so that it can be added for all to use. So, now that I'm confident my code works well, I would like to do just that. How should I proceed? Should I just send the file including my new code as an attachement to the mailing list? Or would it be preferrable to paste only the new parts of the code inline into an e-mail? Is that even the correct mailing list or would it be better to send this to dev-cont...@ntg.nl? just mail them to me and wolfgang and we'll have a look at it Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] Adding support for German language to the Words conversion
On 10/10/2022 9:21 PM, Marcus Christopher Ludl via ntg-context wrote: Hello all, this is my first contribution to this mailing list. Recently, when I posted a question on StackExchange.com regarding adding support for another language (German) to the "Words" conversion in ConTeXt (see here: https://tex.stackexchange.com/questions/657534/how-to-add-support-for-another-language-german-to-the-words-conversion-in-cont), @mickep suggested that I post the patched file (core-con.lua) to the mailing list, once I have it finished, so that it can be added for all to use. So, now that I'm confident my code works well, I would like to do just that. How should I proceed? Should I just send the file including my new code as an attachement to the mailing list? Or would it be preferrable to paste only the new parts of the code inline into an e-mail? Is that even the correct mailing list or would it be better to send this to dev-cont...@ntg.nl? just mail them to me and wolfgang and we'll have a look at it Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Adding support for German language to the Words conversion
Hello all, this is my first contribution to this mailing list. Recently, when I posted a question on StackExchange.com regarding adding support for another language (German) to the "Words" conversion in ConTeXt (see here: https://tex.stackexchange.com/questions/657534/how-to-add-support-for-another-language-german-to-the-words-conversion-in-cont), @mickep suggested that I post the patched file (core-con.lua) to the mailing list, once I have it finished, so that it can be added for all to use. So, now that I'm confident my code works well, I would like to do just that. How should I proceed? Should I just send the file including my new code as an attachement to the mailing list? Or would it be preferrable to paste only the new parts of the code inline into an e-mail? Is that even the correct mailing list or would it be better to send this to dev-cont...@ntg.nl? Best, Marcus ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Fwd: Malfunctioning of syllabic partitioning of words in Spanish
Mensaje reenviado Asunto: Re: [NTG-context] Malfunctioning of syllabic partitioning of words in Spanish Fecha: Thu, 7 Jul 2022 08:26:49 +0200 De: Joaquín Ataz López Organización: Universidad de Murcia Para: Max Chernoff Thank you very much for the quick response. Indeed with the \language[es] command the syllable partitioning is correct. I had not included it because in the preamble of the document appears the instruction \mainlanguage[es]. After verifying that indeed the syllabic partitioning works well, I have been doing several tests to see why the \mainlanguage[es] command in the environment file was ignored. In the end I have come to the conclusion that this was because I had written in it \startenvironment instead of \startenvironment environment_name What I do not understand is why, when not putting the name of the environment some commands of this one are ignored, but others are executed. El 7/7/22 a las 7:38, Max Chernoff escribió: \language[es] % Needed for Spanish hyphenation \starttext \hsize=0pt % Hack to force hyphenation limitarse colores abstenerse \stoptext -- - Joaquín Ataz López Derecho civil Universidad de Murcia - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Malfunctioning of syllabic partitioning of words in Spanish
I am writing a document in Spanish and I notice that the syllable partitioning of words does not conform to the rules of the language. And so, for example, the word "limitarse" is partitioned as "lim-itarse" (the correct one is "li-mi-tar-se"), "colores" as "col-ores" (instead of "co-lo-res"), "abstenerse" as "absten-erse" (and it should be "abs-te-ner-se"), etc. Make sure that you set up the language correctly. Using this test file (on today's new upload): \language[es] % Needed for Spanish hyphenation \starttext \hsize=0pt % Hack to force hyphenation limitarse colores abstenerse \stoptext I get: li-mi-tar-se // co-lo-res // abs-te-ner-se I don't know any Spanish, but using your test words, I think that these are the expected results. Using the "pattern" script, I get slightly different results, but it still seems correct to me: $ mtxrun --script pattern --hyphenate --language=es limitarse [...] mtx-patterns| es 3 3 : limitarse : limi-tarse $ mtxrun --script pattern --hyphenate --language=es colores [...] mtx-patterns| es 3 3 : colores : colo-res $ mtxrun --script pattern --hyphenate --language=es abstenerse [...] mtx-patterns| es 3 3 : abstenerse : abs-te-nerse If adding "\language[es]" to your document doesn't help, I believe that there are a few Spanish speakers on the list who will know much more than I do about setting up the hyphenation. -- Max ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Malfunctioning of syllabic partitioning of words in Spanish
I am writing a document in Spanish and I notice that the syllable partitioning of words does not conform to the rules of the language. And so, for example, the word "limitarse" is partitioned as "lim-itarse" (the correct one is "li-mi-tar-se"), "colores" as "col-ores" (instead of "co-lo-res"), "abstenerse" as "absten-erse" (and it should be "abs-te-ner-se"), etc. These are too many errors; moreover, given that the syllabic partitioning rules in Spanish are relatively simple. Is it possible that something has been changed in the Spanish language module? I do not know Lua and therefore I am not in a position to correct the corresponding module on my own, but I could synthesize the syllable partitioning rules for those who can, if they do not speak Spanish and need help in that field. -- Joaquín Ataz López Universidad de Murcia | j...@um.es ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] space between chapter and chapter number (in words)
Hello Julian! On Thu, 15 Oct 2020 at 00:08, jbf wrote: > I wonder if someone could explain to me what controls (or how to > control) the space between Chapter and chapter number in my TOC given > the setup I have. > > At the moment I get ChapterOne instead of Chapter One, and I do not know > what is causing that. > First of all you don't get space even in the chapter header and as such it passes to TOC. Adding a space in \setuplabletext will do the trick for both chapter headers and TOC. \setuplabeltext [en] [chapter=\bf Chapter\ ] Regards, Jano ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] space between chapter and chapter number (in words)
I wonder if someone could explain to me what controls (or how to control) the space between Chapter and chapter number in my TOC given the setup I have. At the moment I get ChapterOne instead of Chapter One, and I do not know what is causing that. Here is my set up (at least all the parts that I think are controlling the appearance of Chapter Number in the TOC). Am I missing something? I thought perhaps the third line in the ChapterListCommand below might be what controls this, so I did try adding \hskip 1em (or 2em etc.) in the \currentlistsymbol section of that line, but it did nothing to solve the problem: \define[3]\ChapterListCommand {\hbox\bgroup \hbox to 2.5cm{\currentlistsymbol\hss}% number + labeltext \vtop\bgroup \hsize\dimexpr\makeupwidth-2.5cm\relax \doifsomething{\rawstructurelistuservariable{year}} {{\structurelistuservariable{year}}\crlf}% \currentlistentrytitle % title \doifsomething{\rawstructurelistuservariable{author}} {\crlf{\structurelistuservariable{author}}}% \hfill\currentlistentrypagenumber % pagenumber \egroup \egroup} \setuplabeltext [en] [ chapter=\bf Chapter , ] \setuplist [chapter] [label=yes, alternative=command, command=\ChapterListCommand] Julian ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Multi-letter words/identifiers in math
On 10/1/2019 6:52 PM, Shuxian Wang wrote: Thanks Hans! Your suggestion does partially solve the problem, but it seems that `\mfunction` internally called `\rm` to set upright Roman font in math mode. Does achieving the same effects (text-like kerning) for italics and bold style still requires custom fonts? It depends on the font. A proper opentype math font should have at least the basic latin characters for test and these then if needed will have kerns and such. Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Multi-letter words/identifiers in math
On 9/29/2019 9:30 AM, Shuxian Wang wrote: Dear list, I am trying to typeset some multi-letter words/identifiers in mathematical formulas. Currently, doing things like |{\it variable}| or |{\mathit variable}| under math mode will cause the engine to shift all characters into the corresponding unicode mathematical alphanumeric block position. However, most OpenType fonts that have good support for unicode math are optimized for single-character usage. Therefore, the outcome of such method is non-ideal, as no kerning or ligatures will be enabled. Especially, this gives bad output when typesetting variable names with combinations like “ffi”. Looking through some past discussions on the list, I am aware of the usage of |\mathword| and |\mathtext|. Using those command will keep all the characters “as is” and typeset them under text mode (as far as I can tell). But those commands switch to the main body fonts temporarily to accomplish this. Sometime when using a different math font than the main font (like Palatino with Latin Modern Math), I wish my variable names can also be in the math font (or at least very similar, such as Latin Modern vs. Latin Modern Math) to better merge with the formula. The way I am currently doing is to introduce some “math text fonts” that is different from the main text font but close to the math font. And with custom font switchers like |\mwrm| and |\mwit| to help me define things like | \def\wordrm#1{\mbox{\mwrm #1}} \def\wordit#1{\mbox{\mwit #1}} | Am I missing some builtin functionalities or easier ways to do this? If not, would it be a good idea to extend the functionality of |\mathword| so it lifts out the restriction of only using the main text font? maybe \mfunction{...} is what you are looking for - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Multi-letter words/identifiers in math
Dear list, I am trying to typeset some multi-letter words/identifiers in mathematical formulas. Currently, doing things like `{\it variable}` or `{\mathit variable}` under math mode will cause the engine to shift all characters into the corresponding unicode mathematical alphanumeric block position. However, most OpenType fonts that have good support for unicode math are optimized for single-character usage. Therefore, the outcome of such method is non-ideal, as no kerning or ligatures will be enabled. Especially, this gives bad output when typesetting variable names with combinations like “ffi”. Looking through some past discussions on the list, I am aware of the usage of `\mathword` and `\mathtext`. Using those command will keep all the characters “as is” and typeset them under text mode (as far as I can tell). But those commands switch to the main body fonts temporarily to accomplish this. Sometime when using a different math font than the main font (like Palatino with Latin Modern Math), I wish my variable names can also be in the math font (or at least very similar, such as Latin Modern vs. Latin Modern Math) to better merge with the formula. The way I am currently doing is to introduce some “math text fonts” that is different from the main text font but close to the math font. And with custom font switchers like `\mwrm` and `\mwit` to help me define things like ``` \def\wordrm#1{\mbox{\mwrm #1}} \def\wordit#1{\mbox{\mwit #1}} ``` Am I missing some builtin functionalities or easier ways to do this? If not, would it be a good idea to extend the functionality of `\mathword` so it lifts out the restriction of only using the main text font? Thanks! Shuxian Wang___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] disabling ligatures in selected words
Hi Thomas, Am 23.10.2015 um 21:23 schrieb Thomas A. Schmitz: > On 23.10.2015 21:09, Wolfgang Schuster wrote: >> Take a look at the new replacement mechanism (lang-rep.mkiv): >> >> - http://www.ntg.nl/pipermail/ntg-context/2015/083044.html >> - http://www.ntg.nl/pipermail/ntg-context/2015/083034.html > > > Aditya, Wolfgang, > > thank you both - both solutions look great and now I remember having > seen the thread that Wolfgang linked to. Will try both of them! > Did you suceed? Where and how did you set the options? I cannot get these solutions to work with my xml input file. juh ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] disabling ligatures in selected words
Hi, in German typography, ligatures are disabled at boundaries between what used to be independent words (Wortfugen). Thusly, in a correct German text, you'd find Anflug (with fl-ligature) but Auf|lage (without ligature). I know that I can prevent a ligature with something like Auf\/lage or even Auf|*|lage. However, I typeset from xml and would much rather have a general solution so I can leave my generated xml files alone. Something like a list where I could list "ligature exceptions" the way we have a file with hyphenation exceptions. Is anything like this possible? Thanks Thomas ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] disabling ligatures in selected words
On Fri, 23 Oct 2015, Thomas A. Schmitz wrote: Hi, in German typography, ligatures are disabled at boundaries between what used to be independent words (Wortfugen). Thusly, in a correct German text, you'd find Anflug (with fl-ligature) but Auf| lage (without ligature). I know that I can prevent a ligature with something like Auf\/lage or even Auf|*|lage. However, I typeset from xml and would much rather have a general solution so I can leave my generated xml files alone. Something like a list where I could list "ligature exceptions" the way we have a file with hyphenation exceptions. Is anything like this possible? This has been asked on tex stackexchange. One option is to use the translate module: http://tex.stackexchange.com/a/37465/323 http://tex.stackexchange.com/a/28746/323 Aditya ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] disabling ligatures in selected words
Aditya Mahajan <mailto:adit...@umich.edu> 23. Oktober 2015 um 20:57 On Fri, 23 Oct 2015, Thomas A. Schmitz wrote: This has been asked on tex stackexchange. One option is to use the translate module: http://tex.stackexchange.com/a/37465/323 http://tex.stackexchange.com/a/28746/323 Aditya ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ Thomas A. Schmitz <mailto:thomas.schm...@uni-bonn.de> 23. Oktober 2015 um 20:51 Hi, in German typography, ligatures are disabled at boundaries between what used to be independent words (Wortfugen). Thusly, in a correct German text, you'd find Anflug (with fl-ligature) but Auf|lage (without ligature). I know that I can prevent a ligature with something like Auf\/lage or even Auf|*|lage. However, I typeset from xml and would much rather have a general solution so I can leave my generated xml files alone. Something like a list where I could list "ligature exceptions" the way we have a file with hyphenation exceptions. Is anything like this possible? Take a look at the new replacement mechanism (lang-rep.mkiv): - http://www.ntg.nl/pipermail/ntg-context/2015/083044.html - http://www.ntg.nl/pipermail/ntg-context/2015/083034.html Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] disabling ligatures in selected words
On 23.10.2015 21:09, Wolfgang Schuster wrote: Take a look at the new replacement mechanism (lang-rep.mkiv): - http://www.ntg.nl/pipermail/ntg-context/2015/083044.html - http://www.ntg.nl/pipermail/ntg-context/2015/083034.html Aditya, Wolfgang, thank you both - both solutions look great and now I remember having seen the thread that Wolfgang linked to. Will try both of them! Thanks and all best Thomas ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] \Words and uppercase letters
Dear list, the following sample doesn’t work as expected: \starttext \Words A CCC \stoptext Is there no way to get all words in lowercase characters and the initial uppercase characters? Many thanks for your help, Pablo -- http://www.ousia.tk ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] \Words and uppercase letters
Am 2014-12-03 um 22:52 schrieb Pablo Rodriguez oi...@gmx.es: the following sample doesn’t work as expected: \starttext \Words A CCC \stoptext Is there no way to get all words in lowercase characters and the initial uppercase characters? \Words{} uppercases the first character of the words in its brackets. What do you expect? See also http://wiki.contextgarden.net/Basic_Text_Formatting Greetlings, Hraban --- http://www.fiee.net/texnique/ http://wiki.contextgarden.net https://www.cacert.org (I'm an assurer) ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] \Words and uppercase letters
On 12/03/2014 06:09 PM, Henning Hraban Ramm wrote: Am 2014-12-03 um 22:52 schrieb Pablo Rodriguez: [...] Is there no way to get all words in lowercase characters and the initial uppercase characters? \Words{} uppercases the first character of the words in its brackets. What do you expect? Many thanks for your reply, Hraban. I expected that all other characters would be in lowercase. \word{AAA} does this for all characters, so I thought \Words{A} would do the same for the characters others than the first one in each word. Pablo -- http://www.ousia.tk ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] \Words and uppercase letters
On 12/3/2014 5:52 PM, Pablo Rodriguez wrote: Dear list, the following sample doesn’t work as expected: \starttext \Words A CCC \stoptext use this grouped: \Words{} Is there no way to get all words in lowercase characters and the initial uppercase characters? I'll add \camel - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] \Words and uppercase letters
On Wed, Dec 03 2014, Pablo Rodriguez wrote: I thought \Words{A} would do the same for the characters others than the first one in each word. \def\myWords#1{\Words{\lowercase{#1}}} \starttext \myWords{A CCC} \stoptext -- Peter ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] \Words and uppercase letters
On Wed, 3 Dec 2014 19:05:22 +0100 Peter Münster pmli...@free.fr wrote: On Wed, Dec 03 2014, Pablo Rodriguez wrote: I thought \Words{A} would do the same for the characters others than the first one in each word. \def\myWords#1{\Words{\lowercase{#1}}} \starttext \myWords{A CCC} \stoptext This is because we want \Words{} to respect some upper case, for example, \Words{Acronyms, such as DNA, should remain capitalized}. Alan ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] \Words and uppercase letters
On 12/03/2014 07:01 PM, Hans Hagen wrote: On 12/3/2014 5:52 PM, Pablo Rodriguez wrote: [...] \Words A CCC use this grouped: \Words{} My fault. Is there no way to get all words in lowercase characters and the initial uppercase characters? I'll add \camel Many thanks for the implementation. Pablo -- http://www.ousia.tk ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] \Words and uppercase letters
On 12/03/2014 07:05 PM, Peter Münster wrote: On Wed, Dec 03 2014, Pablo Rodriguez wrote: I thought \Words{A} would do the same for the characters others than the first one in each word. \def\myWords#1{\Words{\lowercase{#1}}} \starttext \myWords{A CCC} \stoptext Many thanks for your reply, Peter. This was exactly what I needed. I tried \Words{\words{AAA BBB CCC}}. Since it didn’t work, I was clueless about this. Pablo -- http://www.ousia.tk ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] \Words and uppercase letters
On 12/03/2014 07:16 PM, Alan BRASLAU wrote: On Wed, 3 Dec 2014 19:05:22 +0100 Peter Münster wrote: \def\myWords#1{\Words{\lowercase{#1}}} \starttext \myWords{A CCC} \stoptext This is because we want \Words{} to respect some upper case, for example, \Words{Acronyms, such as DNA, should remain capitalized}. Many thanks for the info, Alan. Everything is clear to me now. Pablo -- http://www.ousia.tk ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Find all words set into the margin
On Mon, 26 Nov 2012 13:52:52 +0100 H. Özoguz h.oezo...@mmnetz.de wrote: I use \definefontfeature[default][default][expansion=quality,protrusion=quality] \setupalign[hz,hanging] \usetypescript[times] \setupbodyfont[times,11pt] \setuptolerance[verystrict] Is there a command or a macro to find all occurences in a file (or projekt), where some word is printed into the margin? (Maybe because of bad hyphenation or something else.) - Would be perfect for manual check-up and corrections! Thanks. Huseyin You could try setting \overfullrule=5pt This is an original TeX primitive. Plain TeX sets it at 5pt. You can then scan pages looking for a black rectangle in the right margin. I cannot determine which code to search for in e.g., grep but perhaps you can. I just tested it and \overfillrule works with MKIV context if it is set for some value other than zero. -- John Culleton Wexford Press Free list of books for self-publishers: http://wexfordpress.net/shortlist.html PDF e-book: Create Book Covers with Scribus available at http://www.booklocker.com/books/4055.html ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] how to change the distance between two words?
Hi, On 02/06/2013 06:41 PM, Hans Hagen wrote: I'm experiencing the same kpathsea/cnf.c assertion failure when doing mtxrun --script fonts --reload. ConTeXt minimals still has luatex version beta-0.74.0-2012122517, and the source code server http://foundry.supelec.fr/gf/project/luatex has been unreachable for days. Hm, context doesn't use the kpse lib. That error is caused the cidmap callbacks that were added in luatex 0.74 and will be removed again in luatex 0.75. At some point, there was code for those callbacks in the context beta, but not any more apparently? Meanwhile, foundry.supelec.fr is down because of hardware upgrades, so we cannot do a new luatex release immediately. As soon as possible, we promise. Best wishes, Taco ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] how to change the distance between two words?
Am 20.01.2013 um 03:42 schrieb Hongwen Qiu qiuhong...@gmail.com: On 01/20/2013 12:42 AM, 土卜皿 wrote: luatex has not been updated after executing first-setup.sh --keep, what should I do for updating Luatex? Usually, luatex get updated regularly along with ConTeXt updating. If for some reason, you want to use the latest luatex binary, you need to compile it from source code yourself. If you have difficultly compile binary from source, you can ask others to compile for you, or just wait for the binary to eventually come into the ConTeXt repo. I'm experiencing the same kpathsea/cnf.c assertion failure when doing mtxrun --script fonts --reload. ConTeXt minimals still has luatex version beta-0.74.0-2012122517, and the source code server http://foundry.supelec.fr/gf/project/luatex has been unreachable for days. So, what options do I have to get luatex 0.75 to get my installation working again? Or is there a planned time frame when 0.75 is scheduled to be integrated in the distribution? Thanks Maik ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] how to change the distance between two words?
On 2/6/2013 5:54 PM, Musall Maik wrote: Am 20.01.2013 um 03:42 schrieb Hongwen Qiu qiuhong...@gmail.com mailto:qiuhong...@gmail.com: On 01/20/2013 12:42 AM, 土卜皿 wrote: luatex has not been updated after executing first-setup.sh --keep, what should I do for updating Luatex? Usually, luatex get updated regularly along with ConTeXt updating. If for some reason, you want to use the latest luatex binary, you need to compile it from source code yourself. If you have difficultly compile binary from source, you can ask others to compile for you, or just wait for the binary to eventually come into the ConTeXt repo. Normally meaning: when there is a release. Beta's of luatex normally are not ending up in the mininimals unless we decide to to so. I'm experiencing the same kpathsea/cnf.c assertion failure when doing mtxrun --script fonts --reload. ConTeXt minimals still has luatex version beta-0.74.0-2012122517, and the source code server http://foundry.supelec.fr/gf/project/luatex has been unreachable for days. Hm, context doesn't use the kpse lib. So, what options do I have to get luatex 0.75 to get my installation working again? Or is there a planned time frame when 0.75 is scheduled to be integrated in the distribution? The supelec server is being replaced / updates so that's why it's unreachable for a while. The 0.75 version is not yet official (and I know of at least one bug that needs to be solved before it can be). As soon as 0.75 is out there will also be a context beta thats in principle could give somewhat faster runs depending on what trickery is used. At the same time there will also be a luajittex update that is in sync with luatex. Luigi and I test both versions and so far no issues have been seen so in principle it can be a drop-in for those who need faster runs in production. Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] how to change the distance between two words?
On 2/6/2013 5:54 PM, Musall Maik wrote: Am 20.01.2013 um 03:42 schrieb Hongwen Qiu qiuhong...@gmail.com mailto:qiuhong...@gmail.com: On 01/20/2013 12:42 AM, 土卜皿 wrote: luatex has not been updated after executing first-setup.sh --keep, what should I do for updating Luatex? Usually, luatex get updated regularly along with ConTeXt updating. If for some reason, you want to use the latest luatex binary, you need to compile it from source code yourself. If you have difficultly compile binary from source, you can ask others to compile for you, or just wait for the binary to eventually come into the ConTeXt repo. I'm experiencing the same kpathsea/cnf.c assertion failure when doing mtxrun --script fonts --reload. ConTeXt minimals still has luatex version beta-0.74.0-2012122517, and the source code server http://foundry.supelec.fr/gf/project/luatex has been unreachable for days. if i remember right it relates to some ttf font triggering ... not sure which one but deleting it can help -- - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] how to change the distance between two words?
hi, all I am writing a doc with context in Chinese, I found that the distance between two Chinese words, and between the punctuation and word is too big, how to narrow the distance? For convenience, I attached a pdf sample. Thanks in advance! BEST REGARDS PengCZ distance.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 / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] how to change the distance between two words?
Am 19.01.2013 um 12:27 schrieb 土卜皿 pengcz.n...@gmail.com: hi, all I am writing a doc with context in Chinese, I found that the distance between two Chinese words, and between the punctuation and word is too big, how to narrow the distance? For convenience, I attached a pdf sample. Can you also send the source for your example! Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] how to change the distance between two words?
hi, Wolfgang thank you! The source in attachment! PengCZ 2013/1/19 Wolfgang Schuster wolfgang.schus...@gmail.com Am 19.01.2013 um 12:27 schrieb 土卜皿 pengcz.n...@gmail.com: hi, all I am writing a doc with context in Chinese, I found that the distance between two Chinese words, and between the punctuation and word is too big, how to narrow the distance? For convenience, I attached a pdf sample. Can you also send the source for your example! Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ distance.tex Description: TeX document ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] how to change the distance between two words?
Am 19.01.2013 um 15:56 schrieb 土卜皿 pengcz.n...@gmail.com: hi, Wolfgang thank you! The source in attachment! I would try to avoid mixing simplefonts and zhfonts because it could lead to problems. You can now try a simplefonts only solution and look if the weird spacing disappears, when the problem remains you should change the font because when I use your example with “MS Mincho” or “Adobe Song Std” the spacing is better. \usemodule[simplefonts] %\definefontfeature[default][default][onum=yes,pnum=yes] \setmainfont[TeX Gyre Pagella] % Monaco \setsansfont[TeX Gyre Heros] \setmonofont[TeX Gyre Cursor] % Monaco \setcjkmainfont[Fang Song] \setcjkmonofont[Fang Song] \setupbodyfont[9pt] \setscript[hanzi] \starttext 无线传感网络存在分布的跨区域性,随着无线传。 English font is no problem! \stoptext Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] how to change the distance between two words?
hi, wolfgang.schuster Thank you! I wanted to try Adobe Song Std, but when executing the command: mtxrun --script fonts --reload I got the error: fonts | names | adding path from OSFONTDIR: /study/context/fonts fonts | names | globbing path /study/context/fonts/**.otftexlua: ../../../source/texk/kpathsea/cnf.c:255: kpathsea_cnf_get: Assertion `kpse-program_name' failed. my versions are: context 2013.01.08 01:19 luatex: beta-0.74.0-2012122510 your versions are different? Thank you! BEST REGARDS\ PengCZ 2013/1/19 Wolfgang Schuster wolfgang.schus...@gmail.com Am 19.01.2013 um 15:56 schrieb 土卜皿 pengcz.n...@gmail.com: hi, Wolfgang thank you! The source in attachment! I would try to avoid mixing simplefonts and zhfonts because it could lead to problems. You can now try a simplefonts only solution and look if the weird spacing disappears, when the problem remains you should change the font because when I use your example with “MS Mincho” or “Adobe Song Std” the spacing is better. \usemodule[simplefonts] %\definefontfeature[default][default][onum=yes,pnum=yes] \setmainfont[TeX Gyre Pagella] % Monaco \setsansfont[TeX Gyre Heros] \setmonofont[TeX Gyre Cursor] % Monaco \setcjkmainfont[Fang Song] \setcjkmonofont[Fang Song] \setupbodyfont[9pt] \setscript[hanzi] \starttext 无线传感网络存在分布的跨区域性,随着无线传。 English font is no problem! \stoptext Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] how to change the distance between two words?
Am 19.01.2013 um 17:10 schrieb 土卜皿 pengcz.n...@gmail.com: hi, wolfgang.schuster Thank you! I wanted to try Adobe Song Std, but when executing the command: mtxrun --script fonts --reload I got the error: fonts | names | adding path from OSFONTDIR: /study/context/fonts fonts | names | globbing path /study/context/fonts/**.otftexlua: ../../../source/texk/kpathsea/cnf.c:255: kpathsea_cnf_get: Assertion `kpse-program_name' failed. my versions are: context 2013.01.08 01:19 luatex: beta-0.74.0-2012122510 your versions are different? ConTeXt: 2013.01.17 18:16 LuaTeX: beta-0.74.0-2012122517 To use Adobe Song use “Adobe Song Std Light” as name for \setcjkmainfont etc. Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] how to change the distance between two words?
2013/1/20 土卜皿 pengcz.n...@gmail.com: hi, wolfgang.schuster Thank you! I wanted to try Adobe Song Std, but when executing the command: mtxrun --script fonts --reload I got the error: fonts | names | adding path from OSFONTDIR: /study/context/fonts fonts | names | globbing path /study/context/fonts/**.otftexlua: ../../../source/texk/kpathsea/cnf.c:255: kpathsea_cnf_get: Assertion `kpse-program_name' failed. my versions are: context 2013.01.08 01:19 luatex: beta-0.74.0-2012122510 This problem has been fixed in luatex 0.75. I think wolfgang had cached those fonts so he can use them now. -- Best regards, Li Yanrui (李延瑞) ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] how to change the distance between two words?
hi, yanrui 不好意思,怎么将我的luatex版本不会自动更新,使用first-setup.sh --keep,只是更新了context的版本,怎么 更新luatex呢? 谢谢! pengcz 2013/1/20 Li Yanrui (李延瑞) liyanrui...@gmail.com 2013/1/20 土卜皿 pengcz.n...@gmail.com: hi, wolfgang.schuster Thank you! I wanted to try Adobe Song Std, but when executing the command: mtxrun --script fonts --reload I got the error: fonts | names | adding path from OSFONTDIR: /study/context/fonts fonts | names | globbing path /study/context/fonts/**.otftexlua: ../../../source/texk/kpathsea/cnf.c:255: kpathsea_cnf_get: Assertion `kpse-program_name' failed. my versions are: context 2013.01.08 01:19 luatex: beta-0.74.0-2012122510 This problem has been fixed in luatex 0.75. I think wolfgang had cached those fonts so he can use them now. -- Best regards, Li Yanrui (李延瑞) ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] how to change the distance between two words?
2013/1/20 土卜皿 pengcz.n...@gmail.com hi, Yanrui I am sorry to reply to mail list in Chinese! , luatex has not been updated after executing first-setup.sh --keep, what should I do for updating Luatex? Thanks! BEST REGARDS Pengcz 不好意思,怎么将我的luatex版本不会自动更新,使用first-setup.sh --keep,只是更新了context的版本,怎么 更新luatex呢? 谢谢! pengcz ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] how to change the distance between two words?
On 01/20/2013 12:42 AM, ??? wrote: luatex has not been updated after executing first-setup.sh --keep, what should I do for updating Luatex? Usually, luatex get updated regularly along with ConTeXt updating. If for some reason, you want to use the latest luatex binary, you need to compile it from source code yourself. If you have difficultly compile binary from source, you can ask others to compile for you, or just wait for the binary to eventually come into the ConTeXt repo. ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Count the words per line (Philipp Gesang)
Hey Huseyin, just some general advice on mailing lists: use the “reply” function of your user agent to reply. This will preserve the context for each message and allows to render them as threads as in http://www.ntg.nl/pipermail/ntg-context/2012/thread.html. Thanks! Now for your question: ···date: 2012-12-18, Tuesday···from: H. Özoguz··· Am 18.12.2012 11:17, schrieb ntg-context-requ...@ntg.nl: thanks alot! It works, one question left: What is the --silent flag, what is its effect, I tried it but could not see the difference. I was referring to the command line option. If you run context --silent my_document.tex most command line output will be suppressed, thus depending on your setup there’s a chance you won’t have to scroll up the terminal window in order to read the words per line statistics. Fyi to display some of the arguments the context runner accepts, enter context --help Hth Philipp -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments pgpniWwZZdTcp.pgp Description: PGP signature ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Count the words per line (Philipp Gesang)
Am 18.12.2012 11:17, schrieb ntg-context-requ...@ntg.nl: Usage: \usemodule[wordsperline] \starttext \startlinestats \dorecurse{42}{% \input knuth\par \input ward\par \input tufte\par \input zapf\par } \stoplinestats \stoptext (Works best with the --silent flag!) Hi Philipp, thanks alot! It works, one question left: What is the --silent flag, what is its effect, I tried it but could not see the difference. Thanks alot again, very kindly :) Best Regards Huseyin ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Count the words per line
Hey Huseyin, ···date: 2012-12-14, Friday···from: H. Özoguz··· I am setting with grid-set, and I am wondering, if there is a possibility to count the number of words in the lines (not for each single line, but in average over all lines). take a look at this: t-wordsperline.mkvi http://pastebin.com/ZjEY1w1p wordsperline.lua http://pastebin.com/YW2R97Cm Usage: \usemodule[wordsperline] \starttext \startlinestats \dorecurse{42}{% \input knuth\par \input ward\par \input tufte\par \input zapf\par } \stoplinestats \stoptext (Works best with the --silent flag!) That would be helpful to get a perfectly readably book (words per row is one of these readability-measures). That tool could ignore hyphenated words at the end of a line, or count it with 0.5, or whatever. Hyphenated words are counted as half a word on both lines so each word amounts to exactly one. This does not account for more complex horizontal material like boxes which may contain words. Also the word model is extremely simplistic, so some kinds of punctuation and effects like letter spacing can distort the values. Thus depending on the content of your document the figures might not be accurate; ymmv. (Took a bit longer because initially I planned on placing the stats in the inner and outer margin for each line. Turns out this can’t be done with simple (Lua) means in Context because it would interfere with the margin mechanism. So I had to scrap the first approach and rewrote it to display stats only at the end of the document.) Regards Philipp -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments pgpSeEEGeGKRS.pgp Description: PGP signature ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Count the words per line
I am setting with grid-set, and I am wondering, if there is a possibility to count the number of words in the lines (not for each single line, but in average over all lines). That would be helpful to get a perfectly readably book (words per row is one of these readability-measures). That tool could ignore hyphenated words at the end of a line, or count it with 0.5, or whatever. Thanks Huseyin ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Find all words set into the margin
Huseyin wrote: Is there a command like \showallmarginruns, which gives something like this: Margin runs on p. 34,67,101,145,204,298 - it may use somehow the blocks of \version[temporary], that would be perfect for me. Could I make clear, what I am looking for (sorry for my leck of English)? Yes, that is very clear. Your English is very good. I have no answer, but some pointers: * Printing these blocks is done by using the TeX primitive \overfullrule (setting it to 5pt, specifically). * Patrick Gundlach wrote a LuaTeX callback that changes the color of the \overfullrule, but it uses the post_linebreak_filter callback, and I don't know if the page number information is known yet at that point. * The log, like Luigi mentions, reports the source location of overfull hboxes. This might help you at least a bit in finding the output page. Overfull \hbox (15.80962pt too wide) in paragraph at lines 1--25 \3modern-designsize-12pt-rm-tf-0--0 par-al-lel, and| Cheers, -Sietse On Tue, Nov 27, 2012 at 8:23 AM, luigi scarso luigi.sca...@gmail.com wrote: On Tue, Nov 27, 2012 at 7:36 AM, H. Özoguz h.oezo...@mmnetz.de wrote: Am 26.11.2012 18:01, schrieb ntg-context-requ...@ntg.nl: Is there a command or a macro to find all occurences in a file (or projekt), where some word is printed into the margin? (Maybe because of bad hyphenation or something else.) - Would be perfect for manual check-up and corrections! \version[temporary] prints blocks next to lines that run into the margin. http://wiki.contextgarden.net/Command/version Is that what you're looking for? --Sietse Thanks for that! These black blocks are quite useful, but not as powerful, as I am looking for. I am looking for a command, which builds a register of all occurences of these blocks. Imagine I am working on a 300-page book, than I have to check every single page for these margin-runs (f.e. after changing the layout), with these black boxes its much easier, of course, but still a mess. Is there a command like \showallmarginruns, which gives something like this: Margin runs on p. 34,67,101,145,204,298 - it may use somehow the blocks of \version[temporary], that would be perfect for me. Could I make clear, what I am looking for (sorry for my leck of English)? Not an answer, but do you have seen the informations of the log ? ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Find all words set into the margin
On 11/27/2012 11:19 AM, Sietse Brouwer wrote: * The log, like Luigi mentions, reports the source location of overfull hboxes. This might help you at least a bit in finding the output page. Overfull \hbox (15.80962pt too wide) in paragraph at lines 1--25 \3modern-designsize-12pt-rm-tf-0--0 par-al-lel, and| i uploaded a beta with some gimmicks \starttext \showjustification \showframe {\notragged\input ward \blank} {\raggedright \input ward \blank} {\raggedleft \input ward \blank} {\raggedcenter \input ward \blank} {\hsize1cm \notragged x x xx xxx\par} \blank \framed[width=10cm,align=middle]{test} \stoptext blue: natural width is larger than hsize green: natural width is smaller than hsize magenta: natural width is smaller than hsize (raggedright) cyan: natural width is smaller than hsize (raggedleft) yellow: natural width is smaller than hsize (raggedcenter) red: probably bad news I'm pretty sure that in a year or so I've forgotten about (as I already had forgotten about some experimental early luatex code doing something similar). Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Find all words set into the margin
Am 27.11.2012 18:37, schrieb ntg-context-requ...@ntg.nl: blue: natural width is larger than hsize green: natural width is smaller than hsize magenta: natural width is smaller than hsize (raggedright) cyan: natural width is smaller than hsize (raggedleft) yellow: natural width is smaller than hsize (raggedcenter) red: probably bad news I'm pretty sure that in a year or so I've forgotten about (as I already had forgotten about some experimental early luatex code doing something similar). Thanks, thats quite nice. Is it pirincipal possible to programm this macro I am looking for, which lists all reds (in your gimmick) in a TOC with pagenumbers? (I am not asking you to do that, just curious, maybe I want to programm some macro myself one day, not only getting gifts from you and all other programmers :)) Huseyin ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Find all words set into the margin
On 11/27/2012 8:22 PM, H. Özoguz wrote: Am 27.11.2012 18:37, schrieb ntg-context-requ...@ntg.nl: blue: natural width is larger than hsize green: natural width is smaller than hsize magenta: natural width is smaller than hsize (raggedright) cyan: natural width is smaller than hsize (raggedleft) yellow: natural width is smaller than hsize (raggedcenter) red: probably bad news I'm pretty sure that in a year or so I've forgotten about (as I already had forgotten about some experimental early luatex code doing something similar). Thanks, thats quite nice. Is it pirincipal possible to programm this macro I am looking for, which lists all reds (in your gimmick) in a TOC with pagenumbers? (I am not asking you to do that, just curious, maybe I want to programm some macro myself one day, not only getting gifts from you and all other programmers :)) sure that's possible but not now (just run your docs with \setupalign[verytolerant,stretch] and you're okay in most cases) - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Find all words set into the margin
Am 27.11.2012 22:39, schrieb ntg-context-requ...@ntg.nl: (just run your docs with \setupalign[verytolerant,stretch] and you're okay in most cases) That is not possible, because I want to have very nice word-distances, and I want the margin-runs to be there, to correct them myselve manually. So for now, I will go through every single page, and look for black boxes (or in your gimmick red boxes). Thanks. Huseyin ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Find all words set into the margin
I use \definefontfeature[default][default][expansion=quality,protrusion=quality] \setupalign[hz,hanging] \usetypescript[times] \setupbodyfont[times,11pt] \setuptolerance[verystrict] Is there a command or a macro to find all occurences in a file (or projekt), where some word is printed into the margin? (Maybe because of bad hyphenation or something else.) - Would be perfect for manual check-up and corrections! Thanks. Huseyin ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Find all words set into the margin
Am 26.11.2012 18:01, schrieb ntg-context-requ...@ntg.nl: Is there a command or a macro to find all occurences in a file (or projekt), where some word is printed into the margin? (Maybe because of bad hyphenation or something else.) - Would be perfect for manual check-up and corrections! \version[temporary] prints blocks next to lines that run into the margin. http://wiki.contextgarden.net/Command/version Is that what you're looking for? --Sietse Thanks for that! These black blocks are quite useful, but not as powerful, as I am looking for. I am looking for a command, which builds a register of all occurences of these blocks. Imagine I am working on a 300-page book, than I have to check every single page for these margin-runs (f.e. after changing the layout), with these black boxes its much easier, of course, but still a mess. Is there a command like \showallmarginruns, which gives something like this: Margin runs on p. 34,67,101,145,204,298 - it may use somehow the blocks of \version[temporary], that would be perfect for me. Could I make clear, what I am looking for (sorry for my leck of English)? Thanks. Huseyin ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Find all words set into the margin
On Tue, Nov 27, 2012 at 7:36 AM, H. Özoguz h.oezo...@mmnetz.de wrote: Am 26.11.2012 18:01, schrieb ntg-context-requ...@ntg.nl: Is there a command or a macro to find all occurences in a file (or projekt), where some word is printed into the margin? (Maybe because of bad hyphenation or something else.) - Would be perfect for manual check-up and corrections! \version[temporary] prints blocks next to lines that run into the margin. http://wiki.contextgarden.net/Command/version Is that what you're looking for? --Sietse Thanks for that! These black blocks are quite useful, but not as powerful, as I am looking for. I am looking for a command, which builds a register of all occurences of these blocks. Imagine I am working on a 300-page book, than I have to check every single page for these margin-runs (f.e. after changing the layout), with these black boxes its much easier, of course, but still a mess. Is there a command like \showallmarginruns, which gives something like this: Margin runs on p. 34,67,101,145,204,298 - it may use somehow the blocks of \version[temporary], that would be perfect for me. Could I make clear, what I am looking for (sorry for my leck of English)? Not an answer, but do you have seen the informations of the log ? ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] ConTeXt: Page numbering in words for spanish
Dnia 2012-11-22, o godz. 11:55:17 Mojca Miklavec mojca.miklavec.li...@gmail.com napisał(a): On Thu, Nov 22, 2012 at 1:03 AM, Acidrums4 wrote: * 100 before 'millón' -- should that be 'cien millón', or 'ciento millón'? - It should be 'cien millones'. 'Millones', plural for 'Millón'. Maybe it should be a variable for plurals for millions (the only plural used for numbers in spanish). Singular and plural don't always suffice. 1M: en milijon 2M: dva milijona 3/4M: [tri|štiri] milijone 5M: pet milijonov Similarly for Polish (which is no surprise), so a more general mechanism might be a good idea. 1M: (jeden) milion 2/3/4M: dwa/trzy/cztery miliony 5/6/7/8/9M: pięć/sześć/siedem/osiem/dziewięć milionów 32M: trzydzieści dwa miliony 57M: pięćdziesiąt siedem milionów And similarly for thousands. Mojca Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Adam Mickiewicz University ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] ConTeXt: Page numbering in words for spanish
On 11/23/2012 9:50 PM, Marcin Borkowski wrote: Dnia 2012-11-22, o godz. 11:55:17 Mojca Miklavec mojca.miklavec.li...@gmail.com napisał(a): On Thu, Nov 22, 2012 at 1:03 AM, Acidrums4 wrote: * 100 before 'millón' -- should that be 'cien millón', or 'ciento millón'? - It should be 'cien millones'. 'Millones', plural for 'Millón'. Maybe it should be a variable for plurals for millions (the only plural used for numbers in spanish). Singular and plural don't always suffice. 1M: en milijon 2M: dva milijona 3/4M: [tri|štiri] milijone 5M: pet milijonov Similarly for Polish (which is no surprise), so a more general mechanism might be a good idea. 1M: (jeden) milion 2/3/4M: dwa/trzy/cztery miliony 5/6/7/8/9M: pięć/sześć/siedem/osiem/dziewięć milionów 32M: trzydzieści dwa miliony 57M: pięćdziesiąt siedem milionów And similarly for thousands. first we need working prototypes for several languages, then I can wrap it into some general mechanism. I think all languages are somewhat different so 'general' is 'sort of general'. - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] ConTeXt: Page numbering in words for spanish
On Fri, 23 Nov 2012 23:46:44 +0100 Hans Hagen pra...@wxs.nl wrote: first we need working prototypes for several languages, then I can wrap it into some general mechanism. I think all languages are somewhat different so 'general' is 'sort of general'. For example, in French, 1000 can be une brique, une patate or un bâton, but I guess that this is not quite the same thing as the subject of this thread... :) ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] ConTeXt: Page numbering in words for spanish
On 11/22/2012 12:47 AM, Sietse Brouwer wrote: Hi Hans, I think the verbose.spanish code you put in the latest beta broke verbose.english: after verbose.english is defined, a second `local verbose = { }` at the start of the spanish code accidentally overwrites that table. sure, it was means as standalone example (I normally test that kind of code in a lua file that i process with mtxrun - just hit a key in scite to run it) The code below works; as a bonus, it fixes the bug where 900 was so where is the dutch? Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] ConTeXt: Page numbering in words for spanish
On Thu, Nov 22, 2012 at 1:03 AM, Acidrums4 wrote: * 100 before 'millón' -- should that be 'cien millón', or 'ciento millón'? - It should be 'cien millones'. 'Millones', plural for 'Millón'. Maybe it should be a variable for plurals for millions (the only plural used for numbers in spanish). Singular and plural don't always suffice. 1M: en milijon 2M: dva milijona 3/4M: [tri|štiri] milijone 5M: pet milijonov (And then of course, if you want more fun, en milijon, enega milijona, enemu milijonu, en milijon, enem milijonu, enim milijonom, dva milijona, dveh milijonov, dvema milijonoma, dva milijona, dveh milijonih, dvema milijonoma, ...) I'm not suggesting to implement the forms (declinations) from the last paragraph, but if you want to introduce separate singular and plural forms, you might want to support more than just two forms from the start: http://www.gnu.org/savannah-checkouts/gnu/gettext/manual/html_node/Plural-forms.html Mojca ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] ConTeXt: Page numbering in words for spanish
Mojca wrote: Singular and plural don't always suffice. Yes ... I was studiously avoiding bringing that up. :-) I suppose one would end up with separate languages like es-s-m, es-s-f, es-pl-m, es-pl-f for the converter to invoke. Then es would be a synonym of the most common form (singular masculin, probably). Hans wrote: so where is the dutch? I might ask the same of you. :-P Anyway, I've written one up. I'll post it later, after I've had a chance to adapt it to the structure you lay out in the new beta. Acidrums wrote: (there's no converters.verbose in my core-con.lua) What version are you using? converters.verbose was put in on november 12. Are you using the latest beta, or the TeX Live 2012 stable version? As for the error you got: Try the new beta Hans just uploaded, Spanish conversions are working in that one. E.g. \ctxcommand{verbose(123, es)}. The bugs we discusses in a previous mail are also still in there --- I'll try to get around to them. Cheers, Sietse ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] ConTeXt: Page numbering in words for spanish
Hello there and thanks for finally let me into this mailing list! So I tried to hack the macro given in the ConTeXt wiki (http://wiki.contextgarden.net/Page_numbering_in_words) to write pagenumbering in words in spanish, my native language. Things were great until I had to reach the 100th page. ConTeXt claims when compiling, but I don't know how to fix the macro so it can write hundred-numbers. 'Cien' is 100 for spanish. 'Ciento uno' for 101, 'ciento dos' for 102 and so (You can see a more detailed example in http://spanish.about.com/cs/forbeginners/a/cardinalnum_beg.htm). So basically I need to prepend the word 'cien' for each word number from 1 to 99 to write the one-hundreds, 'doscientos' for the two-hundreds... Here is my dirty hacked version of the macro (you may save it as 'numstr.tex' for compiling), and a minimal example as follows: \input numstr \defineconversion[numstring][\numstr] \setupuserpagenumber[numberconversion=numstring] \starttext \dorecurse{100}{\recurselevel\page} \stoptext I'm such a noob with TeX and I cannot figure out how to do this, and I need this for this friday!. However, Aditya in the TeX section of StackExchange (http://tex.stackexchange.com/questions/82722/context-page-numbering-in-words- for-spanish#comment178155_82722) told me that I could do this witk Lua (editing the file core-con.lua, as seen in http://repo.or.cz/w/context.git/blob/HEAD:/tex/context/base/core-con.lua ), 'cause I'm using MkIV for doing this. But I don't know anything about Lua (seems pretty easy, but I don't know how to test the code Aditya gave me) and If I knew how to do that, I don't know how to make it work in my document... All I could do is translate the 'words' array to spanish, but I couldn't do more... Could you guys give me a hand on this? Thank you so much! ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] ConTeXt: Page numbering in words for spanish
On 11/21/2012 10:08 AM, Acidrums4 wrote: Hello there and thanks for finally let me into this mailing list! So I tried to hack the macro given in the ConTeXt wiki (http://wiki.contextgarden.net/Page_numbering_in_words) to write pagenumbering in words in spanish, my native language. Things were great until I had to reach the 100th page. ConTeXt claims when compiling, but I don't know how to fix the macro so it can write hundred-numbers. 'Cien' is 100 for spanish. 'Ciento uno' for 101, 'ciento dos' for 102 and so (You can see a more detailed example in http://spanish.about.com/cs/forbeginners/a/cardinalnum_beg.htm). So basically I need to prepend the word 'cien' for each word number from 1 to 99 to write the one-hundreds, 'doscientos' for the two-hundreds... Here is my dirty hacked version of the macro (you may save it as 'numstr.tex' for compiling), and a minimal example as follows: \input numstr \defineconversion[numstring][\numstr] \setupuserpagenumber[numberconversion=numstring] \starttext \dorecurse{100}{\recurselevel\page} \stoptext I'm such a noob with TeX and I cannot figure out how to do this, and I need this for this friday!. However, Aditya in the TeX section of StackExchange (http://tex.stackexchange.com/questions/82722/context-page-numbering-in-words- for-spanish#comment178155_82722) told me that I could do this witk Lua (editing the file core-con.lua, as seen in http://repo.or.cz/w/context.git/blob/HEAD:/tex/context/base/core-con.lua ), 'cause I'm using MkIV for doing this. But I don't know anything about Lua (seems pretty easy, but I don't know how to test the code Aditya gave me) and If I knew how to do that, I don't know how to make it work in my document... All I could do is translate the 'words' array to spanish, but I couldn't do more... Could you guys give me a hand on this? Thank you so much! We can add a converter to core-con, but you have to do the checking (and tuning): local floor = math.floor local concat = table.concat local verbose = { } local words = { [1] = uno, [2] = dos, [3] = tres, [4] = cuatro, [5] = cinco, [6] = seis, [7] = siete, [8] = ocho, [9] = nueve, [10] = diez, [11] = once, [12] = doce, [13] = trece, [14] = catorce, [15] = quince, [16] = dieciséis, [17] = diecisiete, [18] = dieciocho, [19] = diecinueve, [20] = veinte, [21] = veintiuno, [22] = veintidós, [23] = veintitrés, [24] = veinticuatro, [25] = veinticinco, [26] = veintiséis, [27] = veintisiete, [28] = veintiocho, [29] = veintinueve, [30] = treinta, [40] = cuarenta, [50] = cincuenta, [60] = sesenta, [70] = setenta, [80] = ochenta, [90] = noventa, [100] = ciento, [200] = doscientos, [300] = trescientos, [400] = cuatrocientos, [500] = quinientos, [600] = seiscientos, [700] = setecientos, [800] = ochocientos, [900] = novecientos, [1000] = mil, [1000^2] = millón, [1000^3] = millones, } function verbose.spanish(n) local w = words[n] if w then return w end local t = { } local function compose_one(n) local w = words[n] if w then t[#t+1] = w return end local a, b = floor(n/100), n % 100 if a == 10 then t[#t+1] = words[1] t[#t+1] = words[1000] elseif a 0 then -- t[#t+1] = words[a] t[#t+1] = words[100] end if words[b] then t[#t+1] = words[b] else a, b = floor(b/10), n % 10 t[#t+1] = words[a*10] t[#t+1] = y t[#t+1] = words[b] end end local function compose_two(n,m) if n (m-1) then local a, b = floor(n/m), n % m if a 0 then compose_one(a) end t[#t+1] = words[m] n = b end return n end n = compose_two(n,1000^4) n = compose_two(n,1000^3) n = compose_two(n,1000^2) n = compose_two(n,1000^1) if n 0 then compose_one(n) end return #t 0 and concat(t, ) or tostring(n) end verbose.es = verbose.spanish print(verbose.spanish(31)) print(verbose.spanish(101)) print(verbose.spanish(199)) sort of the english one with some patches (exceptions can be added to the table if needed) - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl
Re: [NTG-context] ConTeXt: Page numbering in words for spanish
Hi Acidrums, hi Hans, I worked up the code below, put it in core-con.lua, and recompiled ConTeXt with `context --make cont-en`. It gives the following output. Does it look correct? Hans: the `spanishwords` is a bit hacky; probably words should have subtables words.english and words.spanish. Cheers, Sietse 11.111.111 once millón cien once mil cien once 2.221.101 dos millón doscientos veintiuno mil cien uno 1.111 uno mil cien once 1.218 uno mil doscientos dieciocho 1.234 uno mil doscientos treinta y cuatro 12.345 doce mil trescientos cuarenta y cinco 12.345.678.900.000 doce billón trescientos cuarenta y cinco mil millones seiscientos sietenta y ocho millón novecientos mil local spanishwords = { [0] = zero, [1] = uno, [2] = dos, [3] = tres, [4] = cuatro, [5] = cinco, [6] = seis, [7] = siete, [8] = ocho, [9] = nueve, [10] = diez, [11] = once, [12] = doce, [13] = trece, [14] = catorce, [15] = quince, [16] = dieciséis, [17] = diecisiete, [18] = dieciocho, [19] = diecinueve, [20] = veinte, [21] = veintiuno, [22] = veintidós, [23] = veintitrés, [24] = veinticuatro, [25] = veinticinquo, [26] = veintiséis, [27] = veintisiete, [28] = veintiocho, [29] = veintinueve, [30] = treinta, [40] = cuarenta, [50] = cinquenta, [60] = sesenta, [70] = sietenta, [80] = ochenta, [90] = noventa, [100] = cien, [200] = doscientos, [300] = trescientos, [400] = cuatrocientos, [500] = quinientos, [600] = seiscientos, [700] = setecientos, [800] = ochocientos, [900] = novecientos, [1000] = mil, [1000^2] = millón, [1000^3] = mil millones, [1000^4] = billón, } function verbose.spanish(n) local w = spanishwords[n] if w then return w end local t = { } local function compose_one(n) local w = spanishwords[n] if w then t[#t+1] = w return end -- a, b = hundreds, remainder local a, b = floor(n/100), n % 100 -- one thousand if a == 10 then t[#t+1] = spanishwords[1] t[#t+1] = spanishwords[1000] -- x hundred (n.b. this will not give thirteen hundred because -- compose_one(n) is only called after -- `n = compose(two(n, 1000^1))`. elseif a 0 then t[#t+1] = spanishwords[a*100] end -- the remainder if spanishwords[b] then t[#t+1] = spanishwords[b] else -- a, b = tens, remainder a, b = floor(b/10), n % 10 t[#t+1] = spanishwords[a*10] t[#t+1] = y t[#t+1] = spanishwords[b] end end -- compose_two handles x billion, ... x thousand. When 1000 or less is -- left, compose_one takes over. local function compose_two(n,m) if n (m-1) then local a, b = floor(n/m), n % m if a 0 then compose_one(a) end t[#t+1] = spanishwords[m] n = b end return n end n = compose_two(n,1000^4) n = compose_two(n,1000^3) n = compose_two(n,1000^2) n = compose_two(n,1000^1) if n 0 then compose_one(n) end return #t 0 and concat(t, ) or tostring(n) end verbose.es = verbose.spanish to test the code --- \starttext \def\vbes#1% {#1\crlf \ctxcommand{verbose(#1, spanish)}} \obeylines \vbes{} \vbes{2221101} \vbes{} \vbes{1218} \vbes{1234} \vbes{12345} \vbes{1234567890} \stopcode ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] ConTeXt: Page numbering in words for spanish
On 11/21/2012 12:25 PM, Sietse Brouwer wrote: Hans: the `spanishwords` is a bit hacky; probably words should have subtables words.english and words.spanish. they are local tables ... so invisible to users Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] ConTeXt: Page numbering in words for spanish
they are local tables ... so invisible to users Fair point. I was concerned more with changeabiltity: this way someone who writes a new function has an obvious name (numberwords.french) for her new wordlist, and an obvious single point of alteration for her copy of verbose.english, namely to change `local words = numberwords.english` to `...numberwords.french`. (Algorithm tweaks will still come after that, of course.) The code needs very little changing. This is a minor point only, of course. --Sietse + local numberwords = { } - words = { + numberwords.english = { [1] = one, ... } -spanishwords = { + numberwords.spanish = { [1] = uno, ... } function verbose.english(n) +local words = allwords.english ... `words` already used throughout ... end function verbose.spanish(n) +local words = allwords.spanish -- to use a different table, no need to -- replace `spanishwords` throughout -- the function; just change the line above. ... no more `spanishwords`, just `words` ... end ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] ConTeXt: Page numbering in words for spanish
I Sietse, I tried the procedure you described without success. I'm using ConTeXt 2011 (I know, it's not the latest and etc, but I got to work with this version because compatibility with my work and I have some troubles with projects). I pasted the code you wrote at the end of core-con.lua and ran 'context --make cont-en'. But I got the following: === Begining of the output === + /usr/share/texmf-dist/tex/context/base/core-con.lua ! LuaTeX error /usr/share/texmf-dist/tex/context/base/core-con.lua:924: attempt to index global 'verbose' (a nil value) stack traceback: /usr/share/texmf-dist/tex/context/base/core-con.lua:924: in main chunk /usr/share/texmf-dist/tex/context/base/luat-cod.lua:42: in function 'registercode' main ctx instance:1: in main chunk. system tex error on line 16 in file /usr/share/texmf- dist/tex/context/base/context.mkiv: LuaTeX error ... 6 %D author=Hans Hagen, 7 %D date=\currentdate, 8 %D copyright={PRAGMA / Hans Hagen \ Ton Otten}] 9 %C 10 %C This module is part of the \CONTEXT\ macro||package and is 11 %C therefore copyrighted by \PRAGMA. See mreadme.pdf for 12 %C details. 13 14 \catcode`\{=1 \catcode`\}=2 \catcode`\#=6 15 16 %D From the next string (which is set by the script that assembles the 17 %D distribution) later on we will calculate a number that can be used 18 %D by use modules to identify the feature level. Starting with version 19 %D 2004.8.30 the low level interface is english. Watch out and adapt 20 %D your styles an modules. 21 22 \edef\contextformat {\jobname} 23 \edef\contextversion{2011.05.18 18:04} 24 25 %D For those who want to use this: 26 \registerctxluafile ...ua.registercode(#1,#2)} l.16 \registerctxluafile{core-con}{1.001} ? === End of the output === Any clue about this? Thanks! PD.: Here is the correct translation of the 'words' array (and as a gift for your effort on this, a translation for 'days' and 'months' arrays): local words = { [0] = cero, [1] = uno, [2] = dos, [3] = tres, [4] = cuatro, [5] = cinco, [6] = seis, [7] = siete, [8] = ocho, [9] = nueve, [10] = diez, [11] = once, [12] = doce, [13] = trece, [14] = catorce, [15] = quince, [16] = sixteen, [17] = seventeen, [18] = eighteen, [19] = nineteen, [20] = veinte, [30] = treinta, [40] = cuarenta, [50] = cincuenta, [60] = sesenta, [70] = setenta, [80] = ochenta, [90] = noventa, [100] = cien, [1000] = mil, [1000^2] = millón, [1000^3] = mil millones, [1000^4] = billón, } local days = { -- not variables.sunday domingo, lunes, martes, miércoles, jueves, viernes, sábado, } local months = { -- not variables.januari enero, febrero, marzo, abril, mayo, junio, julio, agosto, septiembre, octubre, noviembre, diciembre, } On Mié 21 Nov 2012 12:25:03 pm Sietse Brouwer escribió: I worked up the code below, put it in core-con.lua, and recompiled ConTeXt with `context --make cont-en`. It gives the following output. Does it look correct? ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] ConTeXt: Page numbering in words for spanish
Hi Hans, I think the verbose.spanish code you put in the latest beta broke verbose.english: after verbose.english is defined, a second `local verbose = { }` at the start of the spanish code accidentally overwrites that table. The code below works; as a bonus, it fixes the bug where 900 was printed as 'nine hundred zero'. It can replace the entire swath of verbose-related code, right up to the handlers. (The English part is mostly untouched; only that bugfix, and a tweak to use the `local words = words.english` idiom) Known bugs: * 100 before 'mil' should be 'cien mil' * 100 on its own should be 'cien' * 100 before 'millón' -- should that be 'cien millón', or 'ciento millón'? * what are the rules for e.g. '1001' -- should that be 'mil y una'? And should 1004 also be mil y cuatro? Acidrums: if you put this in core-con.lua, replacing everything between the commands.ordinal and converters.verbose function definitions, then run context --make cont-en, does the output look okay to you? Also: thank you for the day and month tables! Cheers, Sietse -- verbose numbers local verbose = { } -- verbose english local words = { } words.english = { [0] = zero, [1] = one, [2] = two, [3] = three, [4] = four, [5] = five, [6] = six, [7] = seven, [8] = eight, [9] = nine, [10] = ten, [11] = eleven, [12] = twelve, [13] = thirteen, [14] = fourteen, [15] = fifteen, [16] = sixteen, [17] = seventeen, [18] = eighteen, [19] = nineteen, [20] = twenty, [30] = thirty, [40] = forty, [50] = fifty, [60] = sixty, [70] = seventy, [80] = eighty, [90] = ninety, [100] = hundred, [1000] = thousand, [1000^2] = million, [1000^3] = billion, [1000^4] = trillion, } function verbose.english(n) local words = words.english local w = words[n] if w then return w end local t = { } local function compose_one(n) local w = words[n] if w then t[#t+1] = w return end local a, b = floor(n/100), n % 100 if a == 10 then t[#t+1] = words[1] t[#t+1] = words[1000] elseif a 0 then t[#t+1] = words[a] t[#t+1] = words[100] -- don't say 'nine hundred zero' if b == 0 then return end end if words[b] then t[#t+1] = words[b] else a, b = floor(b/10), n % 10 t[#t+1] = words[a*10] t[#t+1] = words[b] end end local function compose_two(n,m) if n (m-1) then local a, b = floor(n/m), n % m if a 0 then compose_one(a) end t[#t+1] = words[m] n = b end return n end n = compose_two(n,1000^4) n = compose_two(n,1000^3) n = compose_two(n,1000^2) n = compose_two(n,1000^1) if n 0 then compose_one(n) end return #t 0 and concat(t, ) or tostring(n) end verbose.en = verbose.english -- print(verbose.english()) -- print(verbose.english(2221101)) -- print(verbose.english()) -- print(verbose.english(1218)) -- print(verbose.english(1234)) -- print(verbose.english(12345)) -- print(verbose.english(1234567890)) -- verbose spanish (unchecked) words.spanish = { [1] = uno, [2] = dos, [3] = tres, [4] = cuatro, [5] = cinco, [6] = seis, [7] = siete, [8] = ocho, [9] = nueve, [10] = diez, [11] = once, [12] = doce, [13] = trece, [14] = catorce, [15] = quince, [16] = dieciséis, [17] = diecisiete, [18] = dieciocho, [19] = diecinueve, [20] = veinte, [21] = veintiuno, [22] = veintidós, [23] = veintitrés, [24] = veinticuatro, [25] = veinticinco, [26] = veintiséis, [27] = veintisiete, [28] = veintiocho, [29] = veintinueve, [30] = treinta, [40] = cuarenta, [50] = cincuenta, [60] = sesenta, [70] = setenta, [80] = ochenta, [90] = noventa, [100] = ciento, [200] = doscientos, [300] = trescientos, [400] = cuatrocientos, [500] = quinientos, [600] = seiscientos, [700] = setecientos, [800] = ochocientos, [900] = novecientos, [1000] = mil, [1000^2] = millón, [1000^3] = mil millónes, [1000^4] = billón, } function verbose.spanish(n) local words = words.spanish local w = words[n] if w then return w end local t = { } local function compose_one(n) local w = words[n] if w then t[#t+1] = w return end -- a, b = hundreds, remainder local a, b
Re: [NTG-context] ConTeXt: Page numbering in words for spanish
Acidrums: if you put this in core-con.lua, replacing everything between the commands.ordinal and converters.verbose function definitions, then run context --make cont-en, does the output look okay to you? Also: thank you for the day and month tables! Cheers, Sietse Just pasted the code you gave after commands.ordinal (there's no converters.verbose in my core-con.lua) and the context --make cont-en command worked. But when I tried the minimal ConTeXt example you gave, it claims with the following: === Beginning of output === ! LuaTeX error main ctx instance:1: attempt to call field 'verbose' (a nil value) stack traceback: main ctx instance:1: in main chunk. system tex error on line 7 in file prueba2.tex: LuaTeX error ... 1 \starttext 2 \def\vbes#1% 3 {#1\crlf 4 \ctxcommand{verbose(#1, spanish)}} 5 6 \obeylines 7 \vbes{} 8 \vbes{2221101} 9 \vbes{} 10 \vbes{1218} 11 \vbes{1234} 12 \vbes{12345} 13 \vbes{1234567890} 14 \stopcode \ctxcommand ...\directlua \zerocount {commands.#1} l.7 \vbes{} ? === End of output === For the bugs you're talking about, I would say this: * 100 before 'mil' should be 'cien mil' - Yes, it should be like that. * 100 on its own should be 'cien' - Same thing here. * 100 before 'millón' -- should that be 'cien millón', or 'ciento millón'? - It should be 'cien millones'. 'Millones', plural for 'Millón'. Maybe it should be a variable for plurals for millions (the only plural used for numbers in spanish). * what are the rules for e.g. '1001' -- should that be 'mil y una'? - It should be 'mil uno' (just put the '1' word after the '1000' word). And should 1004 also be mil y cuatro? - Like before, it should be 'mil cuatro': the '4' word after the '1000' word. Thank you, you're so gentle! ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Beginner question. Chapter heading in words
* looking for a place on the wiki were conversions are documented, I found http://wiki.contextgarden.net/Command/convertnumber. Seems fine. (Conversion and Conversions redirects there now.) * words and Words are now documented on that page, too. Hans: while I was there, I found a bug in the month conversion. In core-con.mkiv, the `month` conversion calls `\monthlong`, which calls the Lua command.month. But that prints the number of the current month; \monthlong should call command.monthname, instead. % core-con.mkiv, line 204 -\def\monthlong #1{\ctxcommand{month(#1)}} +\def\monthlong #1{\ctxcommand{monthname(#1)}} \def\monthshort#1{\ctxcommand{monthmnem(#1)}} Cheers, Sietse ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Beginner question. Chapter heading in words
On 10/11/12 13:43, Marco Patzer wrote: 2012-11-10 Marco Patzer: 2012-11-10 Hans Hagen: On 11/10/2012 1:38 PM, Andrew Dowell wrote: Chapter One This is the Name of the First Chapter I assume the OP was looking for a way to convert a counter to the corresponding English word: \defineconversion [words] [One, Two, Three, Four, Five] I forgot to add how to hook this into Hans' example: \defineconversion [words] [One, Two, Three, Four, Five] \setuphead [chapter] [header=high, command=\MyChapterTitle, style=\bfc, conversion=words, numberstyle=\bfb] Thanks for your quick and helpful replies Marco and Hans. I've not quite managed to get it working yet. I also forgot to mention that I wanted it A5 2up on A4. I thought I'd got that sorted using \setuppapersize [A5][A4] \setuparranging [2UP,rotated,doublesided] \setuppagenumbering [alternative=doublesided] \setuplayout [margin=0pt,width=fit] \setupbodyfont [lbr,12pt] from the manual (page 55), but on closer inspection of the output seems to scramble the chapters. My test setup has four chapters. The output labels the first chapter 'Chapter 1', the second chapter 'Chapter 4', the third chapter 'Chapter 2' and the forth chapter 'Chapter 3'. Yes I did want the chapters to be numbered as words but I can't get Marco's modification to work. It would be useful if there was a build in conversion without having to write out the words as Jamie's book has 21 chapters! I've tried various permutations including \incrementcounter [mycount] \convertedcounter [mycount] in each chapter but none of the ones I tried work. (I also tried including the dorecurse, but presume that was for testing) I'm not sure if Han's example was supposed to be a stand alone or some sort of style file. I tried running ConteXt on it but it stopped half way through. I was using the the set up suggested in the manual of having a project file, and environment file, a product file and components. That may be unnecessary complication but I thought I'd just follow the instructions till I understand it better. I put your formatting suggestions into my environment file (attached). Thanks for the suggestion of punknova Hans, it might come in sometime but Jamie wants it to look as much like a proper book as possible. He's also telling me he wants the pages arranged as sheet one side one page4 p1 side two p2 p3 sheet two side one p8 p5 side two p6 p7 etc so that the folded A4's bind next to each other, rather than in each other as the format I'm using at the moment gives. I've also attached my product, project and test component files Thanks again Andrew Marco ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ \startenvironment env2bookk \setuppapersize [A5][A4] \setuparranging [2UP,rotated,doublesided] \setuppagenumbering [alternative=doublesided] \setuplayout [margin=0pt,width=fit] \setupbodyfont [lbr,12pt] \setupheadertexts [][chapter] [\getvariable{document}{title}][] \setuppagenumbering [alternative=doublesided, location=footer] \unexpanded\def\MyChapterTitle#1#2% {\framed [offset=overlay, frame=off, width=\textwidth, align={middle,lohi}] {#1\blank#2}} \setuphead [chapter] [header=high, command=\MyChapterTitle, style=\bfc, numberstyle=\bfb] \setuplabeltext [chapter=Chapter~] \defineconversion [words] [One, Two, Three, Four, Five] \definecounter [mycount] \setupcounter [mycount] [numberconversion=words] \setuphead [chapter] [header=high, command=\MyChapterTitle, style=\bfc, conversion=words, numberstyle=\bfb] \stopenvironment \startproduct prds2 \project projbook %\component pt1 \component test4 %\component c_article_by_me % ... \stopproduct \startproject projbook %\environment envbook % only mentioned here! \environment envbookkk \product prds2 %\product prd_year2004-02 %\product prd_year2004-03 %\product prd_year2004-04 %\product tableofcontent \stopproject \startcomponent pt1 \product prds2 % but you can use it in other products anyway \project projbook %\title{Editorial} %Jamie and Dad and the Teddy Train. % Chapter One \startchapter[title=First] one \dorecurse{10}{\input ward\par} \stopchapter \startchapter[title=Second] two \dorecurse{10}{\input ward\par} \stopchapter \startchapter[title=third] three \dorecurse{10}{\input ward\par} \stopchapter
Re: [NTG-context] Beginner question. Chapter heading in words
On 10/11/12 13:43, Marco Patzer wrote: 2012-11-10 Marco Patzer: 2012-11-10 Hans Hagen: On 11/10/2012 1:38 PM, Andrew Dowell wrote: Chapter One This is the Name of the First Chapter I assume the OP was looking for a way to convert a counter to the corresponding English word: \defineconversion [words] [One, Two, Three, Four, Five] I forgot to add how to hook this into Hans' example: \defineconversion [words] [One, Two, Three, Four, Five] \setuphead [chapter] [header=high, command=\MyChapterTitle, style=\bfc, conversion=words, numberstyle=\bfb] Thanks for your quick and helpful replies Marco and Hans. I've not quite managed to get it working yet. I also forgot to mention that I wanted it A5 2up on A4. I thought I'd got that sorted using \setuppapersize [A5][A4] \setuparranging [2UP,rotated,doublesided] \setuppagenumbering [alternative=doublesided] \setuplayout [margin=0pt,width=fit] \setupbodyfont [lbr,12pt] from the manual (page 55), but on closer inspection of the output seems to scramble the chapters. My test setup has four chapters. The output labels the first chapter 'Chapter 1', the second chapter 'Chapter 4', the third chapter 'Chapter 2' and the forth chapter 'Chapter 3'. Yes I did want the chapters to be numbered as words but I can't get Marco's modification to work. It would be useful if there was a build in conversion without having to write out the words as Jamie's book has 21 chapters! I've tried various permutations including \incrementcounter [mycount] \convertedcounter [mycount] in each chapter but none of the ones I tried work. (I also tried including the dorecurse, but presume that was for testing) I'm not sure if Han's example was supposed to be a stand alone or some sort of style file. I tried running ConteXt on it but it stopped half way through. I was using the the set up suggested in the manual of having a project file, and environment file, a product file and components. That may be unnecessary complication but I thought I'd just follow the instructions till I understand it better. I put your formatting suggestions into my environment file (pasted below). Thanks for the suggestion of punknova Hans, it might come in sometime but Jamie wants it to look as much like a proper book as possible. He's also telling me he wants the pages arranged as sheet one side one page4 p1 side two p2 p3 sheet two side one p8 p5 side two p6 p7 etc so that the folded A4's bind next to each other, rather than in each other as the format I'm using at the moment gives. I've pasted my environment and test component files below (I tried attaching them but then realised the attachments Hans sent me were off list) Thanks again Andrew Here's my environment file \startenvironment env2bookk \setuppapersize [A5][A4] \setuparranging [2UP,rotated,doublesided] \setuppagenumbering [alternative=doublesided] \setuplayout [margin=0pt,width=fit] \setupbodyfont [lbr,12pt] \setupheadertexts [][chapter] [\getvariable{document}{title}][] \setuppagenumbering [alternative=doublesided, location=footer] \unexpanded\def\MyChapterTitle#1#2% {\framed [offset=overlay, frame=off, width=\textwidth, align={middle,lohi}] {#1\blank#2}} \setuphead [chapter] [header=high, command=\MyChapterTitle, style=\bfc, numberstyle=\bfb] \setuplabeltext [chapter=Chapter~] \defineconversion [words] [One, Two, Three, Four, Five] \definecounter [mycount] \setupcounter [mycount] [numberconversion=words] \setuphead [chapter] [header=high, command=\MyChapterTitle, style=\bfc, conversion=words, numberstyle=\bfb] \stopenvironment And my test component file: \startcomponent pt1 \product prds2 % but you can use it in other products anyway \project projbook \startchapter[title=First] one \dorecurse{10}{\input ward\par} \stopchapter \startchapter[title=Second] two \dorecurse{10}{\input ward\par} \stopchapter \startchapter[title=third] three \dorecurse{10}{\input ward\par} \stopchapter \startchapter[title=fourth] four \dorecurse{10}{\input ward\par} \stopchapter \stopcomponent pt1 Marco ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ ___ If your question is of interest to others as well, please add an entry
Re: [NTG-context] Beginner question. Chapter heading in words
On 11/10/2012 2:43 PM, Marco Patzer wrote: 2012-11-10 Marco Patzer: 2012-11-10 Hans Hagen: On 11/10/2012 1:38 PM, Andrew Dowell wrote: Chapter One This is the Name of the First Chapter I assume the OP was looking for a way to convert a counter to the corresponding English word: \defineconversion [words] [One, Two, Three, Four, Five] I forgot to add how to hook this into Hans' example: \defineconversion [words] [One, Two, Three, Four, Five] \setuphead [chapter] [header=high, command=\MyChapterTitle, style=\bfc, conversion=words, numberstyle=\bfb] I've added conversion=Words (and words) (currently english only) (probably needs testing) - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Beginner question. Chapter heading in words
Hi I've some experience with Latex (written a thesis in it) but have just started to try ConteXt as my son wants me to typeset a story he's written as an A5 book, and ConteXt seems to do that more easily than Latex. However, he wants the chapter headings to be on the form: Chapter One This is the Name of the First Chapter ie. with the chapter number in words, centred on the page, and then the title of the chapter centred below it. (By default it seems to do it as a numeral and then the title on the the same line) He'd also like the title of the book as the header for even pages and the title of the chapter as a header for odd side pages. I've looked through the manual but can't find obvious instructions as to how to do this. Thanks for any suggestions. Andrew ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Beginner question. Chapter heading in words
On 11/10/2012 1:38 PM, Andrew Dowell wrote: Chapter One This is the Name of the First Chapter \setuppapersize [A5] \setupheadertexts [][chapter] [\getvariable{document}{title}][] \setuppagenumbering [alternative=doublesided, location=footer] \unexpanded\def\MyChapterTitle#1#2% {\framed [offset=overlay, frame=off, width=\textwidth, align={middle,lohi}] {#1\blank#2}} \setuphead [chapter] [header=high, command=\MyChapterTitle, style=\bfc, numberstyle=\bfb] \setuplabeltext [chapter=Chapter~] \startdocument[title=MyTitle] \startchapter[title=First] \dorecurse{10}{\input ward\par} \stopchapter \startchapter[title=Second] \dorecurse{10}{\input ward\par} \stopchapter \stopdocument -- - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Beginner question. Chapter heading in words
Maybe add \setupbodyfont [punknova] Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Beginner question. Chapter heading in words
2012-11-10 Hans Hagen: On 11/10/2012 1:38 PM, Andrew Dowell wrote: Chapter One This is the Name of the First Chapter I assume the OP was looking for a way to convert a counter to the corresponding English word: \defineconversion [words] [One, Two, Three, Four, Five] \definecounter [mycount] \setupcounter [mycount] [numberconversion=words] \starttext \dorecurse{5}{%% \incrementcounter [mycount] \convertedcounter [mycount]} \stoptext Maybe there is a conversion built-in that does this automatically without having to define the words yourself. Marco ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Beginner question. Chapter heading in words
2012-11-10 Marco Patzer: 2012-11-10 Hans Hagen: On 11/10/2012 1:38 PM, Andrew Dowell wrote: Chapter One This is the Name of the First Chapter I assume the OP was looking for a way to convert a counter to the corresponding English word: \defineconversion [words] [One, Two, Three, Four, Five] I forgot to add how to hook this into Hans' example: \defineconversion [words] [One, Two, Three, Four, Five] \setuphead [chapter] [header=high, command=\MyChapterTitle, style=\bfc, conversion=words, numberstyle=\bfb] Marco ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] \definehighlight + \words | \WORDS
Dear listmates, I rely on automated uppercasing and lowercasing a lot and I’m very happy with the \words and \WORD macros. But I can’t find a way to properly combine them with the “style” parameter of highlights: it breaks frames and enumerations. Example: \definehighlight [tolower] [style=\words,] %%% This is problematic. \def\mylower#1{\bgroup\words#1\egroup} %%% The command itself %%% works, though. \starttext FOO \tolower{FOO} FOO\par %%% Works. \framed{BAR \mylower{BAR} BAR}%%% Works. \framed{BAR \tolower{BAR} BAR}%%% Fails. \startitemize %%% Enumerations don’t work either. \item FOO \mylower{FOO} FOO %%% Works. \item FOO \tolower{FOO} FOO %%% Fails. \stopitemize \stoptext In short: while I can always wrap it in a \def, the more elegant doesn’t work in all cases. Is there anything wrong with my approach? Best regards Philipp pgpNgAKRut2wp.pgp Description: PGP signature ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] \definehighlight + \words | \WORDS
Am 08.05.2012 um 10:35 schrieb Philipp Gesang: Dear listmates, I rely on automated uppercasing and lowercasing a lot and I’m very happy with the \words and \WORD macros. But I can’t find a way to properly combine them with the “style” parameter of highlights: it breaks frames and enumerations. Example: \definehighlight [tolower] [style=\words,] %%% This is problematic. \def\mylower#1{\bgroup\words#1\egroup} %%% The command itself %%% works, though. \starttext FOO \tolower{FOO} FOO\par %%% Works. \framed{BAR \mylower{BAR} BAR}%%% Works. \framed{BAR \tolower{BAR} BAR}%%% Fails. \startitemize %%% Enumerations don’t work either. \item FOO \mylower{FOO} FOO %%% Works. \item FOO \tolower{FOO} FOO %%% Fails. \stopitemize \stoptext In short: while I can always wrap it in a \def, the more elegant doesn’t work in all cases. Is there anything wrong with my approach? You can use \definehighlight [tolower] [style={\setcharactercasing[2]}] to create the \tolower command. Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] \definehighlight + \words | \WORDS
On 2012-05-08 11:07, Wolfgang Schuster wrote: Am 08.05.2012 um 10:35 schrieb Philipp Gesang: Dear listmates, I rely on automated uppercasing and lowercasing a lot and I’m very happy with the \words and \WORD macros. But I can’t find a way to properly combine them with the “style” parameter of highlights: it breaks frames and enumerations. Example: \definehighlight [tolower] [style=\words,] %%% This is problematic. \def\mylower#1{\bgroup\words#1\egroup} %%% The command itself %%% works, though. \starttext FOO \tolower{FOO} FOO\par %%% Works. \framed{BAR \mylower{BAR} BAR}%%% Works. \framed{BAR \tolower{BAR} BAR}%%% Fails. \startitemize %%% Enumerations don’t work either. \item FOO \mylower{FOO} FOO %%% Works. \item FOO \tolower{FOO} FOO %%% Fails. \stopitemize \stoptext In short: while I can always wrap it in a \def, the more elegant doesn’t work in all cases. Is there anything wrong with my approach? You can use \definehighlight [tolower] [style={\setcharactercasing[2]}] to create the \tolower command. Perfect, thanks a lot. So it was caused by the \groupedcommand in the definition of \word. Philipp Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments pgpM5YJabR3Ne.pgp Description: PGP signature ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] \definehighlight + \words | \WORDS
On 8-5-2012 11:18, Philipp Gesang wrote: On 2012-05-08 11:07, Wolfgang Schuster wrote: Am 08.05.2012 um 10:35 schrieb Philipp Gesang: Dear listmates, I rely on automated uppercasing and lowercasing a lot and I’m very happy with the \words and \WORD macros. But I can’t find a way to properly combine them with the “style” parameter of highlights: it breaks frames and enumerations. Example: \definehighlight [tolower] [style=\words,] %%% This is problematic. \def\mylower#1{\bgroup\words#1\egroup} %%% The command itself %%% works, though. \starttext FOO \tolower{FOO} FOO\par %%% Works. \framed{BAR \mylower{BAR} BAR}%%% Works. \framed{BAR \tolower{BAR} BAR}%%% Fails. \startitemize %%% Enumerations don’t work either. \item FOO \mylower{FOO} FOO %%% Works. \item FOO \tolower{FOO} FOO %%% Fails. \stopitemize \stoptext In short: while I can always wrap it in a \def, the more elegant doesn’t work in all cases. Is there anything wrong with my approach? You can use \definehighlight [tolower] [style={\setcharactercasing[2]}] to create the \tolower command. Perfect, thanks a lot. So it was caused by the \groupedcommand in the definition of \word. The next version will support named casing: WORD word Word Words capitals cap Capitals Cap none random - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] \definehighlight + \words | \WORDS
Am 08.05.2012 um 13:17 schrieb Hans Hagen: On 8-5-2012 11:18, Philipp Gesang wrote: On 2012-05-08 11:07, Wolfgang Schuster wrote: Am 08.05.2012 um 10:35 schrieb Philipp Gesang: Dear listmates, I rely on automated uppercasing and lowercasing a lot and I’m very happy with the \words and \WORD macros. But I can’t find a way to properly combine them with the “style” parameter of highlights: it breaks frames and enumerations. Example: \definehighlight [tolower] [style=\words,] %%% This is problematic. \def\mylower#1{\bgroup\words#1\egroup} %%% The command itself %%% works, though. \starttext FOO \tolower{FOO} FOO\par %%% Works. \framed{BAR \mylower{BAR} BAR}%%% Works. \framed{BAR \tolower{BAR} BAR}%%% Fails. \startitemize %%% Enumerations don’t work either. \item FOO \mylower{FOO} FOO %%% Works. \item FOO \tolower{FOO} FOO %%% Fails. \stopitemize \stoptext In short: while I can always wrap it in a \def, the more elegant doesn’t work in all cases. Is there anything wrong with my approach? You can use \definehighlight [tolower] [style={\setcharactercasing[2]}] to create the \tolower command. Perfect, thanks a lot. So it was caused by the \groupedcommand in the definition of \word. The next version will support named casing: WORD word Word Words capitals cap Capitals Cap none random It would be also useful to change the following line in font-pre.mkiv to use \setcharacterchasing instead of \WORD (won’t work anymore when you remove \groupedcommand from the \WORD as written in the comments in typo-cap.mkiv) \definealternativestyle [\v!WORD] [\WORD][\WORD] Additional entries for \word, Words etc. in font-pre.mkvi are useful as well because “style=word” looks better than “style={\setcharacterchasing[word]}”. Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] \definehighlight + \words | \WORDS
On 2012-05-08 13:28, Wolfgang Schuster wrote: It would be also useful to change the following line in font-pre.mkiv to use \setcharacterchasing instead of \WORD (won’t work anymore when you remove \groupedcommand from the \WORD as written in the comments in typo-cap.mkiv) \definealternativestyle [\v!WORD] [\WORD][\WORD] Additional entries for \word, Words etc. in font-pre.mkvi are useful as well because “style=word” looks better than “style={\setcharacterchasing[word]}”. Seconded. That would be of great value and at least I will use it very often. philipp Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments pgpLbnSpVMsYk.pgp Description: PGP signature ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] \definehighlight + \words | \WORDS
On 8-5-2012 13:28, Wolfgang Schuster wrote: The next version will support named casing: WORD word Word Words capitals cap Capitals Cap none random It would be also useful to change the following line in font-pre.mkiv to use \setcharacterchasing instead of \WORD (won’t work anymore when you remove \groupedcommand from the \WORD as written in the comments in typo-cap.mkiv) \definealternativestyle [\v!WORD] [\WORD][\WORD] Additional entries for \word, Words etc. in font-pre.mkvi are useful as well because “style=word” looks better than “style={\setcharacterchasing[word]}”. I had been thinking about a 'vector' key (in addition to style) but that's a bit of work as we then need to provide some *vectore variants as well and integrate it in the style/color switching helpers which is ab it of work but anyhow, it doesn't hurt to have them as alternative styles so you can test it later today (making a beta) Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] extracting word count from a *.words file
Hello all, Here is another question. Consider this test file: \starttext \setupspellchecking[state=start,method=2] \ctxlua{languages.words.threshold=3} \input knuth \stoptext Typesetting this file produces a word list 'test.words' which ends like this: [threshold]=1, [total]=122, [version]=1, } Is there a way to extract the value for [total] ('122' in this case) so that I can use that value somewhere else, e.g. in a project file where I want to present a word count. Thanks for a pointer! Jelle ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] extracting word count from a *.words file
Hi again, On 2012-04-20 16:32, Jelle Huisman wrote: Hello all, Here is another question. Consider this test file: \starttext \setupspellchecking[state=start,method=2] \ctxlua{languages.words.threshold=3} \input knuth \stoptext Typesetting this file produces a word list 'test.words' which ends like this: [threshold]=1, [total]=122, [version]=1, } Is there a way to extract the value for [total] ('122' in this case) so that I can use that value somewhere else, e.g. in a project file where I want to present a word count. The “.words”-file is well formed Lua code, so you can just integrate it as a table: \define\wordcount{%%% Displays word count. This document consists of \startluacode local data = dofile\jobname.words %% Load data of _previous_ pass context(data.total) %% access the requested field \stopluacode \space words.% } \starttext \setupspellchecking[state=start,method=2] \ctxlua{languages.words.threshold=3} \input knuth \hairline \wordcount %% call to the macro \stoptext Thanks for a pointer! Thanks as well, btw, I didn’t know the word count facility yet! Philipp Jelle ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments pgpjWSl4cFMhN.pgp Description: PGP signature ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] extracting word count from a *.words file
On 2012-04-20 Jelle Huisman je...@jhnet.nl wrote: Is there a way to extract the value for [total] ('122' in this case) so that I can use that value somewhere else, e.g. in a project file where I want to present a word count. I used the word count some time ago. Here's the code I used. I have no idea what has changed since and if it still works. \startluacode userdata = userdata or { } function userdata.wordcount(listname) filename = file.addsuffix(tex.jobname,words) if lfs.isfile(filename) then local w = dofile(filename) if w then if type(w.categories[listname]) == table then context(w.categories[listname].total) else context(w.total) end context.par() end end end \stopluacode \def\wordcount{% \dosingleempty\dowordcount} \def\dowordcount[#1]{% \ctxlua{userdata.wordcount(#1)}} \starttext % Set up the word count \ctxlua{languages.words.threshold=2} \setupspellchecking [state=start, method=2] \setupspellchecking [list=foo] \startsection [title=Foo] Foo Bar \stopsection \setupspellchecking [list=lorem] \startsection [title=Lorem] Lorem ipsum dolor sit \stopsection \setupspellchecking [list=stop] \startsubject [title=Statistics] Words in Foo: \wordcount [foo] Words in Lorem: \wordcount [lorem] \stopsubject \stoptext Marco ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] extracting word count from a *.words file
On 04/20/2012 04:52 PM, Marco wrote: On 2012-04-20 Jelle Huisman je...@jhnet.nl wrote: Is there a way to extract the value for [total] ('122' in this case) so that I can use that value somewhere else, e.g. in a project file where I want to present a word count. I used the word count some time ago. Here's the code I used. I have no idea what has changed since and if it still works. Marco, It looks like the code still works, thanks for sharing it. Jelle ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] extracting word count from a *.words file
On 04/20/2012 04:53 PM, Philipp Gesang wrote: Hi again, On 2012-04-20 16:32, Jelle Huisman wrote: Hello all, Here is another question. Consider this test file: \starttext \setupspellchecking[state=start,method=2] \ctxlua{languages.words.threshold=3} \input knuth \stoptext Typesetting this file produces a word list 'test.words' which ends like this: [threshold]=1, [total]=122, [version]=1, } Is there a way to extract the value for [total] ('122' in this case) so that I can use that value somewhere else, e.g. in a project file where I want to present a word count. The “.words”-file is well formed Lua code, so you can just integrate it as a table: Thank you, Philip, this is a clean solution. Jelle ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___