ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* partial derivatives with bonum/pagella font
@ 2013-05-22  8:46 Mikael P. Sundqvist
  2013-05-22 10:01 ` Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: Mikael P. Sundqvist @ 2013-05-22  8:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 318 bytes --]

Hi all,

The following examples give wrong space. There is a space between the prime
and the subscripted x. If I do not load the bonum font it just looks as it
should.

\setupbodyfont[bonum]
\starttext
$f'_x$, $f_x'$ $f\prime_x$.
\stoptext

(it does not look good with the pagella font either...)

Any ideas?

/Mikael

[-- Attachment #1.2: Type: text/html, Size: 435 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: partial derivatives with bonum/pagella font
  2013-05-22  8:46 partial derivatives with bonum/pagella font Mikael P. Sundqvist
@ 2013-05-22 10:01 ` Hans Hagen
  2013-05-22 10:11   ` Mikael P. Sundqvist
  0 siblings, 1 reply; 5+ messages in thread
From: Hans Hagen @ 2013-05-22 10:01 UTC (permalink / raw)
  To: ntg-context

On 5/22/2013 10:46 AM, Mikael P. Sundqvist wrote:
> Hi all,
>
> The following examples give wrong space. There is a space between the
> prime and the subscripted x. If I do not load the bonum font it just
> looks as it should.
>
> \setupbodyfont[bonum]
> \starttext
> $f'_x$, $f_x'$ $f\prime_x$.
> \stoptext
>
> (it does not look good with the pagella font either...)
>
> Any ideas?

cambria is the benchmark ... indeed bonum looks somewhat weird (also 
because the f is rather tightly bounded; the same with pagella)

(there are some primes-*.tex test files in the test suite)

the primes mechanism is somewhat non-trivial as ' is not really the 
prime symbol and some additional parsing / hackery happens; also, 
traditionally primes in tex sit on the baseline and need to be lifted

one problem is that texgyre math is still beta so messing around at the 
tex end will interfere with improvements

Hans

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: partial derivatives with bonum/pagella font
  2013-05-22 10:01 ` Hans Hagen
@ 2013-05-22 10:11   ` Mikael P. Sundqvist
  2013-05-22 12:22     ` Sietse Brouwer
  0 siblings, 1 reply; 5+ messages in thread
From: Mikael P. Sundqvist @ 2013-05-22 10:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2344 bytes --]

OK!

is there a quick fix/hack that somehow allows me to get it look "almost
like it should" in a small document today with bonum? I'll give a
presentation tomorrow, and if this is not the case I'll change the notation
of partial derivative to the one using \partial instead...

/Mikael


On Wed, May 22, 2013 at 12:01 PM, Hans Hagen <pragma@wxs.nl> wrote:

