ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: Textfont in math-formulas?
Date: Thu, 07 Apr 2005 10:55:19 +0200	[thread overview]
Message-ID: <4254F577.5050902@wxs.nl> (raw)
In-Reply-To: <200504062121.15662.kai.straube@gmx.de>

Kai Straube wrote:

> I have a little problem with fonts in my document. I use the cm sans serif 
> font in my text and want to have this in the tex-formulas to, but it worked 
> not for me.
> Simple example:
> 
> \enableregime[utf]
> \setupoutput[pdf]
> \mainlanguage[de]
> \language[de]

you can omit \language since you've already set the main language (after that 
language is used for local language switching)

> \setuppapersize[A4]
> \setupbodyfont[ss]
> 
> \starttext
> Some text, we can read it without serifs. But the formula: $ \frac{1}{x-2} $ 
> is not in the same font.
> \stoptext

for that you need a ss math font; in the simple case it could be made to work 
but since in math characters can come from any of the (about) 4 math fonts you 
would get inconsistent output. So, if you want to gamble, you may try this:

% define a typeface

\definetypeface [modern] [rm] [serif] [modern-base] [default]
\definetypeface [modern] [ss] [sans]  [modern-base] [default]
\definetypeface [modern] [tt] [mono]  [modern-base] [default]
\definetypeface [modern] [mm] [math]  [modern-base] [default]

% overloaad a mapping

% \startfontclass[modern]
%   \definefontsynonym [ComputerModernMath-Roman]  [ComputerModernSans]
%   \definefontsynonym [ComputerModernMath-Italic] [ComputerModernSans-Italic]
% \stopfontclass

\startfontclass[modern]
   \definefontsynonym [MathRoman]  [Sans]
   \definefontsynonym [MathItalic] [SansItalic]
\stopfontclass

% initialize the typeface

\setupbodyfont[modern,ss]

\starttext
Some text, we can read it without serifs. But the formula: $ \frac{1}{x-2} $
is not in the same font.
\stoptext

you can put this in one of the dark corners of the wiki -)

Hans


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

      parent reply	other threads:[~2005-04-07  8:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20050328194852.CB04012866@ronja.ntg.nl>
2005-04-06 19:21 ` Kai Straube
2005-04-07  6:30   ` Eckhart Guthöhrlein
2005-04-07  8:55   ` Hans Hagen [this message]

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=4254F577.5050902@wxs.nl \
    --to=pragma@wxs.nl \
    --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).