Re: [NTG-context] Wiki - Proposal to update the Welcome page

2020-05-23 Thread Aditya Mahajan

On Sat, 23 May 2020, Garulfo wrote:




1/ Concerning the Manuals Page
   - As proposed, "obsolete banners" are added to thumbnails  of the
 oldest manuals.

Looks good. A few minor comments:
I haven't tested it, but the natural tables in context examples (in 
Sec 3.6) should still work with latest versions.
The "context rehab for amsmath addicts" should be in math (or 
sciences) rather than tables. (This reminds me, I should update that 
reference).


Both corrections are made, thanks for your help.



   - About providing zips of manuals per topics: maybe we could just
 add a index.html in the distribution structure, to provide the
 user with a browsing system similar to the wiki's one.
   - If the admistrators wish, I can now replace the current page.


One concern that I have is how easy it is to navigate the page on the 
phone. Currently, it does not really work on the phone. Is there some 
way to make it more responsive?


Thanks again, of primary importance.

Should be far better now (quickly checked on two smartphones, one 
android and one ios)


Thanks. Both pages look good on mobile now. I am okay with merging this with 
the old manuals page. A small suggestion is that we could omit the table of 
content on this page, as it is almost redundant in the new format.


2/ After  the Manuals,  please find a proposal for the Welcome Page,
   which is probably trickier
   - https://wiki.contextgarden.net/Main_Page_TempProposal
   - https://wiki.contextgarden.net/Main_Page (the current)
   - 4 objectives :
1/ do something more visual, reduce the amount of text,
Some of us prefer text. What was earlier a one step process for me (go 
to home page, search for keyword, go to page), is now a two step 
process. But I agree that the new proposed layout is more friendly to 
new users and support it.


Yes, I suspected that the current version had advantages as a result of 
past iterations.


It would be interesting to identify the links that people want to access 
in one step. We can list them in 
https://wiki.contextgarden.net/Talk:Main_Page_TempProposal, and I will 
try to find ways to integrate them.


Personally, I don't think that it is a big deal.


2/ provide a fairly comprehensive overview with less than 15
   topics,
    3/ but hold in one (big) screen,
4/ avoid redundancies on the Welcome Page,
5/ match both the Wiki's structure & the Manuals' structure.

Again, depending on  your feedbacks, I would be happy to improve it.

It's built from scripts  ==>  not too hard now to reorder, to adapt.
You should also document your work flow somewhere (perhaps the talk 
page of the same page or a dedicated page on the wiki). That is useful 
for long term maintainability of the wiki.


Done: two zip files are uploaded, with link and brief description in the 
Talk zone of the respective pages.


Thanks.

I am okay with changing the main page as well. But since this is the main page, 
let's wait for the other mods to chime in as well.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] How to define a font with an effect as a font with \definefont

2020-05-23 Thread Gerben Wierda


> On 23 May 2020, at 20:06, Wolfgang Schuster 
>  wrote:
> 
> Pablo Rodriguez schrieb am 23.05.2020 um 20:02:
>> On 5/23/20 11:52 AM, Gerben Wierda wrote:
>>> []
>>> Actually, my setup is Optima with Helvetica used for Cyrillic:
>>> 
>>> \definefallbackfamily
>>>   [archimate]
>>>   [ss]
>>>   [Helvetica]
>>>   [preset=range:cyrillic,
>>>tf=style:light,
>>>it=style:lightoblique,
>>>bf=style:regular,
>>>bi=style:oblique,
>>>force=yes,
>>>rscale=1.0]
>>> \definefontfamily [archimate] [ss] [Optima]
>>> \setupbodyfont[archimate]
>>> 
>>> And I would like the effect to work on just the Optima font (which is a
>>> bit light for this use)
>> Hi Gerben,
>> this code may work for you:
> 
> Don't forget to apply the "default" features to get ligatures and kerning.
> 
>> \definefontfeature
>>   [effect-widen]
>>   [effect={width=.2,delta=0.3}]
>> \definefallbackfamily
>>   [archimate]
>>   [ss]
>>   [Helvetica]
>>   [preset=range:cyrillic,
>>tf=style:light,
>>it=style:lightoblique,
>>bf=style:regular,
>>bi=style:oblique,
>>force=yes,
>>features={effect-widen}]
> 
> features={default,effect-widen}]
> 
>> \definefontfamily
>> [archimate]
>> [ss]
>> [Optima]
>> [features={effect-widen}]
> 
> features={default,effect-widen}]