> On 5/22/2013 10:46 AM, Mikael P. Sundqvist wrote:
>
>> Hi all,
>>
>> The following examples give wrong space. There is a space between the
>> prime and the subscripted x. If I do not load the bonum font it just
>> looks as it should.
>>
>> \setupbodyfont[bonum]
>> \starttext
>> $f'_x$, $f_x'$ $f\prime_x$.
>> \stoptext
>>
>> (it does not look good with the pagella font either...)
>>
>> Any ideas?
>>
>
> cambria is the benchmark ... indeed bonum looks somewhat weird (also
> because the f is rather tightly bounded; the same with pagella)
>
> (there are some primes-*.tex test files in the test suite)
>
> the primes mechanism is somewhat non-trivial as ' is not really the prime
> symbol and some additional parsing / hackery happens; also, traditionally
> primes in tex sit on the baseline and need to be lifted
>
> one problem is that texgyre math is still beta so messing around at the
> tex end will interfere with improvements
>
> Hans
>
> ------------------------------**------------------------------**-----
>                                           Hans Hagen | PRAGMA ADE
>               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>                                              | www.pragma-pod.nl
> ------------------------------**------------------------------**-----
> ______________________________**______________________________**
> _______________________
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/**
> listinfo/ntg-context <http://www.ntg.nl/mailman/listinfo/ntg-context>
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/**projects/contextrev/<http://foundry.supelec.fr/projects/contextrev/>
> wiki     : http://contextgarden.net
> ______________________________**______________________________**
> _______________________
>

[-- Attachment #1.2: Type: text/html, Size: 3478 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: partial derivatives with bonum/pagella font
  2013-05-22 10:11   ` Mikael P. Sundqvist
@ 2013-05-22 12:22     ` Sietse Brouwer
  2013-05-22 17:00       ` Mikael P. Sundqvist
  0 siblings, 1 reply; 5+ messages in thread
From: Sietse Brouwer @ 2013-05-22 12:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Mikael,

> is there a quick fix/hack that somehow allows me to get it look "almost like
> it should" in a small document today with bonum?

This might get you somewhere. I hope you don't have too many double
primes in your document...

NB: `%macros=mkvi` has to be the first line in the file.

Cheers,
Sietse

% macros=mkvi

\setupbodyfont[bonum]

% This macro takes 1 arguments, #upper. It postfixes a negative kern just a
% bit larger than the width of #upper, so that #upper does not push
% the next content away to the right.
\def\myprime#upper%
   {% 1. Store the width of the primes in a box, so we can get its width
    \setbox\scratchbox=\hbox{$#upper$}%
    % 2. We'll want to kern back by a bit more than
    \scratchdimen=\dimexpr \wd\scratchbox + 0.3em \relax%
    % The actual typesetting
    \kern 0em #upper\kern -\scratchdimen}

\starttext
    % Quick and dirty 1: just pretend the prime is uppercased
    $f'_x$, $f_x'$ $f^{\prime\prime}_x$.

    % Less quick, still dirty: the \myprime macro defined above
    $f'_x$, $f_x'$ $f\myprime{\prime\prime}_x$.

    % Slow and dirty: add a kern between the \primes,
    % because bonum pushes them apart a bit.
    $f'_x$, $f_x'$ $f\myprime{\prime\kern -0.1em \prime}_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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: partial derivatives with bonum/pagella font
  2013-05-22 12:22     ` Sietse Brouwer
@ 2013-05-22 17:00       ` Mikael P. Sundqvist
  0 siblings, 0 replies; 5+ messages in thread
From: Mikael P. Sundqvist @ 2013-05-22 17:00 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2156 bytes --]

Thank you very much Sietse! This fits my needs for the students for
tomorrow...

I also defined
\def\sprime{\myprime{\prime}}
\def\dprime{\myprime{\prime\kern-0.1em\prime}}

Then $f\sprime_x$ and $f\dprime_{xx}$ is not too hard to write :)

/Mikael


On Wed, May 22, 2013 at 2:22 PM, Sietse Brouwer <sbbrouwer@gmail.com> wrote:

> Hi Mikael,
>
> > is there a quick fix/hack that somehow allows me to get it look "almost
> like
> > it should" in a small document today with bonum?
>
> This might get you somewhere. I hope you don't have too many double
> primes in your document...
>
> NB: `%macros=mkvi` has to be the first line in the file.
>
> Cheers,
> Sietse
>
> % macros=mkvi
>
> \setupbodyfont[bonum]
>
> % This macro takes 1 arguments, #upper. It postfixes a negative kern just a
> % bit larger than the width of #upper, so that #upper does not push
> % the next content away to the right.
> \def\myprime#upper%
>    {% 1. Store the width of the primes in a box, so we can get its width
>     \setbox\scratchbox=\hbox{$#upper$}%
>     % 2. We'll want to kern back by a bit more than
>     \scratchdimen=\dimexpr \wd\scratchbox + 0.3em \relax%
>     % The actual typesetting
>     \kern 0em #upper\kern -\scratchdimen}
>
> \starttext
>     % Quick and dirty 1: just pretend the prime is uppercased
>     $f'_x$, $f_x'$ $f^{\prime\prime}_x$.
>
>     % Less quick, still dirty: the \myprime macro defined above
>     $f'_x$, $f_x'$ $f\myprime{\prime\prime}_x$.
>
>     % Slow and dirty: add a kern between the \primes,
>     % because bonum pushes them apart a bit.
>     $f'_x$, $f_x'$ $f\myprime{\prime\kern -0.1em \prime}_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://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
>
> ___________________________________________________________________________________
>

[-- Attachment #1.2: Type: text/html, Size: 3132 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-05-22 17:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-22  8:46 partial derivatives with bonum/pagella font Mikael P. Sundqvist
2013-05-22 10:01 ` Hans Hagen
2013-05-22 10:11   ` Mikael P. Sundqvist
2013-05-22 12:22     ` Sietse Brouwer
2013-05-22 17:00       ` Mikael P. Sundqvist

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).