[NTG-context] atan2 function

2022-10-12 Thread Thangalin via ntg-context
Hi there,

How is atan2 called? I rolled my own as follows:

% SOT
\startuseMPgraphic{HexGridBaseGraphic}
  vardef atantwo( expr ax, ay, bx, by ) =
save theta;

numeric dx;
numeric dy;
numeric theta;

dx := bx - ax;
dy := by - ay;
theta := 0;

if (dx > 0):
  theta := atan( dy / dx );
elseif (dx < 0) and (dy >= 0):
  theta := atan( dy / dx ) + pi;
elseif (dx < 0) and (dy < 0):
  theta := atan( dy / dx ) - pi;
elseif (dx == 0) and (dy > 0):
  theta := pi / 2;
elseif (dx == 0) and (dy < 0):
  theta := -pi / 2;
fi;

%theta := atan( dy, dx );

theta
  enddef;
% EOT

When this runs, the expected result is generated:

https://pdfhost.io/v/xdNxANU18_scaled

When uncommenting "atan( dy, dx )", an unexpected result is generated:

https://pdfhost.io/v/QdfU89IL._scaled

Is atan with two parameters supposed to behave like atan2?

Cheers!
___
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] \quotation, protrusion and linebreaking

2022-10-12 Thread Wolfgang Schuster via ntg-context

Alan Braslau schrieb am 13.10.2022 um 00:43:

On 12/10/22 12/10/22, 14:25, Wolfgang Schuster via ntg-context wrote:

Denis Maier via ntg-context schrieb am 12.10.2022 um 21:17:

Instead of what?


By default the symbols are placed with a box because you aren't limited
to normal quotation marks.

\setupexternalfigure [location=default]

\setupdelimitedtext
   [quotation]
   [ left={\externalfigure[cow][height=\strutht]},
    right={\externalfigure[cow][height=\strutht]}]


I *like* cow delimiters (but shouldn't the right one be reflected?) ;-)


Better?

\setupdelimitedtext
  [quotation]
  [ 
left={\offset[y=.5\strutdp]{\externalfigure[cow][height=\dimexpr\strutht+.5\strutdp\relax]}\nbsp},

right={\nbsp\mirror{\offset[y=.5\strutdp]{\externalfigure[cow][height=\dimexpr\strutht+.5\strutdp\relax]}}}]

Wolfgang

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Spacing in \unit - degrees

2022-10-12 Thread Gavin via ntg-context
Hi Alan

> On Oct 12, 2022, at 5:55 PM, Alan Braslau via ntg-context 
>  wrote:
> 
> \unit{135℃} adds a space after the digits 135.
> I do not believe that this is correct
> (for ℃ is *not* a "real" unit, unlike \unit{408.15 K} which *is* a real
> unit).

According to “Scientific Style and Format: The CSE Manual for Authors, Editors, 
and Publishers, 8th Ed.” by the Council of Science Editors:

> The symbol for degrees Celsius, ℃ (not simply C), is separated from the 
> number on its left by one space, whereas the degree symbol for a plane angle 
> (e.g. a 45° angle) and for longitude and latitude (e.g. 45°30’N) is not 
> separated from the numeral by a space. [§12.2.1.1 SI Rules, pp.169-170]

As a recovering string theorist, I cannot help but speculate that this rule 
extends to spherical coordinates in any number of dimensions. However, if you 
don’t want the space, you can use 135\unit{℃}, which does not add a space.

> Also,
> \unit{135°C} drops the "C". Is this a parsing bug?

It is not a parsing bug; it is a limitation. In general, units must be spelled 
out (newton, joule, etc.) which produces the correct SI symbol (N, J, etc.). 
Some units are also recognized by their symbols (m, s, kg,…). Celsius is 
recognized by the single character “℃” and by the name “celsius”, but not by 
the two character combination “°C”. Probably, the parser could be expanded to 
recognize the two character combination. That requires mucking around in 
phys-dim.lua, which I’m not going to touch.

Use \unit{135 celsius} if you want the space, and 135\unit{celsius} if you 
don’t. Or you can add your favorite abbreviations:

\registerunit[
  °C=°C,
  ]
\setupunittext[
  °C=℃,
  ]

Then use \unit{135°C} if you want the space and 135\unit{°C} if you don’t.

> Related,
> \unit{90°} does not seem to introduce a space, as indeed it should not.

Also related, using \unit for just the units, and not the number, is useful 
when they follow something that is not a number, like a vector: $ \vec v = 
(4.0, -3.2, 1.5)\unit{m/s} $. You frequently do not want a space in that 
situation.

Now that I’ve had this success messing with other people’s code, I’ve got your 
luagraph module on my mind.

Gavin
___
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] Spacing in \unit - SOLVED