Does this apply the effect only to Latin characters in Optima and not to 
Cyrcillic characters in Helvetica? I am trying to understand the syntax and if 
I read this it seems to get applied to cyrillic in this case.

G


> 
> 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
> ___

___
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] About Latex compatibility module

2020-05-23 Thread Jairo A. del Rio
Hi everyone! I was reading some old posts on TeX.SX about LaTeX support on
ConTeXt and I found the following:

https://web.archive.org/web/20110822085249/https://modules.contextgarden.net/LaTeX

However, not only the module seems to be deprecated, but there's no more
info about the module now (links are broken and the like). Btw the test
file (latextest.tex) included fails to compile:

> tex error on line 165 in file t-ltmsen.tex: ! Undefined control sequence
>> \newskip\@rightskip \@rightskip \z@skip

Is it possible to make it work? I think it would be nice if some minimal
LaTeX macros were supported. Thank you in advance!
<>
___
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] How to define a font with an effect as a font with \definefont

2020-05-23 Thread Pablo Rodriguez
On 5/23/20 9:50 PM, Gerben Wierda wrote:
>  [...]
>>> \definefontfeature
>>>   [effect-widen]
>>>   [effect={width=.2,delta=0.3}]
>>>
>>> \definefallbackfamily
>>>   [archimate]
>>>   [ss]
>>>   [Helvetica]
>>>   [preset=range:cyrillic,
>>>    tf=style:light,
>>>    it=style:lightoblique,
>>>    bf=style:regular,
>>>    bi=style:oblique,
>>>    force=yes,
>>>    features={default,effect-widen}]
>>>
>>> \definefontfamily
>>> [archimate]
>>> [ss]
>>> [Optima]
>>> [features={default,effect-widen}]
>
> Does this apply the effect only to Latin characters in Optima and not to
> Cyrcillic characters in Helvetica? I am trying to understand the syntax
> and if I read this it seems to get applied to cyrillic in this case.

Sorry, Gerben, it was only an example to show that you could apply the
feature to any font or fallback family.

If you remove "features={default, effect-widen}" from
"\definefallbackfamily", the effect won’t be applied to Helvetica.

I hope it is clear 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] output file name query

2020-05-23 Thread Henning Hraban Ramm

> Am 23.05.2020 um 14:43 schrieb Wolfgang Schuster 
> :
> 
>>> 1. Drop the weird (sorry Hraban) naming system and use myfilename for your 
>>> product.
>> I force nobody to use that.
> No and everybody has to find a system which fits best for him, prefixes can 
> be useful (e.g. to avoid component and style files with the same name) but 
> aren't necessary.

Usually my project and environment have the same name, but different prefix (in 
my weird nomenclature).

>>> 2. Use the result option on the command line, e.g. "context 
>>> --result=myfilename prd_filename.tex".
>> But that still produces a "prd_filename.*" first and then renames it, making 
>> it impossible to keep a "prd_filename.pdf". Or did that change recently?
>> 
>> My workflows are adapted to that behaviour: "prd_*.pdf" is just the 
>> temporary version, none of those leaves my computer, but only nicely named 
>> PDFs (usually MyProductName_-mm-dd.pdf).
> Having a simple name doesn't mean it's the final name of the document.

Of course. But in most of my projects I have several products (e.g. magazine 
issues, books of a series), and with a prefix I can keep all the products 
together and list them like `ls prd_*.tex`.
Not only my contextproject.py but also my call scripts relay on my naming 
scheme. And since I use it in my main projects, I use it everywhere (if I use 
the project structure at all).

