Re: [NTG-context] font problems
Hans, thanks you for the solution to my font problem. I appreciate it. I'm trying to understand the definefont command you used and it seems that the arguments 'sa 1' in the macro is a size indication somewhat similar to 'at 10pt' but uses a relative size parameter as opposed to the absolute pt value. That the numeric argument after 'sa' is a multiple of the current font size. Thank you - Hans Hagen via ntg-context wrote: > On 11/26/2021 12:59 PM, jdh via ntg-context wrote: > > Here's my MWE: > > Objective is to typeset a Chancery font text in the upper lefthand > > side of a page, and > > then do the main body in some normal font. Then at the very last > > print a sign off in > > Chancery. For some reason I can't get both to print out as > > Chancery. Only one or the > > other, but not both. > > > > > > \definefontfamily [mwetest] [sans] [Liberation Sans] > > \setupbodyfont [mwe,ss,12pt] > > \definelayer[mwe][repeat=yes, preset=lefttop, hoffset=.125in, > > voffset=.125in] > > \setlayer[mwe] { \switchtobodyfont[chancery,8pt] \hskip 5mm Chancery > > Font Here } > > \setupbackgrounds[page][background=mwe] > > > > \starttext > > Normal font text goes here. \blank[4*big] > > { \switchtobodyfont[chancery] This should be Chancery here to. > > But isn't. } > > \blank[2*big]Note that if I comment out the \type{setlayer[mwe]} in > > the source file, then the above will print in Chancery. > > \stoptext > > > > > > I'd like to have the layers in Chancery font and then one last text string > > in the body in Chancery font. But I can't get them both to be Chancery. > > How can that be done? > chancery is not really a full bodyfont > > \definefont[MyChancery][texgyrechorus-mediumitalic*default sa 1] > \definefont[MyChanceryBold][texgyrechorus-mediumitalic*default,boldened-20 > sa 1] > > {\MyChancery test} > {\MyChanceryBold test} > > > > - > 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 > ___ ___ 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] Math prime issues for some fonts
Hi Jack, I've been working with Hans on math in general and primes in particular in the last week. I do not understand all the details, but I think primes are handled differently now, and that one essentially need to have some tuning in goodie files (the reason is that they are done differently in different fonts, and that there was not simple one-fits-all solution). We have not touched eulernova yet. In any case, if you replace euler-math.lfg and type-imp-euler.mkiv in ConTeXt-lmtx/tex/texmf-context/tex/context/fonts/mkiv/ with the attached files, I think at least the primes should look OK (you could experiment with the values in euler-math.lfg). The sample file \setupbodyfont[eulernova] \starttext \m{x'(t)f'(x)f''(x)e^{f'(x)}} \stoptext looks OK here. /Mikael On Fri, Nov 26, 2021 at 7:54 PM Jack Hill via ntg-context wrote: > > On Fri, 26 Nov 2021 at 17:39, Wolfgang Schuster > wrote: > > > > Jack Hill via ntg-context schrieb am 26.11.2021 um 18:18: > > > Hi list, > > > > > > When I run this test code > > > > > > \definefontfamily[trm][math][tex gyre termes math] > > > \definefontfamily[pag][math][tex gyre pagella math] > > > \definefontfamily[bon][math][tex gyre bonum math] > > > \definefontfamily[sch][math][tex gyre schola math] > > > \definefontfamily[stx][math][stix two math] > > > \starttext > > > \starttabulate[|c|c|] > > > \FL > > > \NC \bf Font name \NC \bf Math prime \NR > > > \ML > > > \NC Latin modern \NC \m{x'} \NR > > > \NC Termes \NC \switchtobodyfont[trm] \m{x'} \NR > > > \NC Pagella \NC \switchtobodyfont[pag] \m{x'} \NR > > > \NC Bonum \NC \switchtobodyfont[bon] \m{x'} \NR > > > \NC Schola \NC \switchtobodyfont[sch] \m{x'} \NR > > > \NC Stix \NC \switchtobodyfont[stx] \m{x'} \NR > > > \BL > > > \stoptabulate > > > \stoptext > > > > > > on my machine, the prime symbols are being placed too high (except for > > > latin modern which is normal). > > > Running the same code on the wiki gives the correct output though. > > > Does anyone else get the same output? Screenshot attached. > > > > Use \definetypeface to load/set the math fonts. > > > > \starttext > > > > \starttabulate[|l|c|] > > \FL > > \BC Font name \BC Math prime\NC\NR > > \ML > > \NC Latin Modern Roman \NC\m{x'} \NC\NR > > \NC TeX Gyre Termes\NC \switchtobodyfont[termes] \m{x'} \NC\NR > > \NC TeX Gyre Pagella \NC \switchtobodyfont[pagella] \m{x'} \NC\NR > > \NC TeX Gyre Bonum \NC \switchtobodyfont[bonum] \m{x'} \NC\NR > > \NC TeX Gyre Schola\NC \switchtobodyfont[schola] \m{x'} \NC\NR > > \NC STIX Two \NC \switchtobodyfont[stixtwo] \m{x'} \NC\NR > > \BL > > \stoptabulate > > > > \stoptext > > > > Wolfgang > > Thanks, \definetypeface fixes it. Should I not be using \definefontfamily? > I've just checked eulernova and the prime is still too high for this font. > > \switchtobodyfont[eulernova] > \starttext > \m{x'} > \stoptext > ___ > 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 > ___ euler-math.lfg Description: Binary data type-imp-euler.mkiv Description: Binary data ___ 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] Math prime issues for some fonts
On Fri, 26 Nov 2021 at 17:39, Wolfgang Schuster wrote: > > Jack Hill via ntg-context schrieb am 26.11.2021 um 18:18: > > Hi list, > > > > When I run this test code > > > > \definefontfamily[trm][math][tex gyre termes math] > > \definefontfamily[pag][math][tex gyre pagella math] > > \definefontfamily[bon][math][tex gyre bonum math] > > \definefontfamily[sch][math][tex gyre schola math] > > \definefontfamily[stx][math][stix two math] > > \starttext > > \starttabulate[|c|c|] > > \FL > > \NC \bf Font name \NC \bf Math prime \NR > > \ML > > \NC Latin modern \NC \m{x'} \NR > > \NC Termes \NC \switchtobodyfont[trm] \m{x'} \NR > > \NC Pagella \NC \switchtobodyfont[pag] \m{x'} \NR > > \NC Bonum \NC \switchtobodyfont[bon] \m{x'} \NR > > \NC Schola \NC \switchtobodyfont[sch] \m{x'} \NR > > \NC Stix \NC \switchtobodyfont[stx] \m{x'} \NR > > \BL > > \stoptabulate > > \stoptext > > > > on my machine, the prime symbols are being placed too high (except for > > latin modern which is normal). > > Running the same code on the wiki gives the correct output though. > > Does anyone else get the same output? Screenshot attached. > > Use \definetypeface to load/set the math fonts. > > \starttext > > \starttabulate[|l|c|] > \FL > \BC Font name \BC Math prime\NC\NR > \ML > \NC Latin Modern Roman \NC\m{x'} \NC\NR > \NC TeX Gyre Termes\NC \switchtobodyfont[termes] \m{x'} \NC\NR > \NC TeX Gyre Pagella \NC \switchtobodyfont[pagella] \m{x'} \NC\NR > \NC TeX Gyre Bonum \NC \switchtobodyfont[bonum] \m{x'} \NC\NR > \NC TeX Gyre Schola\NC \switchtobodyfont[schola] \m{x'} \NC\NR > \NC STIX Two \NC \switchtobodyfont[stixtwo] \m{x'} \NC\NR > \BL > \stoptabulate > > \stoptext > > Wolfgang Thanks, \definetypeface fixes it. Should I not be using \definefontfamily? I've just checked eulernova and the prime is still too high for this font. \switchtobodyfont[eulernova] \starttext \m{x'} \stoptext ___ 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] Math prime issues for some fonts
Jack Hill via ntg-context schrieb am 26.11.2021 um 18:18: Hi list, When I run this test code \definefontfamily[trm][math][tex gyre termes math] \definefontfamily[pag][math][tex gyre pagella math] \definefontfamily[bon][math][tex gyre bonum math] \definefontfamily[sch][math][tex gyre schola math] \definefontfamily[stx][math][stix two math] \starttext \starttabulate[|c|c|] \FL \NC \bf Font name \NC \bf Math prime \NR \ML \NC Latin modern \NC \m{x'} \NR \NC Termes \NC \switchtobodyfont[trm] \m{x'} \NR \NC Pagella \NC \switchtobodyfont[pag] \m{x'} \NR \NC Bonum \NC \switchtobodyfont[bon] \m{x'} \NR \NC Schola \NC \switchtobodyfont[sch] \m{x'} \NR \NC Stix \NC \switchtobodyfont[stx] \m{x'} \NR \BL \stoptabulate \stoptext on my machine, the prime symbols are being placed too high (except for latin modern which is normal). Running the same code on the wiki gives the correct output though. Does anyone else get the same output? Screenshot attached. Use \definetypeface to load/set the math fonts. \starttext \starttabulate[|l|c|] \FL \BC Font name \BC Math prime\NC\NR \ML \NC Latin Modern Roman \NC\m{x'} \NC\NR \NC TeX Gyre Termes\NC \switchtobodyfont[termes] \m{x'} \NC\NR \NC TeX Gyre Pagella \NC \switchtobodyfont[pagella] \m{x'} \NC\NR \NC TeX Gyre Bonum \NC \switchtobodyfont[bonum] \m{x'} \NC\NR \NC TeX Gyre Schola\NC \switchtobodyfont[schola] \m{x'} \NC\NR \NC STIX Two \NC \switchtobodyfont[stixtwo] \m{x'} \NC\NR \BL \stoptabulate \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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Math prime issues for some fonts
Hi list, When I run this test code \definefontfamily[trm][math][tex gyre termes math] \definefontfamily[pag][math][tex gyre pagella math] \definefontfamily[bon][math][tex gyre bonum math] \definefontfamily[sch][math][tex gyre schola math] \definefontfamily[stx][math][stix two math] \starttext \starttabulate[|c|c|] \FL \NC \bf Font name \NC \bf Math prime \NR \ML \NC Latin modern \NC \m{x'} \NR \NC Termes \NC \switchtobodyfont[trm] \m{x'} \NR \NC Pagella \NC \switchtobodyfont[pag] \m{x'} \NR \NC Bonum \NC \switchtobodyfont[bon] \m{x'} \NR \NC Schola \NC \switchtobodyfont[sch] \m{x'} \NR \NC Stix \NC \switchtobodyfont[stx] \m{x'} \NR \BL \stoptabulate \stoptext on my machine, the prime symbols are being placed too high (except for latin modern which is normal). Running the same code on the wiki gives the correct output though. Does anyone else get the same output? Screenshot attached. Jack ___ 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] Checking for a Unicode prefix of a Unicode string
Thanks! Invoking string.find(str,"^"..pre) is certainly much easier. This sort of thing would be a nice general-purpose helper function. Denis Maier and I should have a "wish list" of desired helpers and features (mostly related to bibliographies/publication support) ready for you (and Alan) sometime soon. But for now, it looks like I still need to work out errors that arise when I pass a macro as the "str" input to be searched. I've defined a \loc macro that accepts an assignment and outputs a formatted string, and later, I want to check if this macro (after it has been fully expanded) starts with a certain prefix. A minimal (non-)working example follows: ``` \starttexdefinition loc [#1] \doifassignmentelse{#1} { % if an assignment, then parse and format accordingly \getparameters[loc][#1] % Was a section number specified? \doifdefined{locsec} { § \locsec\btxcomma } } { % otherwise, just print the input as-is #1 } \stoptexdefinition \def\DoIfPrefixElse#1#2{\ctxlua{commands.doifelse(string.find("#2","^".."#1"))}} \def\currentbtxloctext{\loc[sec=31]} \starttext \DoIfPrefixElse{§}{\currentbtxloctext}{YES}{NOP} \stoptext ``` Lua is throwing an "invalid escape sequence near '"\l'" error, which is presumably because the macro \loc[sec=31] is not being expanded. How do I fix this? Thanks! Joey On Fri, Nov 26, 2021 at 3:46 AM Hans Hagen via ntg-context < ntg-context@ntg.nl> wrote: > On 11/26/2021 7:42 AM, Joey McCollum via ntg-context wrote: > > I wasn't aware of a general-purpose "doifstartswith" macro in ConTeXt > > (the \doifnextcharelse macro only works one character at a time, and the > > \doifinstring macros may capture substrings that are not prefixes), and > > I'd like to develop one for something I'm working on. I've been trying > > to do this in Lua, as that seemed like the most natural approach. > > Normally, something like this would work fine as a foundation: > > > > ``` > >function isprefix(prefix, str) > > if string.sub(str, 1, string.len(prefix)) == prefix then > >return true > > end > > return false > >end > > ``` > > how about > > if string.find(str,"^"..prefix) then > > in: > > \starttext > > > \def\DoIfPrefixElse#1#2{\ctxlua{commands.doifelse(string.find("#2","^".."#1"))}} > > \DoIfPrefixElse{pre}{prefix}{YES}{NOP} > \DoIfPrefixElse{pre}{suffix}{YES}{NOP} > > \stoptext > > utf strings are just sequences of bytes so matching works > > when you want to do more in lua you can decide for > > \startluacode > interfaces.implement { > name = "DoIfPrefixElse", > arguments = { "argument", "argument" }, > actions = function(pre,str) > commands.doifelse(string.find(str,"^"..pre)) > end > } > \stopluacode > > \DoIfPrefixElse{pre}{prefix}{YES}{NOP} > \DoIfPrefixElse{pre}{suffix}{YES}{NOP} > > but in any case: make sure that you don't clash with built in ... > > if needed i can make a set of fast(er) ones but someone has to collect a > list of 'handy helpers' first > > 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 > > ___ > ___ 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] Concerning dictionaries. glossaries and related in ConTeXt
Nice. Looks interesting and, if I understand correctly, entries are open-ended, which turns out to be useful to customize dictionaries. It would be a profitable addition! Thank you very much. Regards, Jairo El vie, 26 de nov. de 2021 a la(s) 08:16, Hans Hagen via ntg-context ( ntg-context@ntg.nl) escribió: > Hi, > > kind of like this but maybe we need to go setups as we do with lists and > sections adn 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 > > ___ > ___ 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] Concerning dictionaries. glossaries and related in ConTeXt
Hi, kind of like this but maybe we need to go setups as we do with lists and sections adn 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 -\pushoverloadmode \unprotect \newconditional\c_strc_registers_traditional \settrue\c_strc_registers_traditional \permanent\protected\def\startregisterentry#1% todo: level {\typo_injectors_check_register \begingroup \dostarttagged\t!registerentry\empty \global\setconstant\c_strc_registers_page_state\zerocount \ifconditional\c_strc_registers_traditional \hangindent\d_strc_registers_hangindent \hangafter \c_strc_registers_hangafter \else \namedregisterparameter\currentnestedregister\c!left\relax \fi \typo_injectors_mark_register} \permanent\protected\def\stopregisterentry {\ifconditional\c_strc_registers_traditional \endgraf \else \namedregisterparameter\currentnestedregister\c!right\relax \fi \global\setconstant\c_strc_registers_page_state\zerocount \dostoptagged \endgroup} \permanent\protected\def\usenestedregisterstyleandcolor#1#2% will change {\useregisterstyleandcolor#1#2% % how about style \ifconditional\c_strc_registers_text_interaction \ifempty\currentcolorparameter \else \resetinteractionparameter\c!color \resetinteractionparameter\c!contrastcolor \fi \fi} \permanent\protected\def\startregisterentries#1% depth {\ifconditional\c_strc_registers_traditional \endgraf \fi \begingroup \c_strc_register_level\ifnum#1>\c_strc_registers_maxlevel\c_strc_registers_maxlevel\else#1\fi\relax \dostarttagged\t!registerentries\empty \pushmacro\currentregister % bah \edef\currentregister{\currentregister:\number\c_strc_register_level}% \let\currentnestedregister\currentregister \usenestedregisterstyleandcolor\c!textstyle\c!textcolor \ifnum\c_strc_register_level>\plusone \advance\leftskip\d_strc_registers_distance\relax \fi \d_strc_registers_hangindent\registerparameter\c!distance\relax \c_strc_registers_hangafter \plusone \ifconditional\c_strc_registers_traditional \blank[\v!samepage]% \fi \popmacro\currentregister} \def\c!textalternative{textalternative} \appendtoks \doifelse{\registerparameter\c!textalternative}\v!horizontal \setfalse\settrue\c_strc_registers_traditional \to \everysetupregister \protect \popoverloadmode \starttext \mainlanguage[es] \enableexperiments[fonts.compact] \setupbodyfont[dejavu] % computer-modern-unicode] \setuphead[chapter] [alternative=middle] \defineregister[Russian] \setupregister[Russian] [expansion=yes, balance=no, n=2, command=\Words, pagenumber=no, language=ru] \def\Ruso[#1]% {\begingroup \getdummyparameters [word=, category=, meaning=, #1]% \setregisterentry [Russian] [keys={\dummyparameter{word}}, entries:1={\dummyparameter{word}}, entries:2={\dummyparameter{category}}, entries:3={\dummyparameter{meaning}}]% \endgroup} \setupregister [Russian] [textalternative=horizontal, distance=0pt] \setupregister [Russian][2] [distance=0pt, textstyle=bold, left={, }] \setupregister [Russian][3] [distance=0pt, textstyle=italic, left={, }] \starttext \Ruso [word=исчисление, category=n. neutr., meaning=cálculo] \Ruso [word=вероятность, category=n. fem., meaning=probabilidad] \Ruso [word=обозначать, category=v., meaning=denotar] \Ruso [word=область, category=n. fem, meaning={región, área}] \Ruso [word=событие, category=n. neutr., meaning=evento] \Ruso [word=определение, category=n. neutr., meaning=definición] \Ruso [word=знание, category=n. neutr,, meaning=conocimiento] \Ruso [word=бесконечно, category=adv., meaning=infinitamente] \Ruso [word=сборник, category=n. masc., meaning={colección, compilación, compendio}] \Ruso [word=неравенство, category=n. neutr., meaning=desigualdad] \starttitle[title=Ruso-español] \placeRussian \stoptitle \stoptext ___ 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] font problems
On 11/26/2021 12:59 PM, jdh via ntg-context wrote: Here's my MWE: Objective is to typeset a Chancery font text in the upper lefthand side of a page, and then do the main body in some normal font. Then at the very last print a sign off in Chancery. For some reason I can't get both to print out as Chancery. Only one or the other, but not both. \definefontfamily [mwetest] [sans] [Liberation Sans] \setupbodyfont [mwe,ss,12pt] \definelayer[mwe][repeat=yes, preset=lefttop, hoffset=.125in, voffset=.125in] \setlayer[mwe] { \switchtobodyfont[chancery,8pt] \hskip 5mm Chancery Font Here } \setupbackgrounds[page][background=mwe] \starttext Normal font text goes here. \blank[4*big] { \switchtobodyfont[chancery] This should be Chancery here to. But isn't. } \blank[2*big]Note that if I comment out the \type{setlayer[mwe]} in the source file, then the above will print in Chancery. \stoptext I'd like to have the layers in Chancery font and then one last text string in the body in Chancery font. But I can't get them both to be Chancery. How can that be done? chancery is not really a full bodyfont \definefont[MyChancery][texgyrechorus-mediumitalic*default sa 1] \definefont[MyChanceryBold][texgyrechorus-mediumitalic*default,boldened-20 sa 1] {\MyChancery test} {\MyChanceryBold test} - 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] Concerning dictionaries. glossaries and related in ConTeXt
On 11/26/2021 12:22 PM, Jairo A. del Rio via ntg-context wrote: Hi, list. I want to know how I should handle alphabetically sorted data in ConTeXt. So far, I'm abusing registers in order to get simple glossaries, but I prefer to manage data with tools such as JabRef rather than manually typing entries inside a document. I attach an example of what I achieved: \unprotect \mainlanguage[\s!es] \enableexperiments[fonts.compact] \setupbodyfont[computer-modern-unicode] \setuphead[chapter] [\c!alternative=\v!middle] \defineregister[Russian] \setupregister[Russian] [\c!expansion=\v!yes, \c!balance=\v!no, \c!n=2, \c!command=\Words, \c!pagenumber=\v!no, \c!language=\s!ru] \def\Ruso[#1]% {\begingroup \getdummyparameters[word=,category=,meaning=,#1]% \Russian[\dummyparameter{word}]% {\bold{\dummyparameter{word}} \italic{\dummyparameter{category}} \dummyparameter{meaning}}% \endgroup} \protect \Ruso [word=исчисление, category=n. neutr., meaning=cálculo] \Ruso [word=вероятность, category=n. fem., meaning=probabilidad] \Ruso [word=обозначать, category=v., meaning=denotar] \Ruso [word=область, category=n. fem, meaning={región, área}] \Ruso [word=событие, category=n. neutr., meaning=evento] \Ruso [word=определение, category=n. neutr., meaning=definición] \Ruso [word=знание, category=n. neutr,, meaning=conocimiento] \Ruso [word=бесконечно, category=adv., meaning=infinitamente] \Ruso [word=сборник, category=n. masc., meaning={colección, compilación, compendio}] \Ruso [word=неравенство, category=n. neutr., meaning=desigualdad] \starttext \starttitle[title=Ruso-español] \placeRussian \stoptitle \stoptitle \stoptext Reading the manuals, I find that the publication mechanism for bibliography kinda fits my needs (using ConTeXt to sort and type data generated via external software) but, unlike registers, it doesn't seem to include options for alphabetical headers. Is it fine to keep using registers in this case? Is there a better mechanism for this task in ConTeXt? Thank you in advance. you can also use: \setregisterentry [Russian] [keys={\dummyparameter{word}}, entries={\bold{\dummyparameter{word}} \italic{\dummyparameter{category}} \dummyparameter{meaning}}]% no need for c! v! s! unless you make a multi-userinterface style anyway, makes me wonder if we should have a horizontal register variant \setupregister [Russian][2] [textstyle=bold] \setupregister [Russian][3] [textstyle=italic] so that we keep stuff on one line - 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] font problems
Here's my MWE: Objective is to typeset a Chancery font text in the upper lefthand side of a page, and then do the main body in some normal font. Then at the very last print a sign off in Chancery. For some reason I can't get both to print out as Chancery. Only one or the other, but not both. \definefontfamily [mwetest] [sans] [Liberation Sans] \setupbodyfont [mwe,ss,12pt] \definelayer[mwe][repeat=yes, preset=lefttop, hoffset=.125in, voffset=.125in] \setlayer[mwe] { \switchtobodyfont[chancery,8pt] \hskip 5mm Chancery Font Here } \setupbackgrounds[page][background=mwe] \starttext Normal font text goes here. \blank[4*big] { \switchtobodyfont[chancery] This should be Chancery here to. But isn't. } \blank[2*big]Note that if I comment out the \type{setlayer[mwe]} in the source file, then the above will print in Chancery. \stoptext I'd like to have the layers in Chancery font and then one last text string in the body in Chancery font. But I can't get them both to be Chancery. How can that be done? ___ 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] Concerning dictionaries. glossaries and related in ConTeXt
Hi, list. I want to know how I should handle alphabetically sorted data in ConTeXt. So far, I'm abusing registers in order to get simple glossaries, but I prefer to manage data with tools such as JabRef rather than manually typing entries inside a document. I attach an example of what I achieved: \unprotect \mainlanguage[\s!es] \enableexperiments[fonts.compact] \setupbodyfont[computer-modern-unicode] \setuphead[chapter] [\c!alternative=\v!middle] \defineregister[Russian] \setupregister[Russian] [\c!expansion=\v!yes, \c!balance=\v!no, \c!n=2, \c!command=\Words, \c!pagenumber=\v!no, \c!language=\s!ru] \def\Ruso[#1]% {\begingroup \getdummyparameters[word=,category=,meaning=,#1]% \Russian[\dummyparameter{word}]% {\bold{\dummyparameter{word}} \italic{\dummyparameter{category}} \dummyparameter{meaning}}% \endgroup} \protect \Ruso [word=исчисление, category=n. neutr., meaning=cálculo] \Ruso [word=вероятность, category=n. fem., meaning=probabilidad] \Ruso [word=обозначать, category=v., meaning=denotar] \Ruso [word=область, category=n. fem, meaning={región, área}] \Ruso [word=событие, category=n. neutr., meaning=evento] \Ruso [word=определение, category=n. neutr., meaning=definición] \Ruso [word=знание, category=n. neutr,, meaning=conocimiento] \Ruso [word=бесконечно, category=adv., meaning=infinitamente] \Ruso [word=сборник, category=n. masc., meaning={colección, compilación, compendio}] \Ruso [word=неравенство, category=n. neutr., meaning=desigualdad] \starttext \starttitle[title=Ruso-español] \placeRussian \stoptitle \stoptitle \stoptext Reading the manuals, I find that the publication mechanism for bibliography kinda fits my needs (using ConTeXt to sort and type data generated via external software) but, unlike registers, it doesn't seem to include options for alphabetical headers. Is it fine to keep using registers in this case? Is there a better mechanism for this task in ConTeXt? Thank you in advance. Best regards, Jairo ___ 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] upload
On 11/26/2021 11:06 AM, Alain Delmotte via ntg-context wrote: Hi, When I run the example below with 2021.11.22 22:32 LMTX fmt: 2021.11.23 I get errors for \Umathxscale and \setupmathsspacing The control sequence [...] was never \def'ed. which normally means that you should update 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] update lmtx
On 11/26/2021 11:10 AM, Alain Delmotte via ntg-context wrote: Hi! Le 22/11/2021 à 22:37, Hans Hagen via ntg-context a écrit : Hi, We're still working on the math so updated lfg files buit not many other things apart from a few fixes. In the process I ran into another area where ms eems to take the lead: https://devblogs.microsoft.com/math-in-office/unicode-math-braille-sequences/ and although it aims at msword I gave that a go for context so we now have a "braille-basic" module (style) that we (can) use (and run as demo) for playing with math spacing because we basically have a monospace font. If there is any interest in braille as alternative output we can extend that. I'm pretty sure that we need to adapt some (general spacing related) presets to this situation. Hans I remember having contact with people in the braille association in Belgium. To prepare braille text you need to follow certain rules, it is not just using braille symbols. sure, there are subtle details (leading chars and so) and there's also some 'shortcut' system So it is better to ask braille specialist about the requirements for good braille text. I'll wait and see what demands show up ... at least some basics are there. 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] update lmtx
Hi! Le 22/11/2021 à 22:37, Hans Hagen via ntg-context a écrit : Hi, We're still working on the math so updated lfg files buit not many other things apart from a few fixes. In the process I ran into another area where ms eems to take the lead: https://devblogs.microsoft.com/math-in-office/unicode-math-braille-sequences/ and although it aims at msword I gave that a go for context so we now have a "braille-basic" module (style) that we (can) use (and run as demo) for playing with math spacing because we basically have a monospace font. If there is any interest in braille as alternative output we can extend that. I'm pretty sure that we need to adapt some (general spacing related) presets to this situation. Hans I remember having contact with people in the braille association in Belgium. To prepare braille text you need to follow certain rules, it is not just using braille symbols. So it is better to ask braille specialist about the requirements for good braille text. Alain ___ 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] upload
Hi, When I run the example below with 2021.11.22 22:32 LMTX fmt: 2021.11.23 I get errors for \Umathxscale and \setupmathsspacing The control sequence [...] was never \def'ed. Alain Le 24/11/2021 à 15:29, Hans Hagen via ntg-context a écrit : Hi, for those who keep an eye on what is new, the most recent upload provides this: \starttext $\Umathxscale\textstyle 800 a + b + x + d + e = f $\par $\Umathxscale\textstyle 1000 a + b + x + d + e = f $\par $\Umathxscale\textstyle 1200 a + b + x + d + e = f $\blank $\showboxes\setupmathspacing[narrow] a + b + x + d + e = f $\par $\showboxes\setupmathspacing[normal] a + b + x + d + e = f $\par $\showboxes\setupmathspacing[wide] a + b + x + d + e = f $\blank $\showboxes\setupmathspacing[tight] x^2_1$\quad $\showboxes\setupmathspacing[normal] x^2_1$\quad $\showboxes\setupmathspacing[loose] x^2_1$\blank $\showboxes\setupmathspacing[narrow]\sqrt[2]{x+1}$\quad $\showboxes\setupmathspacing[normal]\sqrt[2]{x+1}$\quad $\showboxes\setupmathspacing[wide] \sqrt[2]{x+1}$\blank $\showboxes\setupmathspacing[less] \sqrt[2]{x+1}$\quad $\showboxes\setupmathspacing[normal]\sqrt[2]{x+1}$\quad $\showboxes\setupmathspacing[more] \sqrt[2]{x+1}$\blank \stoptext it's still experimental so the predefined values might change 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 ___ ___ 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] Checking for a Unicode prefix of a Unicode string
On 11/26/2021 7:42 AM, Joey McCollum via ntg-context wrote: I wasn't aware of a general-purpose "doifstartswith" macro in ConTeXt (the \doifnextcharelse macro only works one character at a time, and the \doifinstring macros may capture substrings that are not prefixes), and I'd like to develop one for something I'm working on. I've been trying to do this in Lua, as that seemed like the most natural approach. Normally, something like this would work fine as a foundation: ``` function isprefix(prefix, str) if string.sub(str, 1, string.len(prefix)) == prefix then return true end return false end ``` how about if string.find(str,"^"..prefix) then in: \starttext \def\DoIfPrefixElse#1#2{\ctxlua{commands.doifelse(string.find("#2","^".."#1"))}} \DoIfPrefixElse{pre}{prefix}{YES}{NOP} \DoIfPrefixElse{pre}{suffix}{YES}{NOP} \stoptext utf strings are just sequences of bytes so matching works when you want to do more in lua you can decide for \startluacode interfaces.implement { name = "DoIfPrefixElse", arguments = { "argument", "argument" }, actions = function(pre,str) commands.doifelse(string.find(str,"^"..pre)) end } \stopluacode \DoIfPrefixElse{pre}{prefix}{YES}{NOP} \DoIfPrefixElse{pre}{suffix}{YES}{NOP} but in any case: make sure that you don't clash with built in ... if needed i can make a set of fast(er) ones but someone has to collect a list of 'handy helpers' first 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 ___