ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Sietse Brouwer <sbbrouwer@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: partial derivatives with bonum/pagella font
Date: Wed, 22 May 2013 14:22:22 +0200	[thread overview]
Message-ID: <CAF=dkzxMJK7cYSJyxrFGAwgSUBM8kr=DdvSWomd6Q142iYQORg@mail.gmail.com> (raw)
In-Reply-To: <CAHy-LL-RBaRK7XJZyyjjBsEMGUXyXYZMmFcKn7adza01k852Ww@mail.gmail.com>

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
___________________________________________________________________________________


  reply	other threads:[~2013-05-22 12:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-22  8:46 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 [this message]
2013-05-22 17:00       ` Mikael P. Sundqvist

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAF=dkzxMJK7cYSJyxrFGAwgSUBM8kr=DdvSWomd6Q142iYQORg@mail.gmail.com' \
    --to=sbbrouwer@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).