>> That contradicts the mode approach. It would be nice if we could set (or can 
>> we?) the result from within the product, depending on a mode – since the 
>> product is renamed only later anyway, that could be viable.
> This addition is easy because already reads the first line of the document 
> for special setting (e.g. the engine) but anything which is set in the 
> document requires more work because you don't know the new name *before* 
> LuaTeX or LuaMetaTeX create the PDF.

You don’t need to know the name before ConTeXt creates the PDF, because it uses 
the original filename and only renames the files (pdf, tuc, log) afterwards. Or 
misunderstood I something?

Hraban
___
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] How to define a font with an effect as a font with \definefont

2020-05-23 Thread Rik Kabel


On 5/23/2020 15:50, Gerben Wierda wrote:



On 23 May 2020, at 20:06, Wolfgang Schuster 
> wrote:


Pablo Rodriguez schrieb am 23.05.2020 um 20:02:

On 5/23/20 11:52 AM, Gerben Wierda wrote:

[]
Actually, my setup is Optima with Helvetica used for Cyrillic:

\definefallbackfamily
[archimate]
[ss]
[Helvetica]
[preset=range:cyrillic,
   tf=style:light,
   it=style:lightoblique,
   bf=style:regular,
   bi=style:oblique,
   force=yes,
   rscale=1.0]
\definefontfamily [archimate] [ss] [Optima]
\setupbodyfont[archimate]

And I would like the effect to work on just the Optima font (which is a
bit light for this use)

Hi Gerben,
this code may work for you:


Don't forget to apply the "default" features to get ligatures and 
kerning.



\definefontfeature
  [effect-widen]
  [effect={width=.2,delta=0.3}]
\definefallbackfamily
  [archimate]
  [ss]
  [Helvetica]
  [preset=range:cyrillic,
   tf=style:light,
   it=style:lightoblique,
   bf=style:regular,
   bi=style:oblique,
   force=yes,
   features={effect-widen}]


features={default,effect-widen}]


\definefontfamily
[archimate]
[ss]
[Optima]
[features={effect-widen}]


features={default,effect-widen}]


Does this apply the effect only to Latin characters in Optima and not 
to Cyrcillic characters in Helvetica? I am trying to understand the 
syntax and if I read this it seems to get applied to cyrillic in this 
case.


G




Wolfgang
___



