ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <j.hagen@xs4all.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>,
	Shuxian Wang <wsx@udscbt.io>
Subject: Re: Multi-letter words/identifiers in math
Date: Mon, 30 Sep 2019 15:22:41 +0200	[thread overview]
Message-ID: <c3b052d4-c6ab-2f8d-5977-1c04e5940799@xs4all.nl> (raw)
In-Reply-To: <2C87AD65-D3D3-4AAF-96F7-B4D23F213153@udscbt.io>

On 9/29/2019 9:30 AM, Shuxian Wang wrote:
> Dear list,
> 
> I am trying to typeset some multi-letter words/identifiers in 
> mathematical formulas. Currently, doing things like |{\it variable}| or 
> |{\mathit variable}| under math mode will cause the engine to shift all 
> characters into the corresponding unicode mathematical alphanumeric 
> block position. However, most OpenType fonts that have good support for 
> unicode math are optimized for single-character usage. Therefore, the 
> outcome of such method is non-ideal, as no kerning or ligatures will be 
> enabled. Especially, this gives bad output when typesetting variable 
> names with combinations like “ffi”.
> 
> Looking through some past discussions on the list, I am aware of the 
> usage of |\mathword| and |\mathtext|. Using those command will keep all 
> the characters “as is” and typeset them under text mode (as far as I can 
> tell). But those commands switch to the main body fonts temporarily to 
> accomplish this. Sometime when using a different math font than the main 
> font (like Palatino with Latin Modern Math), I wish my variable names 
> can also be in the math font (or at least very similar, such as Latin 
> Modern vs. Latin Modern Math) to better merge with the formula.
> 
> The way I am currently doing is to introduce some “math text fonts” that 
> is different from the main text font but close to the math font. And 
> with custom font switchers like |\mwrm| and |\mwit| to help me define 
> things like
> |
> \def\wordrm#1{\mbox{\mwrm #1}}
> \def\wordit#1{\mbox{\mwit #1}}
> |
> Am I missing some builtin functionalities or easier ways to do this? If 
> not, would it be a good idea to extend the functionality of |\mathword| 
> so it lifts out the restriction of only using the main text font?
maybe \mfunction{...} is what you are looking for

-----------------------------------------------------------------
                                           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 / 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
___________________________________________________________________________________

  reply	other threads:[~2019-09-30 13:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-29  7:30 Shuxian Wang
2019-09-30 13:22 ` Hans Hagen [this message]
     [not found]   ` <CAA58SD99+xNeyEPQGU6ELHurO35+RVDUTjUanSfG5xMJnweHJA@mail.gmail.com>
2019-10-01 17:28     ` Hans Hagen

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=c3b052d4-c6ab-2f8d-5977-1c04e5940799@xs4all.nl \
    --to=j.hagen@xs4all.nl \
    --cc=ntg-context@ntg.nl \
    --cc=wsx@udscbt.io \
    /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).