2022-10-12 Thread Gavin via ntg-context
Hi Max and Rik

> On Oct 12, 2022, at 4:49 PM, Max Chernoff  wrote:
> 
> This new output looks *much* better than the old one, thanks! 

Thank you!

> My only comment is that the spacing around the multiplication sign looks
> a little too tight to me. The original spacing was probably too large,
> but I think that a little more space than you currently have would be
> better.

I haven’t adjusted the space directly. I just changed the \times and \cdot from 
class binom to class ord. I’m not going to tweak the space. I don’t even use 
this font. With proportional numbers in Libertinus, I think the \times looks 
great.



PastedGraphic-5.pdf
Description: Adobe PDF document


With tabular numbers, the \times looks a bit off center due to the extra space 
around the following 1.

>> If anyone wants my changes, either for their own use or to improve the
>> distributed phys-dim.mkxl, I’m happy to share.
> 
> Yes, can you please share that to the list?

See below for comments, and the full modified phys-dim.mkxl is attached

> Hi Rik,
> 
>> It does look like you have introduced additional space before the 
>> solidus. Was that intentional?
> 
> I believe that that is intentional. From the earlier email:
> 
>> removed an overzealous backspace before division symbols.
> 
> This new spacing looks much more even to me, especially around the
> exponents.

It was intentional. I didn’t add space. I removed a backspace in the \unit code.

Below I list all of my changes to the phys-dim.mkxl code, with some commentary. 
I have added comments in the code everywhere I made a change, and I signed the 
changes with -GP, so they are easy to find.

Thanks for your encouragement, because my high school physics students 
certainly do not give a s#!t.

I hope some people find this useful!

Gavin



This used to add space around the \times in text. Now, instead, it removes the 
space around the \times in math by making the \times an ord. (ll. 170-172)

\permanent\protected\def\digitstextbinop#1% assumes preceding
  {\ifmmode\mathord#1\else\nobreak#1\fi} % Removed space around binop (\times 
or \cdot) in \units -GP
  %{\ifmmode#1\else\fourperemspace\nobreak#1\fourperemspace\fi} % This is the 
old line with spaces -GP


These lines produce the \cdot between units, one is for the default \cdot, the 
other when the separator=cdot option is used. I’m not entirely sure why they 
are separate. Now, in math mode, the \cdot is changed to an ord. (ll. 392-393

\protected\def\phys_units_separator
  
{\ifcsname\??unitseparator\unitparameter\c!separator\endcsname\lastnamedcs\else\ifmmode\mathord\cdot\else\cdot\fi\fi}
 % Made \cdot an "ord" in math mode -GP

\installunitsseparator\v!normal{\ifmmode\mathord\cdot\else\cdot\fi}  % Made 
\cdot an "ord" in math mode -GP


To get the thin space between the number and the units (ll.412-418)

\protected\def\phys_units_space
  {\ifmmode
 \thinspace % let the atoms do the work. Right now atoms aren't doing the 
work, so I put in a \thinspace -GP
   \else
 \unskip % weird, why is unskip needed
 
\ifcsname\??unitspace\unitparameter\c!space\endcsname\lastnamedcs\else\unitsmediumspace\fi
   \fi}


This had a hardcoded backspace before the solidus. I think it looks better 
without. Even if this space should be tighter, it probably should be dealt with 
for every solidus, not just the solidus in \unit the unit command. (ll.412-418)

\permanent\protected\def\unitsSOLIDUS
  {%\ifnum\c_phys_units_state=\plusone % suffix  % Removed three lines to 
eliminate backspace before / -GP
   %  \unitsbackspace
   %\fi
   {/}%
   }%\unitsbackspace}


Finally, until the space around the dimension class is fixed, I’m just removing 
the code that sets units to this class. (ll. 618-623)

\def\phys_units_start
  {\ifmmode
 \dostarttagged\t!maction\t!unit
% \mathatom % I removed this because the correct spaces after dim haven't 
been set (e.g. dimbin, dimrel) -GP
%\s!leftclass  \mathdimensioncode
%\s!rightclass \mathdimensioncode
 \bgroup
   \else
 \dostarttagged\t!unit\empty
   \fi
   \let\phys_units_finish\phys_units_stop
   \let\phys_units_start\relax}




phys-dim.mkxl
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 / 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] Spacing in \unit - degrees