Well, you could try it. With one small correction (line 10 here), and 
effects exaggerated for demonstrations, it works just fine:


   \definefontfeature
  [effect-widen]
  [effect={width=4.2,delta=0.3}]
   \definefallbackfamily
  [archimate]
  [ss]
  [Calibri]
  [preset=range:cyrillic,
   force=yes,
   features=default]
   \definefontfamily`
    [archimate]
    [ss]
    [Calibri]
    [features={default,effect-widen}]
   \setupbodyfont[archimate]

   \starttext
  \doloopoverlist{\tf, \it, \bf, \bi}{
    \recursestring{{\russian\hyphenatedword{Николаевич}\
   \hyphenatedword{typography}}}\par}
   \stoptext

Gives:

(I don't have your fonts, but this illustrates more clearly the 
difference in handling for the two family definitions.)


--
Rik

___
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] output file name query

2020-05-23 Thread Wolfgang Schuster

Gerben Wierda schrieb am 23.05.2020 um 15:46:

Just curious: wouldn’t it theoretically be possible to delay opening the output 
file until the first \stattext? Or is there already stuff going out before 
that, such as preliminaries that go into the PDF?


\starttext is only a artificial border at the begin of the document and 
there is nothing which prevents you to put text before it. ConTeXt 
delays (or resets) a few settings (e.g. loading the default fonts) until 
this point but the document begins on the first line of the input file.


\setupbodyfont[modern-designsize]

Page \pagenumber.

\page

\starttext

Page \pagenumber.

\stoptext



I think being able to name the output file in the preliminaries in the TeX file 
would come in handy and prevent more complex workarounds with scripts. But it 
is not essential as workarounds are possible.


Setting the value of result on the first line is simple because ConTeXt 
already checks it.


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
___


Re: [NTG-context] How to define a font with an effect as a font with \definefont

2020-05-23 Thread Pablo Rodriguez
On 5/23/20 8:06 PM, Wolfgang Schuster wrote:
> Pablo Rodriguez schrieb am 23.05.2020 um 20:02:
>> On 5/23/20 11:52 AM, Gerben Wierda wrote:
>>> []
>>> Actually, my setup is Optima with Helvetica used for Cyrillic:
>>>
>>> \definefallbackfamily
>>>    [archimate]
>>>    [ss]
>>>    [Helvetica]
>>>    [preset=range:cyrillic,
>>>     tf=style:light,
>>>     it=style:lightoblique,
>>>     bf=style:regular,
>>>     bi=style:oblique,
>>>     force=yes,
>>>     rscale=1.0]
>>> \definefontfamily [archimate] [ss] [Optima]
>>> \setupbodyfont[archimate]
>>>
>>> And I would like the effect to work on just the Optima font (which is a
>>> bit light for this use)
>>
>> Hi Gerben,
>>
>> this code may work for you:
>
> Don't forget to apply the "default" features to get ligatures and kerning.

Many thanks for the correction, Wolfgang.

I forgot to add the default features after correcting another typo in
the code.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] How to define a font with an effect as a font with \definefont

2020-05-23 Thread Wolfgang Schuster

Pablo Rodriguez schrieb am 23.05.2020 um 20:02:

On 5/23/20 11:52 AM, Gerben Wierda wrote:

[]
Actually, my setup is Optima with Helvetica used for Cyrillic:

\definefallbackfamily
   [archimate]
   [ss]
   [Helvetica]
   [preset=range:cyrillic,
    tf=style:light,
    it=style:lightoblique,
    bf=style:regular,
    bi=style:oblique,
    force=yes,
    rscale=1.0]
\definefontfamily [archimate] [ss] [Optima]
\setupbodyfont[archimate]

And I would like the effect to work on just the Optima font (which is a
bit light for this use)


Hi Gerben,

this code may work for you:


Don't forget to apply the "default" features to get ligatures and kerning.


 \definefontfeature
   [effect-widen]
   [effect={width=.2,delta=0.3}]
 \definefallbackfamily
   [archimate]
   [ss]
   [Helvetica]
   [preset=range:cyrillic,
tf=style:light,
it=style:lightoblique,
bf=style:regular,
bi=style:oblique,
force=yes,
features={effect-widen}]


features={default,effect-widen}]


 \definefontfamily
 [archimate]
 [ss]
 [Optima]
 [features={effect-widen}]


features={default,effect-widen}]

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
___


Re: [NTG-context] How to define a font with an effect as a font with \definefont

2020-05-23 Thread Pablo Rodriguez
On 5/23/20 11:52 AM, Gerben Wierda wrote:
> []
> Actually, my setup is Optima with Helvetica used for Cyrillic:
>
> \definefallbackfamily
>   [archimate]
>   [ss]
>   [Helvetica]
>   [preset=range:cyrillic,
>    tf=style:light,
>    it=style:lightoblique,
>    bf=style:regular,
>    bi=style:oblique,
>    force=yes,
>    rscale=1.0]
> \definefontfamily [archimate] [ss] [Optima]
> \setupbodyfont[archimate]
>
> And I would like the effect to work on just the Optima font (which is a
> bit light for this use)

Hi Gerben,

this code may work for you:

\definefontfeature
  [effect-widen]
  [effect={width=.2,delta=0.3}]
\definefallbackfamily
  [archimate]
  [ss]
  [Helvetica]
  [preset=range:cyrillic,
   tf=style:light,
   it=style:lightoblique,
   bf=style:regular,
   bi=style:oblique,
   force=yes,
   features={effect-widen}]
\definefontfamily
[archimate]
[ss]
[Optima]
[features={effect-widen}]
\setupbodyfont[archimate]

\starttext
  \doloopoverlist{\tf, \it, \bf, \bi}{
\recursestring\hyphenatedword{Николаевич typography}\par}
\stoptext

BTW, rscale is set to 1.0 by default (as far as I can tell).

Just in case it helps,

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Wiki - Proposal to update the Welcome page

2020-05-23 Thread Garulfo



1/ Concerning the Manuals Page
   - As proposed, "obsolete banners" are added to thumbnails  of the
 oldest manuals.

Looks good. A few minor comments:
I haven't tested it, but the natural tables in context examples (in 
Sec 3.6) should still work with latest versions.
The "context rehab for amsmath addicts" should be in math (or 
sciences) rather than tables. (This reminds me, I should update that 
reference).


Both corrections are made, thanks for your help.



   - About providing zips of manuals per topics: maybe we could just
 add a index.html in the distribution structure, to provide the
 user with a browsing system similar to the wiki's one.
   - If the admistrators wish, I can now replace the current page.


One concern that I have is how easy it is to navigate the page on the 
phone. Currently, it does not really work on the phone. Is there some 
way to make it more responsive?


Thanks again, of primary importance.

Should be far better now (quickly checked on two smartphones, one 
android and one ios)




2/ After  the Manuals,  please find a proposal for the Welcome Page,
   which is probably trickier
   - https://wiki.contextgarden.net/Main_Page_TempProposal
   - https://wiki.contextgarden.net/Main_Page (the current)
   - 4 objectives :
1/ do something more visual, reduce the amount of text,
Some of us prefer text. What was earlier a one step process for me (go 
to home page, search for keyword, go to page), is now a two step 
process. But I agree that the new proposed layout is more friendly to 
new users and support it.


Yes, I suspected that the current version had advantages as a result of 
past iterations.


It would be interesting to identify the links that people want to access 
in one step. We can list them in 
https://wiki.contextgarden.net/Talk:Main_Page_TempProposal, and I will 
try to find ways to integrate them.




2/ provide a fairly comprehensive overview with less than 15
   topics,
    3/ but hold in one (big) screen,
This looks more reasonable on the phone. The 2nd half of the page 
looks okay, but the first half still looks weird (too narrow and long 
columns). Perhaps there is a way to may it a bit more responsive on 
the phone.


See above, should be far better now.



4/ avoid redundancies on the Welcome Page,
5/ match both the Wiki's structure & the Manuals' structure.

Again, depending on  your feedbacks, I would be happy to improve it.

It's built from scripts  ==>  not too hard now to reorder, to adapt.
You should also document your work flow somewhere (perhaps the talk 
page of the same page or a dedicated page on the wiki). That is useful 
for long term maintainability of the wiki.


Done: two zip files are uploaded, with link and brief description in the 
Talk zone of the respective pages.



___
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] List of language-specific hyphenation commands

2020-05-23 Thread Wolfgang Schuster

Jairo A. del Rio schrieb am 22.05.2020 um 23:42:
Hi everybody! I've read about some commands which allow hyphenation 
according to an specific language in ConTeXt, e.g. \french{word} for 
French hyphenation in a text the main language of which is Spanish, 
English, etc. Unlike \language[code], I couldn't find any extensive list 
of those commands, so where should I find them? Thank you in advance!


It's a switch and you have to put the left brace before the command, 
e.g. {\french ...}


There is no list but you can print the stored entries.

\starttext

\startluacode

function userdata.languagesyonym(language)
context.doShowLanguage(language)
for synonym, _ in next, languages.registered[language].synonyms do
context.doShowLanguage(synonym)
end
end

function userdata.checklanguage(language,meaning)
if string.find(meaning,"\\lang_basics_set_current") then
context.tex(language)
end
end

\stopluacode

\def\doShowLanguage#1%
  {\doifnotinstring{-}{#1}

{\ctxlua{userdata.checklanguage("#1","\luaescapestring{\expandafter\meaning\csname#1\endcsname}")}}%
   \par}

\def\ShowLanguage#1%
  {\testpage[3]
   \blank[medium]
   \ctxlua{userdata.languagesyonym("#1")}}

\processcommacommand[\installedlanguages]\ShowLanguage

\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
___


Re: [NTG-context] Getting width of text to be typeset

2020-05-23 Thread Rik Kabel


On 5/22/2020 19:49, Rik Kabel wrote:


If the OP simply wants the width of a string, one can use 
\setwidthof#1\to#2.


\define\String{pqrs}
\setwidthof{\String}\to\Wdth
\String\ is \Wdth\ wide.

\setwidthof{{\tfb\em\String}}\to\Wdth
{\tfb\em\String} is \Wdth\ wide.

I do not know if that is different from the width of the same string 
unboxed from the paragraph. There may be some adjustments made in 
justification, expansion, and such that are not treated.



Correcting my post (thank you, Floris), the format is a bit different 
than I had written. The following works:


   \starttext
   \define\String{pqrs}
   \setwidthof\String\to\WdthA
   {\String} is \WdthA\ wide.

   \define\String{\tfx\em pqrs}
   \setwidthof\String\to\WdthB
   {\String} is \WdthB\ wide.

   \define\String{\ss pqrs}
   \setwidthof\String\to\WdthC
   {\String} is \WdthC\ wide.
   \stoptext


Giving:

--
Rik

___
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] How to define a font with an effect as a font with \definefont

2020-05-23 Thread Gerben Wierda
Wityh this working example:

\starttext
The quick brown fox jumped over the lazy dog

\definefontfeature
[effect-widen]
  [effect={width=.2,delta=0.3}]
\definedfont[Sans*widen,effect-widen]
The quick brown fox jumped over the lazy dog

\stoptext

I am puzzling to turn my working \definedfont into a \definefont so I can use 
that instead.

Actually, my setup is Optima with Helvetica used for Cyrillic:

\definefallbackfamily
  [archimate]
  [ss]
  [Helvetica]
  [preset=range:cyrillic,
   tf=style:light,
   it=style:lightoblique,
   bf=style:regular,
   bi=style:oblique,
   force=yes,
   rscale=1.0]
\definefontfamily [archimate] [ss] [Optima]
\setupbodyfont[archimate]

And I would like the effect to work on just the Optima font (which is a bit 
light for this use)

I’ve been trying to work out using \definefont with the effect but have so far 
failed.

Thanks,

G___
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] output file name query

2020-05-23 Thread Gerben Wierda


> On 23 May 2020, at 14:46, Wolfgang Schuster 
>  wrote:
> 
> Henning Hraban Ramm schrieb am 22.05.2020 um 17:39:
 Am 22.05.2020 um 15:09 schrieb Wolfgang Schuster 
 :
>>> 
>>> Alan Bowen schrieb am 22.05.2020 um 14:33:
 In my project, I process a single product file by enabling various modes. 
 What I would like to do is to vary the name of the output PDF file in each 
 instance.
 So, in processing a file, how does one go directly from prd_filename.tex 
 to myfilename.pdf rather than to prd_filename.pdf—assuming that it is 
 possible?
 Any tips or pointers to what I should be reading will be greatly 
 appreciated.
>>> 1. Drop the weird (sorry Hraban) naming system and use myfilename for your 
>>> product.
>> I force nobody to use that.
> No and everybody has to find a system which fits best for him, prefixes can 
> be useful (e.g. to avoid component and style files with the same name) but 
> aren't necessary.
>>> 2. Use the result option on the command line, e.g. "context 
>>> --result=myfilename prd_filename.tex".
>> But that still produces a "prd_filename.*" first and then renames it, making 
>> it impossible to keep a "prd_filename.pdf". Or did that change recently?
>> 
>> My workflows are adapted to that behaviour: "prd_*.pdf" is just the 
>> temporary version, none of those leaves my computer, but only nicely named 
>> PDFs (usually MyProductName_-mm-dd.pdf).
> Having a simple name doesn't mean it's the final name of the document.
>>> 3. Ask Hans to add the result option to the first line of the document 
>>> which is read by the context script before it creates the PDF.
>>> 
>>> % result="myfilename"
>>> \starttext
>>> ...
>>> \stoptext
>> That contradicts the mode approach. It would be nice if we could set (or can 
>> we?) the result from within the product, depending on a mode – since the 
>> product is renamed only later anyway, that could be viable.
> This addition is easy because already reads the first line of the document 
> for special setting (e.g. the engine) but anything which is set in the 
> document requires more work because you don't know the new name *before* 
> LuaTeX or LuaMetaTeX create the PDF.
> 

Just curious: wouldn’t it theoretically be possible to delay opening the output 
file until the first \stattext? Or is there already stuff going out before 
that, such as preliminaries that go into the PDF?

I think being able to name the output file in the preliminaries in the TeX file 
would come in handy and prevent more complex workarounds with scripts. But it 
is not essential as workarounds are possible.

Gerben

> 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
> ___
___
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] output file name query

2020-05-23 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 22.05.2020 um 17:39:

Am 22.05.2020 um 15:09 schrieb Wolfgang Schuster 
:

Alan Bowen schrieb am 22.05.2020 um 14:33:

In my project, I process a single product file by enabling various modes. What 
I would like to do is to vary the name of the output PDF file in each instance.
So, in processing a file, how does one go directly from prd_filename.tex to 
myfilename.pdf rather than to prd_filename.pdf—assuming that it is possible?
Any tips or pointers to what I should be reading will be greatly appreciated.

1. Drop the weird (sorry Hraban) naming system and use myfilename for your 
product.

I force nobody to use that.
No and everybody has to find a system which fits best for him, prefixes 
can be useful (e.g. to avoid component and style files with the same 
name) but aren't necessary.

2. Use the result option on the command line, e.g. "context --result=myfilename 
prd_filename.tex".

But that still produces a "prd_filename.*" first and then renames it, making it 
impossible to keep a "prd_filename.pdf". Or did that change recently?

My workflows are adapted to that behaviour: "prd_*.pdf" is just the temporary 
version, none of those leaves my computer, but only nicely named PDFs (usually 
MyProductName_-mm-dd.pdf).

Having a simple name doesn't mean it's the final name of the document.

3. Ask Hans to add the result option to the first line of the document which is 
read by the context script before it creates the PDF.

% result="myfilename"
\starttext
...
\stoptext

That contradicts the mode approach. It would be nice if we could set (or can 
we?) the result from within the product, depending on a mode – since the 
product is renamed only later anyway, that could be viable.
This addition is easy because already reads the first line of the 
document for special setting (e.g. the engine) but anything which is set 
in the document requires more work because you don't know the new name 
*before* LuaTeX or LuaMetaTeX create the PDF.


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
___


Re: [NTG-context] Getting width of text to be typeset

2020-05-23 Thread Gerben Wierda


> On 23 May 2020, at 01:49, Rik Kabel  wrote:
> 
> If the OP simply wants the width of a string, one can use \setwidthof#1\to#2.
> 
> \define\String{pqrs}
> \setwidthof{\String}\to\Wdth
> \String\ is \Wdth\ wide.
> 
> \setwidthof{{\tfb\em\String}}\to\Wdth
> {\tfb\em\String} is \Wdth\ wide.
> 
> I do not know if that is different from the width of the same string unboxed 
> from the paragraph. There may be some adjustments made in justification, 
> expansion, and such that are not treated.

Additionally: suppose I am in lua. Would it be possible to get the width (and 
height) of a string back in lua as a value?

So, in lua something like this:

width = tex.widthofstring(“I have a string with some $\frac{1}2{}$ (math) in 
it")

G___
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
___