Hello list, Long term (silent) on-and-off user with two issues that require some support: 1. How can I use the Mathdesign GD math font in ConTeXt? I use simplefonts to load Adobe Garamond Pro, but mathdesigngd (name as reported by mtxrun fonts script) is somehow not found. At this time I fallback to ugly solutions with \text in math mode. And yes, I know about type-imp-mathdesign.mkiv, but obviously I'm not qualified enough to get it right. Minimal (not) working example: \usemodule[simplefonts] \setmainfont[Adobe Garamond Pro] \setmathfont[mathdesigngd] \starttext I want \m{x^2+y^2=z^2} in my text, and $\alpha\beta\gamma$ too. \stoptext 2. I would like to use the \followtokens macro from within metapost. How can this be achieved? Specifically, I trying to draw a rainbow-like figure with text "between" the colors. Regards, Magnus
On Mon, 7 Oct 2013 09:06:37 +0200
Magnus J
2. I would like to use the \followtokens macro from within metapost. How can this be achieved? Specifically, I trying to draw a rainbow-like figure with text "between" the colors.
I am not sure what you mean by a rainbow-like figure. However, for rainbow-like colors, I use the following MP code, based on the standard resistance color code scheme. The function rainbow(f) returns a rainbow spectrum color based on the fraction f running from 0 to 1. % standard resistance color code: rainbow sequence color resistance_color[] ; string resistance_name[] ; resistance_color0 = (0,0,0) ; resistance_name0 = "black" ; resistance_color1 = (165/255,42/255,42/255) ; resistance_name1 = "brown" ; resistance_color2 = (1,0,0) ; resistance_name2 = "red" ; resistance_color3 = (1,165/255,0) ; resistance_name3 = "orange" ; resistance_color4 = (1,1,0) ; resistance_name4 = "yellow" ; resistance_color5 = (0,1,0) ; resistance_name5 = "green" ; resistance_color6 = (0,0,1) ; resistance_name6 = "blue" ; resistance_color7 = (148/255,0,211/255) ; resistance_name7 = "darkviolet" ; resistance_color8 = (190/255,190/255,190/255) ; resistance_name8 = "gray" ; resistance_color9 = (1,1,1) ; resistance_name9 = "white" ; def rainbow(expr f) = hide(numeric n_ ; n_ = (abs(5f) mod 5) + 2 ;) (n_-floor(n_))[resistance_color[floor n_],resistance_color[ceiling n_]] enddef ; Alan
Thanks, nice scale. How about the arcs and the text between them?
Regards,
Magnus
On Mon, Oct 7, 2013 at 11:57 AM, Alan BRASLAU
On Mon, 7 Oct 2013 09:06:37 +0200 Magnus J
wrote: 2. I would like to use the \followtokens macro from within metapost. How can this be achieved? Specifically, I trying to draw a rainbow-like figure with text "between" the colors.
I am not sure what you mean by a rainbow-like figure. However, for rainbow-like colors, I use the following MP code, based on the standard resistance color code scheme. The function rainbow(f) returns a rainbow spectrum color based on the fraction f running from 0 to 1.
% standard resistance color code: rainbow sequence color resistance_color[] ; string resistance_name[] ; resistance_color0 = (0,0,0) ; resistance_name0 = "black" ; resistance_color1 = (165/255,42/255,42/255) ; resistance_name1 = "brown" ; resistance_color2 = (1,0,0) ; resistance_name2 = "red" ; resistance_color3 = (1,165/255,0) ; resistance_name3 = "orange" ; resistance_color4 = (1,1,0) ; resistance_name4 = "yellow" ; resistance_color5 = (0,1,0) ; resistance_name5 = "green" ; resistance_color6 = (0,0,1) ; resistance_name6 = "blue" ; resistance_color7 = (148/255,0,211/255) ; resistance_name7 = "darkviolet" ; resistance_color8 = (190/255,190/255,190/255) ; resistance_name8 = "gray" ; resistance_color9 = (1,1,1) ; resistance_name9 = "white" ;
def rainbow(expr f) = hide(numeric n_ ; n_ = (abs(5f) mod 5) + 2 ;) (n_-floor(n_))[resistance_color[floor n_],resistance_color[ceiling n_]] enddef ;
Alan
Am 07.10.2013 um 09:06 schrieb Magnus J
Hello list,
Long term (silent) on-and-off user with two issues that require some support:
1. How can I use the Mathdesign GD math font in ConTeXt? I use simplefonts to load Adobe Garamond Pro, but mathdesigngd (name as reported by mtxrun fonts script) is somehow not found. At this time I fallback to ugly solutions with \text in math mode. And yes, I know about type-imp-mathdesign.mkiv, but obviously I'm not qualified enough to get it right.
Minimal (not) working example:
\usemodule[simplefonts]
\setmainfont[Adobe Garamond Pro] \setmathfont[mathdesigngd]
\starttext I want \m{x^2+y^2=z^2} in my text, and $\alpha\beta\gamma$ too. \stoptext
The Mathdesign fonts aren’t part of the normal installation and you have to add “--fonts=mathdesign” or “--fonts=all” when you call first-setup.sh|bat. Wolfgang
I have the fonts and they are reported as mathdesigngd by the mtxrun fonts script -- sorry if this was unclear. How do I proceed from here? Regards, Magnus On Tue, Oct 8, 2013 at 5:30 PM, Wolfgang Schuster < schuster.wolfgang@gmail.com> wrote:
Am 07.10.2013 um 09:06 schrieb Magnus J
: Hello list,
Long term (silent) on-and-off user with two issues that require some support:
1. How can I use the Mathdesign GD math font in ConTeXt? I use simplefonts to load Adobe Garamond Pro, but mathdesigngd (name as reported by mtxrun fonts script) is somehow not found. At this time I fallback to ugly solutions with \text in math mode. And yes, I know about type-imp-mathdesign.mkiv, but obviously I'm not qualified enough to get it right.
Minimal (not) working example:
\usemodule[simplefonts]
\setmainfont[Adobe Garamond Pro] \setmathfont[mathdesigngd]
\starttext I want \m{x^2+y^2=z^2} in my text, and $\alpha\beta\gamma$ too. \stoptext
The Mathdesign fonts aren’t part of the normal installation and you have to add “--fonts=mathdesign” or “--fonts=all” when you call first-setup.sh|bat.
Wolfgang
Am 08.10.2013 um 17:42 schrieb Magnus J
I have the fonts and they are reported as mathdesigngd by the mtxrun fonts script -- sorry if this was unclear. How do I proceed from here?
This should work (can’t test it myself): \usetypescriptfile[mathdesign] \usemodule[simplefonts] \setmainfont[Adobe Garamond Pro] \setmathfont[mathdesigngm] \starttext I want \m{x^2+y^2=z^2} in my text, and $\alpha\beta\gamma$ too. \stoptext Wolfgang
With mathdesigngd (which is intended to complement Adobe Garamond Pro, and the one that I want), I get fonts > typescripts > unknown library 'mathdesigngd' in the output. With mathdesigngm, I get (cropped output) system > tex > error on line 8 in file /tmp/test.tex: LuaTeX error ... 1 2 \usetypescriptfile[mathdesign] 3 4 \usemodule[simplefonts] 5 6 \setmainfont[Adobe Garamond Pro] 7 \setmathfont[mathdesigngm] 8 >> 9 \starttext 10 I want \m{x^2+y^2=z^2} in my text, and $\alpha\beta\gamma$ too. 11 \stoptext \ctxcommand #1^^@-\directlua {commands.#1} \font_helpers_low_level_define ...caledfontmode )} \edef \somefontspec {at \n... \font_helpers_trigger_define ..._identifier_class \csname \v_font_identifier... \font_helpers_set_math_family_a ...ily \endcsname \else \font_helpers_set_ma... \font_helpers_set_math_family_indeed ..._family_a \scriptscriptfont #1\font ... \font_helpers_set_math_family ...amily_indeed #1#2 \fi \else \font_helpers_se... ... l.8 What now? Regards, Magnus On Tue, Oct 8, 2013 at 6:08 PM, Wolfgang Schuster < schuster.wolfgang@gmail.com> wrote:
Am 08.10.2013 um 17:42 schrieb Magnus J
: I have the fonts and they are reported as mathdesigngd by the mtxrun fonts script -- sorry if this was unclear. How do I proceed from here?
This should work (can’t test it myself):
\usetypescriptfile[mathdesign]
\usemodule[simplefonts]
\setmainfont[Adobe Garamond Pro] \setmathfont[mathdesigngm]
\starttext I want \m{x^2+y^2=z^2} in my text, and $\alpha\beta\gamma$ too. \stoptext
Wolfgang
Am 08.10.2013 um 18:26 schrieb Magnus J
With mathdesigngd (which is intended to complement Adobe Garamond Pro, and the one that I want), I get fonts > typescripts > unknown library 'mathdesigngd' in the output. With mathdesigngm, I get (cropped output)
1. It’s possible the math design fonts uses different file name than the ones context expects and this is the cause for the error message. 2. Math for Adobe Garamond isn’t supported yet by context. I can take a look why math design fails and fix but not today because it takes a while to check all files. Wolfgang
Wonderful, this is really appreciated. Regards, Magnus On Tue, Oct 8, 2013 at 7:38 PM, Wolfgang Schuster < schuster.wolfgang@gmail.com> wrote:
Am 08.10.2013 um 18:26 schrieb Magnus J
: With mathdesigngd (which is intended to complement Adobe Garamond Pro, and the one that I want), I get fonts > typescripts > unknown library 'mathdesigngd' in the output. With mathdesigngm, I get (cropped output)
1. It’s possible the math design fonts uses different file name than the ones context expects and this is the cause for the error message.
2. Math for Adobe Garamond isn’t supported yet by context.
I can take a look why math design fails and fix but not today because it takes a while to check all files.
Wolfgang
participants (3)
-
Alan BRASLAU
-
Magnus J
-
Wolfgang Schuster