2022-10-12 Thread Alan Braslau via ntg-context
Further \unit question(s):

\unit{135℃} adds a space after the digits 135.
I do not believe that this is correct
(for ℃ is *not* a "real" unit, unlike \unit{408.15 K} which *is* a real
unit).

Also,
\unit{135°C} drops the "C". Is this a parsing bug?

Related,
\unit{90°} does not seem to introduce a space, as indeed it should not.

Alan
___
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] LMTX generates PDFs with non-working fonts on real printers

2022-10-12 Thread Max Chernoff via ntg-context
On Wed, 2022-10-12 at 13:14 +0200, Leah Neukirchen wrote:
> > Seeing that you're modifying the font encoding, could you perhaps
> > reconsider supporting hinting in LMTX? 
> > 
> >https://mailman.ntg.nl/pipermail/ntg-context/2022/106311.html
> > 
> > Even with a high resolution screen, I can still see a difference, and
> > the issue can show up in print too:
> > 
> >
> >https://graphicdesign.stackexchange.com/q/5874
> >
> > I'm fairly confident that these issues are all hinting-related:
> > 
> >https://mailman.ntg.nl/pipermail/ntg-context/2022/106874.html
> >https://mailman.ntg.nl/pipermail/ntg-context/2022/105212.html
> >
> > Considering that all of the fonts included with ConTeXt are hinted, it
> > seems like a shame to not include any of that data in the generated
> > PDFs.
> 
> The last version of font-cff.lua should also copy the hinting-related
> values of the CFF properly (/BlueScale, /StemSnap[HV] etc).
> We fixed that on the side. ;)

Yay!

Thanks,
-- Max
___
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] Spacing in \unit - SOLVED

2022-10-12 Thread Max Chernoff via ntg-context
Hi Gavin,

On Wed, 2022-10-12 at 15:54 -0600, Gavin wrote:
> Hi Max, Alan, Bruce, Hans, et.al
> 
> I solved my four issues with \unit spacing. In the process, I
> prevented unwanted line breaks and removed an overzealous backspace
> before division symbols. Below is a MWE that shows all of these
> issues, as well as pictures of the result with the unmodified phys-
> dim.mkxl and with my modified phys-dim.mkxl. The final result is
> exactly what I wanted.

This new output looks *much* better than the old one, thanks! 

My only comment is that the spacing around the multiplication sign looks
a little too tight to me. The original spacing was probably too large,
but I think that a little more space than you currently have would be
better.

> If anyone wants my changes, either for their own use or to improve the
> distributed phys-dim.mkxl, I’m happy to share.

Yes, can you please share that to the list?

Hi Rik,

> It does look like you have introduced additional space before the 
> solidus. Was that intentional?

I believe that that is intentional. From the earlier email:

> removed an overzealous backspace before division symbols.

This new spacing looks much more even to me, especially around the
exponents.

Thanks,
-- Max
___
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] \quotation, protrusion and linebreaking

2022-10-12 Thread Alan Braslau via ntg-context

On 12/10/22 12/10/22, 14:25, Wolfgang Schuster via ntg-context wrote:

Denis Maier via ntg-context schrieb am 12.10.2022 um 21:17:

Instead of what?


By default the symbols are placed with a box because you aren't limited
to normal quotation marks.

\setupexternalfigure [location=default]

\setupdelimitedtext
   [quotation]
   [ left={\externalfigure[cow][height=\strutht]},
    right={\externalfigure[cow][height=\strutht]}]


I *like* cow delimiters (but shouldn't the right one be reflected?) ;-)

Alan

___
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] Spacing in \unit - SOLVED

2022-10-12 Thread Rik Kabel via ntg-context


On 2022-10-12 17:54, Gavin via ntg-context wrote:

Hi Max, Alan, Bruce, Hans, et.al

I solved my four issues with \unit spacing. In the process, I prevented 
unwanted line breaks and removed an overzealous backspace before division 
symbols. Below is a MWE that shows all of these issues, as well as pictures of 
the result with the unmodified phys-dim.mkxl and with my modified 
phys-dim.mkxl. The final result is exactly what I wanted.

