10

I want to use \definefontfamily, and according to contextgarden.net, it should be included by default:

As of December 2013, the functionality of the Simplefonts module has been included into the ConTeXt core. You do no longer need to load any external module to take advantage of the simplified font commands. However, the commands have slightly changed: \setmainfont is now \definefontfamily [myfamily] [serif] [DejaVu] (and the same syntax to set the sans, mono and math font). To use this family: \setupbodyfont [myfamily]

I am using Mac OS X, and I used TeX Live to update to the latest version of Context. However, it breaks when I try (undefined control sequence):

\definefontfamily[mainface][serif][Adobe Garamond Pro]

\starttext 
 test 
\stoptext

This works:

\usemodule   [simplefonts] \setmainfont [Adobe Garamond Pro]

%\definefontfamily[mainface][serif][Adobe Garamond Pro]

\starttext 
 test
\stoptext

What do I have to do? I am VERY new to Context.

3
  • 1
    that doesn't work with the context from TeXLive, you have to use the stand-alone version from wiki.contextgarden.net/ConTeXt_Standalone
    – user2478
    Feb 26, 2014 at 13:34
  • You are the best, Herbert! Can you put this in an answer so that I can mark you correct? Feb 26, 2014 at 13:39
  • Maybe you used the wrong engine, do you use the default ConTeXt engine of TeXShop for typesetting? Please give out the console output when you met the "undefined control sequence" issue.
    – user49004
    Apr 1, 2014 at 2:29

2 Answers 2

5

That doesn't work with the context from TeXLive, you have to use the standalone version from http://wiki.contextgarden.net/ConTeXt_Standalone

You have to execute . /opt/context/tex/setuptex (there is a space after the dot!) to get the correct path setting. Otherwise it will use the files from the current TeXLive.

ConTeXt on TeXLive is not often updated.

4
  • Unfortunately, that did not work. I just completed the installation, and even linked it to TeXShop, and '\definefontfamily' is getting an 'Undefined control sequence' error, whether I use MKII, MKIV, or Context-Xetex. Feb 27, 2014 at 2:10
  • 1
    It works only in MKIV! And, of course you have to execute . /opt/context/tex/setuptex to get the correct path setting. Otherwise it will use the files from TeXLive
    – user2478
    Feb 27, 2014 at 9:04
  • Do I need to modify the script in any way? I ran it and it did not fix anything. The wiki mentions changing the line "# TODO: we could set OSFONTDIR on Mac for example", but that is not in the script anymore. Feb 27, 2014 at 11:13
  • 1
    write a small test file \starttext foo \stoptext save it and then open a terminal, go into the ConTeXt directory and run that test file to see what's happen.
    – user2478
    Feb 27, 2014 at 11:16
2

As of December 2013, the functionality of the Simplefonts module has been included into the ConTeXt core. You do no longer need to load any external module to take advantage of the simplified font commands. However, the commands have slightly changed: \setmainfont is now \definefontfamily [myfamily] [serif] [DejaVu] (and the same syntax to set the sans, mono and math font). To use this family: \setupbodyfont [myfamily]

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .