[NTG-context] Re: Fractions

2023-12-10 Thread Gavin via ntg-context
Hello fraction fascinated friends,

> On Dec 10, 2023, at 5:24 AM, Henning Hraban Ramm  wrote:
> 
> Am 09.12.23 um 23:30 schrieb Mikael Sundqvist:
>> Hi,
>> On Sat, Dec 9, 2023 at 4:39 PM Wolfgang Schuster
>>  wrote:
>>> 
>>> Fabrice Couvreur schrieb am 09.12.2023 um 17:19:
>>> 
>>> Very clear !
>>> In typography for Mathematics books, what choice should we make for the 
>>> best possible result ?
>>> 
>>> A question better answered by Mikael or Aditya!
>> Thank you for your trust, Wolfgang. I am not sure I have something
>> valuable to say in addition to Adityas suggestion \frac{1/3} in inline
>> math. In any case, I attach a passage, with suggestions inspired by
>> Lansburgh's book (iin Swedish). Not sure the file size makes it
>> through to the list, though.
> 
> Thank you!
> 
> I usually only need simple inline fractions like 1/n, 1/2 or 3/8 in text.
> With these and \frac, the spacing below the numerator (depth) is too big, 
> while the denominator sticks too tightly to the fraction bar.
> (Of course I use regular numbers for fractions, not mediaeval.)
> 
> Usually I’d prefer “vulgar fractions”, but \vulgarfraction looks “horrible” 
> in comparison to the few usual fractions contained in fonts (like ½ & ¾).
> 
> I tried to use the OpenType fraction features to no avail.
> 
> So I’m still looking for “the best” solution for simple fractions inline.
> 
> Hraban

I also use fractions frequently, so I’ve tried a few things.

Some fonts have superior and inferior numbers that can be used to make small 
slash fractions. I’ve done this, but my method is not pretty. Hraban suggested 
using font features for this, but I haven’t learned how to do that. Any advice 
is welcome.

Example code below uses the Libertinus font, which has these superior and 
inferior numbers, to produce sample paragraph demonstrating a few options for 
fractions in text.

Gavin


\usetypescriptfile[libertinus]
\setupbodyfont [libertinus,11pt]%
\setupinterlinespace[line=3.1ex]

\define\fracone{\getnamedglyphdirect{libertinus}{onesuperior}} % 1
\define\fracthree{\getnamedglyphdirect{libertinus}{threesuperior}} % 3
\define\fracnine{\getnamedglyphdirect{libertinus}{ninesuperior}} % 9

\define\thirteenths{\textfraction\getnamedglyphdirect{libertinus}{oneinferior}\getnamedglyphdirect{libertinus}{threeinferior}}
 % /13

\define\onethirteenth{\text{\fracone\thirteenths}} % 1/13
\define\threethirteenths{\text{\fracthree\thirteenths}} % 3/13
\define\ninethirteenths{\text{\fracnine\thirteenths}} % 9/13

\starttext
Some small fractions are already available in many fonts, like \onehalf\ and 
\onethird. Others can be built using superior and inferior numbers in some 
fonts. This includes the fractions required to
find the normal and shearing stresses on an oblique plane defined by 
$l=\sqrt{\threethirteenths}$, $m=\sqrt{\onethirteenth}$, and 
$n=\sqrt{\ninethirteenths}$.
Of course, you could just find the normal and shearing stresses on an oblique 
plane defined by $l=\sqrt{3/13}$, $m=\sqrt{1/13}$, and $n=\sqrt{9/13}$.
Vulgar fractions are between these extremes.
Find the normal and shearing stresses on an oblique plane defined by 
$l=\sqrt{\vfrac{3}{13}}$, $m=\sqrt{\vfrac{1}{13}}$, and 
$n=\sqrt{\vfrac{9}{13}}$.
I included more text than strictly necessary in this example to demonstrate the 
effect on line spacing.
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Fractions

2023-12-10 Thread Henning Hraban Ramm

Am 09.12.23 um 23:30 schrieb Mikael Sundqvist:

Hi,

On Sat, Dec 9, 2023 at 4:39 PM Wolfgang Schuster
 wrote:


Fabrice Couvreur schrieb am 09.12.2023 um 17:19:

Very clear !
In typography for Mathematics books, what choice should we make for the best 
possible result ?

A question better answered by Mikael or Aditya!


Thank you for your trust, Wolfgang. I am not sure I have something
valuable to say in addition to Adityas suggestion \frac{1/3} in inline
math. In any case, I attach a passage, with suggestions inspired by
Lansburgh's book (iin Swedish). Not sure the file size makes it
through to the list, though.


Thank you!

I usually only need simple inline fractions like 1/n, 1/2 or 3/8 in text.
With these and \frac, the spacing below the numerator (depth) is too 
big, while the denominator sticks too tightly to the fraction bar.

(Of course I use regular numbers for fractions, not mediaeval.)

Usually I’d prefer “vulgar fractions”, but \vulgarfraction looks 
“horrible” in comparison to the few usual fractions contained in fonts 
(like ½ & ¾).


I tried to use the OpenType fraction features to no avail.

So I’m still looking for “the best” solution for simple fractions inline.

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: margin bigger than backspace pushes it outside the edge

2023-12-10 Thread Bruce Horrocks
On 10 Dec 2023, at 10:30, Jigé via ntg-context  wrote:
> 
> I've been struggling with basic page layout.
> 
> The left margin extends outside the left edge of the page.
> Example (from the wiki):

I don't know why it is like this but changing it now would probably break a lot 
of documents that rely on the defaults.

I suspect that most people, me included, simply adjust margin sizes until they 
have a pleasing result. This would only become a problem if margin text is used 
a lot.

The following corrects for the left margin starting off the page for both 
single and doublesided documents. The remainder of the settings will need 
adjusting to suit your specific circumstances.

\setuppapersize[A4][A3]
\setuplayout[location=middle]
\setuppagenumbering[alternative=doublesided]
\setuplayout[backspace=30.8mm]
\starttext
\showlayout[4,pt,cm]
\stoptext

—
Bruce Horrocks
Hampshire, UK

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: margin bigger than backspace pushes it outside the edge

2023-12-10 Thread Jigé via ntg-context
 Thanks Wolfgang.

Is this expected behavior? I'm very much confused with my second example:

\setuppapersize[A5][A4]
%\setuplayout[location=middle]
\setuplayout[location=middle,width=middle]
%\setuplayout[location=middle,width=middle,backspace=2.5cm]
\usemodule[ipsum]
\starttext
\showframe
Hello
\stoptext

With just \setuplayout[location=middle] the left margin gets outside the left 
edge, there's also a gap to the right of the right margin and, to the eye, it 
seems that the sum 
leftmargin+leftmargindistance+textwidth+rightmargindistance+rightmargin doesn 
not match the page width.

With \setuplayout[location=middle,width=middle] all is symmetrical but the two 
margins go outside the edges.

With e.g. \setuplayout[location=middle,width=middle,backspace=2.5cm] I can fit 
everything by manually adjusting the backspace to I'm not sure what the right 
value.

I couldn't adjust the page layout on some more complex document, so I'm going 
back to the most basic layout and trying to make it work on the simplest 
document possible.

JG Le dimanche 10 décembre 2023 à 11:53:07 UTC+1, Wolfgang Schuster 
 a écrit :  
 
 Jigé via ntg-context schrieb am 10.12.2023 um 11:30:
> Hi all,
> I've been struggling with basic page layout.
>
> The left margin extends outside the left edge of the page.
> Example (from the wiki):
>
> \setuppapersize[A4][A4] % this is the default and may be omitted
> \setuplayout[backspace=20mm,

leftmargin=10mm,
leftmargindistance=5mm,

>      width=110mm,
>      topspace=20mm,
>      header=0mm,
>      footer=0mm,
>      height=250mm]
> \starttext
> \showlayout
> \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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Fractions (was \placefigure[location=here...] problem)

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

On 12/9/2023 4:33 PM, Aditya Mahajan wrote:

On Sat, 9 Dec 2023, Wolfgang Schuster wrote:


\starttext

\startlines
\type{\frac{1}{3}}: \m{\frac{1}{3}}
\type{\xfrac{1}{3}}: \m{\xfrac{1}{3}}
\type{\xxfrac{1}{3}}: \m{\xxfrac{1}{3}}
\type{\tfrac{1}{3}}: \m{\tfrac{1}{3}}
\type{\sfrac{1}{3}}: \m{\sfrac{1}{3}}
\type{\frac{1}{3}}: \m{\frac{1}{3}}
\type{\dfrac{1}{3}}: \m{\dfrac{1}{3}}
\type{\cfrac{1}{3}}: \m{\cfrac{1}{3}}
\type{\vfrac{1}{3}}: \m{\vfrac{1}{3}}
\type{\hfrac{1}{3}}: \m{\hfrac{1}{3}}
\stoplines

\stoptext


Or, for inline math, $\sqrt{1/3}$.

radicals are somewhat special to deal with:

- multidimensional delimiter
- vertical spacing inside
- horizontal spacing oustside
- anchoring degrees
- left and right radicals
- more consistent rules (char based)
- size dependent additional spacing (avoid clash)
- normalize size across formula
- lack of granularity in variants sizes

by now we have dealt with all of that (some not in the current release), 
think of additional control in the engine, compensation for insufficient 
opentype math features, companion fonts with more sizes


there will always be suboptimal cases but the average is ok (we put 
radical - character kerning on hold because it is a lot of definitions) 
and we don't want to add hard to fight heuristics


so to inline: in most cases the solution that Adirya suggests will work 
out okay with respect toline spacing


Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: margin bigger than backspace pushes it outside the edge

2023-12-10 Thread Wolfgang Schuster

Jigé via ntg-context schrieb am 10.12.2023 um 11:30:

Hi all,
I've been struggling with basic page layout.

The left margin extends outside the left edge of the page.
Example (from the wiki):

\setuppapersize[A4][A4] % this is the default and may be omitted
\setuplayout[backspace=20mm,


leftmargin=10mm,
leftmargindistance=5mm,


     width=110mm,
     topspace=20mm,
     header=0mm,
     footer=0mm,
     height=250mm]
\starttext
\showlayout
\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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] margin bigger than backspace pushes it outside the edge

2023-12-10 Thread Jigé via ntg-context
Hi all,
I've been struggling with basic page layout.

The left margin extends outside the left edge of the page.
Example (from the wiki):

\setuppapersize[A4][A4] % this is the default and may be omitted
\setuplayout[backspace=20mm,
    width=110mm,
    topspace=20mm,
    header=0mm,
    footer=0mm,
    height=250mm]
\starttext
\showlayout
\stoptext

Another example:

\setuppapersize[A5][A4]
\setuplayout[location=middle]
\usemodule[ipsum]
\starttext
\showframe
\ipsum
\stoptext

Thanks,
Jean-Guillaume

mise_en_page-layout.pdf
Description: Adobe PDF document
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___