If anyone wants my changes, either for their own use or to improve the 
distributed phys-dim.mkxl, I’m happy to share.

Thanks for all of your comments!
Gavin


MWE:

\setuppapersize[A5]

\starttext

The \type{\unit} command in text produces \unit{1.23e5 kg m^2/s^2}.

Inline math \type{$\unit$} produces $\unit{1.23e5 kg m^2/s^2}$.

Display math produces
\startformula
  \unit{1.23e5 kg m^2/s^2} + \unit{8.64e5 newton m} = \unit{987,000 joule}
\stopformula

Line breaking in math:

{\hsize=0pt $G = \unit{6.6743e-11 m3 kg-1 s-2}$}

\blank
Line breaking in text:

{\hsize=0pt \unit{6.6743e-11 m3 kg-1 s-2}}

\stoptext

Output with unmodified phys-dim.mkxl:


Output with my modified phys-dim.mkxl:





On Oct 10, 2022, at 12:15 AM, Max Chernoff via ntg-context  
wrote:

Hi Alan,


I would very strongly argue that the space between the number and the
following units be UNBREAKABLE. Perhaps a thin space (preference), but
most certainly non-breakable.

Similarly around the times in scientific notation.

I further cannot imagine that a line break be acceptable around a \cdot
in composite units.

This can possibly lead to overfill and underfill, something that I find
*infinitely* more acceptable then breaking numbers and units.

Yes, I agree completely here.


I do not know or use the \units command. Maybe it uses unbreakable
spaces, maybe not. I would never use it unless it could be configured
to only use nonbreakable spaces.

The current behaviour doesn't break the unit from the number, but it
does split the scientific notation.

This test file:

   \starttext
   \hsize=0pt Math: $G = \unit{6.6743e-11 m3 kg-1 s-2}$

   \hsize=0pt Text: \unit{6.6743e-11 m3 kg-1 s-2}
   \stoptext

gives:

   Math:
   퐺=
   6.6743×
   10–11m3⋅kg–1⋅s–2
   Text:
   6.6743
   ×
   10−11 m3⋅kg−1⋅s−2

which isn't great. In my opinion, the \unit command should be typeset in an
\hbox (or similar) since I can't think of any circumstances where breaking
it would be reasonable.

Thanks,
-- Max
___


It does look like you have introduced additional space before the 
solidus. Was that intentional?


--
Rik

___
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] Spacing in \unit - SOLVED

2022-10-12 Thread Gavin via ntg-context
Hi Max, Alan, Bruce, Hans, et.al

I solved my four issues with \unit spacing. In the process, I prevented 
unwanted line breaks and removed an overzealous backspace before division 
symbols. Below is a MWE that shows all of these issues, as well as pictures of 
the result with the unmodified phys-dim.mkxl and with my modified 
phys-dim.mkxl. The final result is exactly what I wanted.

If anyone wants my changes, either for their own use or to improve the 
distributed phys-dim.mkxl, I’m happy to share.

Thanks for all of your comments!
Gavin


MWE:

\setuppapersize[A5]

\starttext

The \type{\unit} command in text produces \unit{1.23e5 kg m^2/s^2}.

Inline math \type{$\unit$} produces $\unit{1.23e5 kg m^2/s^2}$.

Display math produces
\startformula
 \unit{1.23e5 kg m^2/s^2} + \unit{8.64e5 newton m} = \unit{987,000 joule}
\stopformula

Line breaking in math:

{\hsize=0pt $G = \unit{6.6743e-11 m3 kg-1 s-2}$}

\blank
Line breaking in text:

{\hsize=0pt \unit{6.6743e-11 m3 kg-1 s-2}}

\stoptext

Output with unmodified phys-dim.mkxl:


PastedGraphic-3.pdf
Description: Adobe PDF document


Output with my modified phys-dim.mkxl:


PastedGraphic-2.pdf
Description: Adobe PDF document




