Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am struggling to switch the fonts in ConTeXt accordingly and feel that I am missing something basic. I try to mimic

\RequirePackage{fontspec}

% Use Neo Euler as math font
\RequirePackage[vargreek-shape=TeX]{unicode-math}% 
\setmathfont{Asana Math}%
% Use the Palatino-Clone Tex Gyre Pagella as main font
\setmainfont[Ligatures=TeX, Numbers=OldStyle]{Tex Gyre Pagella}%
% Use Tex Gyre Cursor as Monospace Font
\setmonofont{Tex Gyre Cursor}%
% Use Tex Gyre Heros Cn as Sans Serif Font
\setsansfont{Tex Gyre Heros}%
% fontsize is 10pt, 13pt for book and 12pt, 15pt for handout
\renewcommand{\normalsize}{\fontsize{10pt}{13pt}\selectfont}%
% fontsize is 10pt, 13pt for book and 9pt, 11pt for kindle
\renewcommand{\footnotesize}{\fontsize{8pt}{10pt}\selectfont}%

which works fine in a LuaLaTeX file.

My best try so far is

%setup the fonts
\usemodule[simplefonts] 
\definefontfeature[default][default][onum=yes]
%
\setmathfont[Asana Math]%
% Use the Palatino-Clone Tex Gyre Pagella as main font
\setmainfont[Tex Gyre Pagella]%
% Use Tex Gyre Cursor as Monospace Font
\setmonofont[Tex Gyre Cursor]%
% Use Tex Gyre Heros Cn as Sans Serif Font
\setsansfont[Tex Gyre Heros]%
\setupbodyfont[TeX Gyre Pagella,10pt]

\definebodyfontenvironment [10pt] [a=16pt]

\starttext
italic but not math \it mathmode 123

$123 mathmode$

\tfa Big
\stoptext

I know that a couple of things go wrong here. My question is now: What is best practice in context? I feel that I am mixing simplefonts macros (setmainfont) with context-core ones (\setupbodyfont[TeX Gyre Pagella,10pt]).

Could someone clarify if I have to use different simplefonts macros for e.g. fontsize? Do I have to decide, either only context-core or simplefonts. And which one is recommended?

share|improve this question
    
Is there a preferred way? I guess without module is recommended? –  Andy May 10 '12 at 15:49
add comment

3 Answers 3

up vote 7 down vote accepted

Simplefonts based solution:

\definefontfeature[default][default][onum=yes]
\usemodule[simplefonts][size=10pt]

\setmathfont[Asana]
\setmainfont[Tex Gyre Pagella]
\setmonofont[Tex Gyre Cursor]
\setsansfont[Tex Gyre Heros]

\definebodyfontenvironment [10pt] [a=16pt]

\starttext
italic but not math {\it mathmode 123}

$123 mathmode$

\tfa Big

\stoptext
share|improve this answer
add comment

Typescript-based version :

\usetypescriptfile[asana]

\definefontfeature[default][default][onum=yes]

\starttypescript[me]
    \definetypeface [me] [rm] [serif] [pagella] [default]
    \definetypeface [me] [ss] [sans]  [heros]   [default]
    \definetypeface [me] [tt] [mono]  [cursor]  [default]
    \definetypeface [me] [mm] [math]  [asana]   [default]
\stoptypescript

\definebodyfontenvironment [10pt] [a=16pt]

\setupbodyfont[me,10pt]

\starttext
italic but not math \it mathmode 123

$123 mathmode$

\tfa Big
\stoptext
share|improve this answer
    
error on line 19 in file file.tex: Math error: parameter \Umathquad\displaystyle is not set. Line 19 is $123 mathmode$. –  Dave Jarvis Sep 22 '13 at 6:23
    
Either you do not have the Asana font installed, or your ConTeXt is too old (the first is likelier). –  Taco Hoekwater Sep 30 '13 at 8:40
add comment

The best practice in my opinion is to use typescripts. The Context-Wiki is always a great place to look for Context specific stuff. In this case it's Fonts in Context (LauTeX).

share|improve this answer
3  
What would be the code in the case at hand? –  egreg May 10 '12 at 10:05
    
The given code is derived from that page (section:"With the simplefonts module") and kind of works, but my question goes in a different direction. –  Andy May 10 '12 at 10:30
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.