> On Oct 10, 2022, at 12:15 AM, Max Chernoff via ntg-context 
>  wrote:
> 
> Hi Alan,
> 
>> I would very strongly argue that the space between the number and the
>> following units be UNBREAKABLE. Perhaps a thin space (preference), but
>> most certainly non-breakable.
>> 
>> Similarly around the times in scientific notation.
>> 
>> I further cannot imagine that a line break be acceptable around a \cdot
>> in composite units.
>> 
>> This can possibly lead to overfill and underfill, something that I find
>> *infinitely* more acceptable then breaking numbers and units.
> 
> Yes, I agree completely here.
> 
>> I do not know or use the \units command. Maybe it uses unbreakable
>> spaces, maybe not. I would never use it unless it could be configured
>> to only use nonbreakable spaces. 
> 
> The current behaviour doesn't break the unit from the number, but it
> does split the scientific notation.
> 
> This test file:
> 
>   \starttext
>   \hsize=0pt Math: $G = \unit{6.6743e-11 m3 kg-1 s-2}$
> 
>   \hsize=0pt Text: \unit{6.6743e-11 m3 kg-1 s-2}
>   \stoptext
> 
> gives:
> 
>   Math:
>   퐺=
>   6.6743×
>   10–11m3⋅kg–1⋅s–2
>   Text:
>   6.6743
>   ×
>   10−11 m3⋅kg−1⋅s−2
> 
> which isn't great. In my opinion, the \unit command should be typeset in an
> \hbox (or similar) since I can't think of any circumstances where breaking
> it would be reasonable.
> 
> Thanks,
> -- Max
> ___
> 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] \quotation, protrusion and linebreaking

2022-10-12 Thread Wolfgang Schuster via ntg-context

Denis Maier via ntg-context schrieb am 12.10.2022 um 21:17:

Instead of what?


By default the symbols are placed with a box because you aren't limited
to normal quotation marks.

\setupexternalfigure [location=default]

\setupdelimitedtext
  [quotation]
  [ left={\externalfigure[cow][height=\strutht]},
   right={\externalfigure[cow][height=\strutht]}]

\starttext

\quotation{\input weisman }

\stoptext

Wolfgang

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] \quotation, protrusion and linebreaking

2022-10-12 Thread Rik Kabel via ntg-context


On 2022-10-11 15:06, Leah Neukirchen via ntg-context wrote:

Henning Hraban Ramm via ntg-context  writes:


Am 11.10.22 um 20:00 schrieb Leah Neukirchen via ntg-context:

Hello,
I noticed the following problem:
\showframe
\startluacode
fonts.protrusions.vectors.pure[0x201C] = { 1, 1 }
\stopluacode
\definefontfeature[default][default][protrusion=pure]
\setupalign[hanging]
\starttext
This text is unquoted.
“This text is quoted manually.”
\quotation{This text is quoted by a macro.}
This is a very long line followed by a nice linebreak, very
supercalifragilisticexpialidocious.
This is a very long line followed by an ugly linebreak, not
\quotation{supercalifragilisticexpialidocious}
\stoptext
The macro-quoted text is not protruded.  I fixed this locally with a
macro
\def\q#1{\protrusionboundary1\quotation{#1}}
Should this be default?
But the missing hyphenation I have to add myself with \-.  Ideas?

Try
\setupdelimitedtext[quotation][method=font]

That fixes both issues, thanks!

Not sure where I should have learned this exists, however. ;)


Note that this does not fix the problem when the quotation begins a 
footnote. See the thread "Hanging punctuation misalignment in footnotes" 
(https://mailman.ntg.nl/pipermail/ntg-context/2014/077122.html or 
https://www.mail-archive.com/ntg-context@ntg.nl/msg73516.html, pick your 
favorite archiver), where the problem is described. An test example follows:


   \setuplayout   [width=9cm,
    height=12cm]
   \definefontfeature [default]
   [default]
   [protrusion=quality]
   \setupalign    [hanging]
   \setupquotation    [method=font]
   \setupnote [endnote]
   [location=none]
   \setupnotation [footnote]
   [numberconversion=set 2]
   \setupnotation [footnote]
   [align=hanging]
   \setupwhitespace   [medium]
   \setupbodyfont [libertinus]
   \showframe
   \starttext

   \quotation{{\em Cantharides}} is the reported message from Sir Francis
   Drake upon defeating the Spanish Armada.\endnote{\quotation{{\em
   Vovi}} is
   reportedly the message from James Broun|-|Ramsay on taking Oudh. Both
   are as likely as the attribution of \quotation{{\em peccavi}} to
   Napier after
   his defeat of the Ameer of Scinde.}\footnote{“{\em Vovi}” is
   reportedly the message from James Broun|-|Ramsay on taking Oudh. Both
   are as likely as the attribution of \quotation{{\em peccavi}} to
   Napier after
   his defeat of the Ameer of Scinde.}

   {\tfx This problem appears intractable. See \quotation{Re:
   [NTG-context] Hanging punctuation misalignment in footnotes} on the
   mailing list, where Wolfgang explains that the problem is struts.}

   \placenotes[endnote]

   \stoptext

A solution is welcomed.

--
Rik
___
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] \quotation, protrusion and linebreaking

2022-10-12 Thread Denis Maier via ntg-context
> -Ursprüngliche Nachricht-
> Von: ntg-context  Im Auftrag von Hans Hagen
> via ntg-context
> Gesendet: Mittwoch, 12. Oktober 2022 21:12
> An: Denis Maier via ntg-context 
> Cc: Hans Hagen 
> Betreff: Re: [NTG-context] \quotation, protrusion and linebreaking
> 
> On 10/12/2022 8:49 PM, Denis Maier via ntg-context wrote:
> >> -Ursprüngliche Nachricht-
> >> Von: ntg-context  Im Auftrag von Henning
> >> Hraban Ramm via ntg-context
> >> Gesendet: Mittwoch, 12. Oktober 2022 10:15
> >> An: ntg-context@ntg.nl
> >> Cc: Henning Hraban Ramm 
> >> Betreff: Re: [NTG-context] \quotation, protrusion and linebreaking
> >>
> >> Am 11.10.22 um 21:06 schrieb Leah Neukirchen:
> >>> Henning Hraban Ramm via ntg-context  writes:
>  \setupdelimitedtext[quotation][method=font]
> >>>
> >
> > Just a quick request for clarification: What does that actually do?
> uses glyph in font instead (most opentype have them)

Instead of what?
___
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] \quotation, protrusion and linebreaking

2022-10-12 Thread Hans Hagen via ntg-context

On 10/12/2022 8:49 PM, Denis Maier via ntg-context wrote:

-Ursprüngliche Nachricht-
Von: ntg-context  Im Auftrag von Henning
Hraban Ramm via ntg-context
Gesendet: Mittwoch, 12. Oktober 2022 10:15
An: ntg-context@ntg.nl
Cc: Henning Hraban Ramm 
Betreff: Re: [NTG-context] \quotation, protrusion and linebreaking

Am 11.10.22 um 21:06 schrieb Leah Neukirchen:

Henning Hraban Ramm via ntg-context  writes:

\setupdelimitedtext[quotation][method=font]




Just a quick request for clarification: What does that actually do?

uses glyph in font instead (most opentype have them)


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] \quotation, protrusion and linebreaking

2022-10-12 Thread Denis Maier via ntg-context
> -Ursprüngliche Nachricht-
> Von: ntg-context  Im Auftrag von Henning
> Hraban Ramm via ntg-context
> Gesendet: Mittwoch, 12. Oktober 2022 10:15
> An: ntg-context@ntg.nl
> Cc: Henning Hraban Ramm 
> Betreff: Re: [NTG-context] \quotation, protrusion and linebreaking
> 
> Am 11.10.22 um 21:06 schrieb Leah Neukirchen:
> > Henning Hraban Ramm via ntg-context  writes:
> >> \setupdelimitedtext[quotation][method=font]
> >

Just a quick request for clarification: What does that actually do?

Best,
Denis
___
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] Dimension atom in math? (was: Spacing in \unit)

2022-10-12 Thread Gavin via ntg-context
Hi List,

I am trying to improve the spacing produced by the \unit command. I have solved 
three of my four issues by modifying phys-dim.mkxl, but the fourth issue has me 
stumped. Consider this example:

\showmakeup[mathglue] \mathspacingmode=1

\starttext
\startformula
 \unit{1.23e5 kg m^2/s^2} + \unit{8.64e5 newton m} = \unit{987,000 joule}
\stopformula
\stoptext

There is no space between the units and the following + or =. The \showmakeup 
reveals that this is the space between a “dim” and a “bin” or a “dim” and a 
“rel”. I am guessing that “dim” refers to a new “dimension” atom class, and it 
appears that the table determining the spacing between atoms does not include 
space between this dimension class and the binary or relation classes. I don’t 
know that this is the problem, but this is my best guess.

If this is the problem, is there a way I can add this space to the necessary 
table? If this is not the problem, I’m open to any other insight or advice.

Thanks,
Gavin


> On Oct 8, 2022, at 11:59 AM, Gavin  wrote:
> 
> Hi list,
> 
> I made a small example with all of the issues I am trying to fix for the 
> \units command. The first formula below uses the \unit command, but produces 
> strange spacing. The second formula produces the desired spacing, without 
> using the \unit command.
> 
> \showmakeup[mathglue] %\mathspacingmode=1
> 
> \starttext
> \startformula
> \unit{1.23e5 kg m^2/s^2} + \unit{8.64e5 W s} = \unit{9.87e5 newton m}
> \stopformula
> \startformula
> 1.23\mathord\times10^5\,{\rm kg\mathord\cdot m^2/s^2} + 
> 8.64\mathord\times10^5\,{\rm W\mathord{\cdot}s} = 
> 9.87\mathord\times10^5\,{\rm N\mathord{\cdot}m}
> \stopformula
> \stoptext
> 
> I’m trying to fix four issues:
>  - No space between the number and the following units. Should be a thin 
> space.
>  - No space between the units and the following symbol (+ and = above). 
> Should be appropriate “bin" or “rel" space.
>  - Too much space around the \cdot in the units. Should be treated like an 
> “ord" when used to separate units.
>  - Too much space around the \times in the scientific notation. Should be 
> treated like an "ord" when used in scientific notation. (I'm not sure there 
> is consensus on this.)
> 
> Some of these seemed like things I could fix myself, so I dug into 
> phys-dim.mkxl to see what I could do. The good news is that I didn’t break 
> anything. The bad news is that nothing I did seemed to have any effect – 
> including deleting phys-dim.mkxl entirely! I double checked that I was 
> working on the same installation used for typesetting. Is the code used for 
> \unit now somewhere else?
> 
> These issues only occur in math mode, and \unit handles comma separators 
> correctly, unlike \digit.
> 
> I’d like to get some sort of temporary patch for at least some of these 
> issues, even if I need to write it myself. I use \unit everywhere in physics 
> problems sets for students and in keys that I share other teachers.
> 
> Any guidance is appreciated!
> 
> Gavin
> 
> P.S. I’m working on a more comprehensive test file, but its not ready yet.

___
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] regular online meet-up

2022-10-12 Thread Alain Delmotte via ntg-context

Hi,

Unfortunately at that time I am not free.

Have a very good meeting.

All the best, Alain

Le 9/10/2022 à 12:41, Henning Hraban Ramm via ntg-context a 
écrit :
You’re invited to join on Wednesday, October 12th, 15:00 
CEST (UTC+2)


at https://lecture.senfcall.de/hen-rbr-rku-oke
(same, but shorter: https://v34h.de/ctxmtg)

ConTeXt users of all levels are welcome!

Next meeting will be on November 9th.


(Same blurb as every time:)

[Howto]
* No special software installation required; most modern 
browsers should work (WebRTC required).

* Open the above URL, accept the privacy statement,
* enter your name,
* click "join" (or "start" if you’re the first),
* click "with microphone", allow your browser to access 
it, check the audio.
* Your microphone is muted if you join. Activate 
microphone and/or camera with the buttons at the bottom.
* Minimize the default presentation with the "screen" 
button, bottom right.


* If you’d like to share your screen or upload a file, you 
can make yourself the presenter: Click on your user name, 
change the setting, then you’ll see the "screen sharing" 
button beside the camera button; also there’s now "manage 
presentations" behind the "plus" button.
Beware there is only one presenter at a time, so don’t 
kill someone else’s presentation.


[Technical hints]
* Sound is usually better if you use a headset (less noise 
for everyone).


* Connection problems are mostly due to low bandwidth or 
high latency on your side, e.g. with mobile connections.
* If audio/video doesn’t work for you, you can still use 
the text chat.

* Screen sharing needs a lot of bandwidth.

* BigBlueButton documentation applies: 
https://bigbluebutton.org/teachers/tutorials/


[Netiquette]
* Please use a name that we recognize from here. Some feel 
uncomfortable with anonymous lurkers.

* Mute your microphone while you’re not talking.
* It’s nice to show your face at least when you join.
* If there are connection problems, stop camera sharing.
* The room is set to “everyone’s a moderator“, I trust you...

See you, 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
___ 

___
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] LMTX generates PDFs with non-working fonts on real printers

2022-10-12 Thread Leah Neukirchen via ntg-context
Max Chernoff via ntg-context  writes:

> Hi Leah,
>
>
>> > Leah and I are zooming in on the issue. It might relate to wrong font
>> > matrix default behavior in the pdf printer driver, and GS got a fix
>> > for that long ago, so maybe old printers with not-updated drivers can
>> > be affected.
>> >
>> > Once we're confident that we can catch it Leah (who does the low level
>> > introspective testing with viewers, printers and tools) likely will
>> > report on it and there will be a test file for users to test if what
>> > we do is okay before we apply the safeguard.
>> 
>> There's a write up now on the issue:
>> https://leahneukirchen.org/blog/archive/2022/10/50-blank-pages-or-black-box-debugging-of-pdf-rendering-in-printers.html
>
> Great write up! I was expecting the issue to be something quite simple,
> but it's actually fairly complicated. Especially considering that the
> issue only happens with a few printer models, I'm pretty impressed that
> you managed to find the problem. At least the fix appears quite easy.
>
> Seeing that you're modifying the font encoding, could you perhaps
> reconsider supporting hinting in LMTX? 
>
>https://mailman.ntg.nl/pipermail/ntg-context/2022/106311.html
>
> Even with a high resolution screen, I can still see a difference, and
> the issue can show up in print too:
>
>
>https://graphicdesign.stackexchange.com/q/5874
>
> I'm fairly confident that these issues are all hinting-related:
>
>https://mailman.ntg.nl/pipermail/ntg-context/2022/106874.html
>https://mailman.ntg.nl/pipermail/ntg-context/2022/105212.html
>
> Considering that all of the fonts included with ConTeXt are hinted, it
> seems like a shame to not include any of that data in the generated
> PDFs.

The last version of font-cff.lua should also copy the hinting-related
values of the CFF properly (/BlueScale, /StemSnap[HV] etc).
We fixed that on the side. ;)

-- 
Leah Neukirchenhttps://leahneukirchen.org
___
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] regular online meet-up

2022-10-12 Thread Henning Hraban Ramm via ntg-context

Reminder: That’s in less than 4 hours.

Hoping to see you soon!
Hraban

Am 09.10.22 um 12:41 schrieb Henning Hraban Ramm via ntg-context:

You’re invited to join on Wednesday, October 12th, 15:00 CEST (UTC+2)

at https://lecture.senfcall.de/hen-rbr-rku-oke
(same, but shorter: https://v34h.de/ctxmtg)

ConTeXt users of all levels are welcome!

Next meeting will be on November 9th.


(Same blurb as every time:)

[Howto]
* No special software installation required; most modern browsers should 
work (WebRTC required).

* Open the above URL, accept the privacy statement,
* enter your name,
* click "join" (or "start" if you’re the first),
* click "with microphone", allow your browser to access it, check the 
audio.
* Your microphone is muted if you join. Activate microphone and/or 
camera with the buttons at the bottom.

* Minimize the default presentation with the "screen" button, bottom right.

* If you’d like to share your screen or upload a file, you can make 
yourself the presenter: Click on your user name, change the setting, 
then you’ll see the "screen sharing" button beside the camera button; 
also there’s now "manage presentations" behind the "plus" button.
Beware there is only one presenter at a time, so don’t kill someone 
else’s presentation.


[Technical hints]
* Sound is usually better if you use a headset (less noise for everyone).

* Connection problems are mostly due to low bandwidth or high latency on 
your side, e.g. with mobile connections.

* If audio/video doesn’t work for you, you can still use the text chat.
* Screen sharing needs a lot of bandwidth.

* BigBlueButton documentation applies: 
https://bigbluebutton.org/teachers/tutorials/


[Netiquette]
* Please use a name that we recognize from here. Some feel uncomfortable 
with anonymous lurkers.

* Mute your microphone while you’re not talking.
* It’s nice to show your face at least when you join.
* If there are connection problems, stop camera sharing.
* The room is set to “everyone’s a moderator“, I trust you...

See you, 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
___


___
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] \quotation, protrusion and linebreaking

2022-10-12 Thread Henning Hraban Ramm via ntg-context

Am 11.10.22 um 21:06 schrieb Leah Neukirchen:

Henning Hraban Ramm via ntg-context  writes:

\setupdelimitedtext[quotation][method=font]


That fixes both issues, thanks!

Not sure where I should have learned this exists, however. ;)


Oops, I answered only to Leah:

I agree. Someone (Hans or Wolfgang, probably) told me at one time, or I 
picked it up from a discussion on the list, and it’s part of my default 
setup since.


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
___