Re: [NTG-context] kpfonts, math, type 1 font

2014-01-11 Thread Elspeth McGullicuddy
As for the first point: buggy afm files, I've tried "generate font"
from "fontforge" interface:
Even though I've let fontforge proceed to many auto-corrections, the
output produced
and then installed seems not to fit the bill: nothing is showing.

I reckon I've learned as much as can be done in one go:
=> I temporarily give up.

Nevertheless if one have information about the vector I wrote for bold Greek:
why that didn't work, I'll will gladly have it.

Chris


On Sat, Jan 11, 2014 at 7:36 PM, Elspeth McGullicuddy
 wrote:
> As for the point: "bold uppercase greek letters aren’t mapped" I've inserted
> the following at the beginning of file "pkfonts-math.lfg":
> (I put the whole file it'll be easier to understand)
> => capital greek are not showing though
>
> I've mimicked the file "lucida-typeone-math.lfg".
>
> -- file: kpfonts-math.lfg
>
> local mathencodings = fonts.encodings.math
>
> mathencodings["tex-mrb"] = {
> [0x1D6AA] = 0x00, -- Gamma
> [0x1D6AB] = 0x01, -- Delta
> [0x1D6AF] = 0x02, -- Theta
> [0x1D6B2] = 0x03, -- Lambda
> [0x1D6B5] = 0x04, -- Xi
> [0x1D6B7] = 0x05, -- Pi
> [0x1D6BA] = 0x06, -- Sigma
> [0x1D6BC] = 0x07, -- Upsilon
> [0x1D6BD] = 0x08, -- Phi
> [0x1D6BF] = 0x09, -- Psi
> [0x1D6C0] = 0x0A, -- Omega
> [0x1D6A8] = 0x41, -- Alpha
> [0x1D6A9] = 0x42, -- Beta
> --  [0x02145] = 0x44,
> [0x1D6AC] = 0x45, -- Epsilon
> [0x1D6AE] = 0x48, -- Eta
> [0x1D6B0] = 0x49, -- Iota
> [0x1D6B1] = 0x4B, -- Kappa
> [0x1D6B3] = 0x4D, -- Mu
> [0x1D6B4] = 0x4E, -- Nu
> [0x1D6B6] = 0x4F, -- Omicron
> [0x1D6B8] = 0x52, -- Rho
> [0x1D6BB] = 0x54, -- Tau
> [0x1D6BE] = 0x58, -- Chi
> [0x1D6AD] = 0x5A, -- Zeta
> --[0x00302] = 0x5E, -- [math]hat -- the real math one
> --[0x02146] = 0x64,
> --[0x02147] = 0x65,
> --[0x00303] = 0x7E, -- [math]tilde -- the real one
> }
>
>
> return {
>name = "kpfonts-math",
>version = "1.00",
>comment = "kpfonts, math part.",
>author = "Chris",
>copyright = "ConTeXt development team",
>mathematics = {
>   mapfiles = {
>  "kpfonts.map",
> -- "mkiv-base.map",
>   },
>   virtuals = {
>  ["kpfonts-rm"] = { -- MathRoman
> { name = "file:jkpmn8a", features = "virtualmath", main = true },
> { name = "jkpmia",  vector = "tex-mr", skewchar=0x7F },
> { name = "jkpmi", vector = "tex-mi", skewchar=0x7F },
> { name = "jkpmi", vector = "tex-it", skewchar=0x7F },
> { name = "jkpbn8a",  vector = "tex-bf", skewchar=0x7F },
> { name = "jkpbmi", vector = "tex-bi", skewchar=0x7F },
> { name = "jkpsy",  vector = "tex-sy", skewchar=0x30,
> parameters = true },
> { name = "jkpex",  vector = "tex-ex", extension = true },
> { name = "jkpsya",  vector = "tex-ma" },
> { name = "jkpsyb",  vector = "tex-mb" },
>  },
>  ["kpfonts-bf"] = {  -- MathRomanBold
> { name = "file:jkpbn8a", features = "virtualmath", main = true },
> { name = "jkpbmia",  vector = "tex-mrb", skewchar=0x7F },
> -- this line modified accordingly
> { name = "jkpbmi", vector = "tex-mi", skewchar=0x7F },
> { name = "jkpbmi", vector = "tex-it", skewchar=0x7F },
> { name = "jkpbsy",  vector = "tex-sy", skewchar=0x30,
> parameters = true },
> { name = "jkpbex",  vector = "tex-ex", extension = true },
> { name = "jkpbsya",  vector = "tex-ma" },
> { name = "jkpbsyb",  vector = "tex-mb" },
>  }
>   }
>}
> }
>
>
>
> On Sat, Jan 11, 2014 at 3:03 PM, Wolfgang Schuster
>  wrote:
>>
>> Am 10.01.2014 um 23:38 schrieb Elspeth McGullicuddy
>> :
>>
>> (Gammas are squeezed together and \bf is ineffective, which is not so
>> with modern).
>>
>>
>> The characters are squeezed together because the font has wrong metrics.
>>
>> If the assumption that "mdugmr7m.tfm" contains the metrics for
>> "md-gmm7m.pfb" is correct, then fontforge show it (mdugmr7m), contains
>> bold characters, which then should show.
>>
>>
>> When you use a Type 1 math font with ConTeXt MkIV all characters in the
>> different
>> files are mapped to the corresponding unicode points but these mappings
>> aren’t
>> complete (e.g. bold uppercase greek letters aren’t mapped).
>>
>> For some fonts you would also need a custom mapping because not all fonts
>> put the symbols in the same position.
>>
>> Wolfgang
>>
>> ___
>> 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://tex.aanhet.net
>> archive  : http://foundry.supelec.fr/projects/contextrev/
>> wiki : http://contextgarden.net
>> __

Re: [NTG-context] setuphead for in-paragraph head ?

2014-01-11 Thread Otared Kavian
Hi Wolfgang,

Many thanks for your attention and insight.
With your code everything works as expected. In case others would be 
interested, I give here a slight modification of what you sent, which works 
very well with mkiv: I only added 
\setupblock[question][before={\startquestion},after={\stopquestion}]
so that one can just say \beginquestion \endquestion without having to enter 
each time \startquestion \stopquestion. I don’t know whether this is a good 
idea or not, as it may have side effects…

I will put this example on the wiki, but before doing so I have another 
question:
can one add two automatic links at the end of each question so that one can 
navigate easily to the respective hint or answer corresponding to that 
question? Indeed if this were possible, one would add also two automatic links 
to each hint going to its question and the corresponding answer, and two other 
links to each answer going to its hint and question. One can do this manually 
by adding a reference to each question, each hint and each answer, but it would 
be nice to have this done automatically.

Best regards: OK
PS: here is the complete example for question-hint-answer:

 begin question-hint-answer-blocks.tex
\defineblock[question]
\defineblock[hint]
\defineblock[answer]

\defineenumeration[question]
[alternative=hanging,
width=2.5cm,
text={Question},
headstyle={\bi},
stopper={.}]

\defineenumeration[hint]
[alternative=hanging,
width=4cm,
text={Hint for question},
headstyle={\bi},
stopper={.}]

\defineenumeration[answer]
[alternative=hanging,
width=4.5cm,
text={Answer to question},
headstyle={\bi},
stopper={.}]

\setupblock[question][before={\startquestion},after={\stopquestion}]
\setupblock[hint][before={\starthint},after={\stophint}]
\setupblock[answer][before={\startanswer},after={\stopanswer}]

\keepblocks[question]
\hideblocks[hint]
\hideblocks[answer]

\starttext

\section{Questions}

\beginquestion
  Compute $4\times 5$.
\endquestion

\beginhint
  Use the fact that $2\times 5 = 10$.
\endhint

\beginanswer
  $20$.
\endanswer

\beginquestion
  What is the value of $100 / 10$?
\endquestion

\beginhint
Remember that $10\times 10 = 100$.
\endhint

\beginanswer
$10$
\endanswer

\section{Hints to all questions}

\useblocks[hint]

\section{Answers to all questions}

\useblocks[answer]

\stoptext
 end question-hint-answer-blocks.tex


On 11 janv. 2014, at 10:12, Wolfgang Schuster  
wrote:

> 
> Am 11.01.2014 um 00:36 schrieb Otared Kavian :
> 
>> Hi Wolfgang,
>> 
>> In mkiv, even using \startanswer, \stopanswer (and the same syntax with 
>> questions and hints) the blocks mechanism seems to be broken.
>> The error message is still the following:
>> 
>> \dostopnormalblock ...meter \c!after \par \egroup 
>>   
>>  ...fact that $2\times 5 = 10$. \dostopnormalblock 
>>   \dostartnormalblock 
>> {hint}...
>> \dodowithpar ...dler \v!construction \endcsname #1
>>   \csname 
>> \??constructionsto...
>> 
>> When I understand a little bit more about that mechanism I’ll do other 
>> testings and eventually ask Hans about what has been changed regarding 
>> blocks.
> 
> You have to convert the question, hint and answer environment.
> 
> What the block environment does is to save the content from the begin to the 
> end block and hides it when you use \hideblocks[…]. To output the content of 
> the environments you can use \useblocks[…].
> 
> 
> \defineblock[question]
> \defineblock[hint]
> \defineblock[answer]
> 
> \defineenumeration[question][alternative=hanging,text={Question},stopper={.}]
> \defineenumeration[hint][alternative=hanging,text={Hint for 
> question},stopper={.}]
> \defineenumeration[answer]  [alternative=hanging,text={Answer to 
> question},stopper={.}]
> 
> \keepblocks[question]
> \hideblocks[hint]
> \hideblocks[answer]
> 
> \starttext
> 
> \section{Questions}
> 
> \beginquestion
> 
> \startquestion
>   Compute $4\times 5$.
> \stopquestion
> 
> \beginhint
> \starthint
>   Use the fact that $2\times 5 = 10$.
> \stophint
> \endhint
> 
> \beginanswer
> \startanswer
>   $20$.
> \stopanswer
> \endanswer
> 
> \endquestion
> 
> \beginquestion
> 
> \startquestion
>   What is the value of $100 / 10$?
> \stopquestion
> 
> \beginhint
> \starthint
> Remember that $10\times 10 = 100$.
> \stophint
> \endhint
> 
> \beginanswer
> \startanswer
> $10$
> \stopanswer
> \endanswer
> 
> \endquestion
> 
> \section{Hints}
> 
> \useblocks[hint]
> 
> \section{Answers}
> 
> \useblocks[answer]
> 
> \stoptext
> 
> Wolfgang
> 
> ___
> 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/mailm

Re: [NTG-context] kpfonts, math, type 1 font

2014-01-11 Thread Elspeth McGullicuddy
As for the point: "bold uppercase greek letters aren’t mapped" I've inserted
the following at the beginning of file "pkfonts-math.lfg":
(I put the whole file it'll be easier to understand)
=> capital greek are not showing though

I've mimicked the file "lucida-typeone-math.lfg".

-- file: kpfonts-math.lfg

local mathencodings = fonts.encodings.math

mathencodings["tex-mrb"] = {
[0x1D6AA] = 0x00, -- Gamma
[0x1D6AB] = 0x01, -- Delta
[0x1D6AF] = 0x02, -- Theta
[0x1D6B2] = 0x03, -- Lambda
[0x1D6B5] = 0x04, -- Xi
[0x1D6B7] = 0x05, -- Pi
[0x1D6BA] = 0x06, -- Sigma
[0x1D6BC] = 0x07, -- Upsilon
[0x1D6BD] = 0x08, -- Phi
[0x1D6BF] = 0x09, -- Psi
[0x1D6C0] = 0x0A, -- Omega
[0x1D6A8] = 0x41, -- Alpha
[0x1D6A9] = 0x42, -- Beta
--  [0x02145] = 0x44,
[0x1D6AC] = 0x45, -- Epsilon
[0x1D6AE] = 0x48, -- Eta
[0x1D6B0] = 0x49, -- Iota
[0x1D6B1] = 0x4B, -- Kappa
[0x1D6B3] = 0x4D, -- Mu
[0x1D6B4] = 0x4E, -- Nu
[0x1D6B6] = 0x4F, -- Omicron
[0x1D6B8] = 0x52, -- Rho
[0x1D6BB] = 0x54, -- Tau
[0x1D6BE] = 0x58, -- Chi
[0x1D6AD] = 0x5A, -- Zeta
--[0x00302] = 0x5E, -- [math]hat -- the real math one
--[0x02146] = 0x64,
--[0x02147] = 0x65,
--[0x00303] = 0x7E, -- [math]tilde -- the real one
}


return {
   name = "kpfonts-math",
   version = "1.00",
   comment = "kpfonts, math part.",
   author = "Chris",
   copyright = "ConTeXt development team",
   mathematics = {
  mapfiles = {
 "kpfonts.map",
-- "mkiv-base.map",
  },
  virtuals = {
 ["kpfonts-rm"] = { -- MathRoman
{ name = "file:jkpmn8a", features = "virtualmath", main = true },
{ name = "jkpmia",  vector = "tex-mr", skewchar=0x7F },
{ name = "jkpmi", vector = "tex-mi", skewchar=0x7F },
{ name = "jkpmi", vector = "tex-it", skewchar=0x7F },
{ name = "jkpbn8a",  vector = "tex-bf", skewchar=0x7F },
{ name = "jkpbmi", vector = "tex-bi", skewchar=0x7F },
{ name = "jkpsy",  vector = "tex-sy", skewchar=0x30,
parameters = true },
{ name = "jkpex",  vector = "tex-ex", extension = true },
{ name = "jkpsya",  vector = "tex-ma" },
{ name = "jkpsyb",  vector = "tex-mb" },
 },
 ["kpfonts-bf"] = {  -- MathRomanBold
{ name = "file:jkpbn8a", features = "virtualmath", main = true },
{ name = "jkpbmia",  vector = "tex-mrb", skewchar=0x7F },
-- this line modified accordingly
{ name = "jkpbmi", vector = "tex-mi", skewchar=0x7F },
{ name = "jkpbmi", vector = "tex-it", skewchar=0x7F },
{ name = "jkpbsy",  vector = "tex-sy", skewchar=0x30,
parameters = true },
{ name = "jkpbex",  vector = "tex-ex", extension = true },
{ name = "jkpbsya",  vector = "tex-ma" },
{ name = "jkpbsyb",  vector = "tex-mb" },
 }
  }
   }
}



On Sat, Jan 11, 2014 at 3:03 PM, Wolfgang Schuster
 wrote:
>
> Am 10.01.2014 um 23:38 schrieb Elspeth McGullicuddy
> :
>
> (Gammas are squeezed together and \bf is ineffective, which is not so
> with modern).
>
>
> The characters are squeezed together because the font has wrong metrics.
>
> If the assumption that "mdugmr7m.tfm" contains the metrics for
> "md-gmm7m.pfb" is correct, then fontforge show it (mdugmr7m), contains
> bold characters, which then should show.
>
>
> When you use a Type 1 math font with ConTeXt MkIV all characters in the
> different
> files are mapped to the corresponding unicode points but these mappings
> aren’t
> complete (e.g. bold uppercase greek letters aren’t mapped).
>
> For some fonts you would also need a custom mapping because not all fonts
> put the symbols in the same position.
>
> Wolfgang
>
> ___
> 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://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki : http://contextgarden.net
> ___
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] kpfonts, math, type 1 font

2014-01-11 Thread Wolfgang Schuster

Am 10.01.2014 um 23:38 schrieb Elspeth McGullicuddy 
:

> (Gammas are squeezed together and \bf is ineffective, which is not so
> with modern).

The characters are squeezed together because the font has wrong metrics.

> If the assumption that "mdugmr7m.tfm" contains the metrics for
> "md-gmm7m.pfb" is correct, then fontforge show it (mdugmr7m), contains
> bold characters, which then should show.

When you use a Type 1 math font with ConTeXt MkIV all characters in the 
different
files are mapped to the corresponding unicode points but these mappings aren’t
complete (e.g. bold uppercase greek letters aren’t mapped).

For some fonts you would also need a custom mapping because not all fonts
put the symbols in the same position.

Wolfgang___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] setuphead for in-paragraph head ?

2014-01-11 Thread Wolfgang Schuster

Am 11.01.2014 um 00:36 schrieb Otared Kavian :

> Hi Wolfgang,
> 
> In mkiv, even using \startanswer, \stopanswer (and the same syntax with 
> questions and hints) the blocks mechanism seems to be broken.
> The error message is still the following:
> 
> \dostopnormalblock ...meter \c!after \par \egroup 
>   
>  ...fact that $2\times 5 = 10$. \dostopnormalblock 
>   \dostartnormalblock 
> {hint}...
> \dodowithpar ...dler \v!construction \endcsname #1
>   \csname 
> \??constructionsto...
> 
> When I understand a little bit more about that mechanism I’ll do other 
> testings and eventually ask Hans about what has been changed regarding blocks.

You have to convert the question, hint and answer environment.

What the block environment does is to save the content from the begin to the 
end block and hides it when you use \hideblocks[…]. To output the content of 
the environments you can use \useblocks[…].


\defineblock[question]
\defineblock[hint]
\defineblock[answer]

\defineenumeration[question][alternative=hanging,text={Question},stopper={.}]
\defineenumeration[hint][alternative=hanging,text={Hint for 
question},stopper={.}]
\defineenumeration[answer]  [alternative=hanging,text={Answer to 
question},stopper={.}]

\keepblocks[question]
\hideblocks[hint]
\hideblocks[answer]

\starttext

\section{Questions}

\beginquestion

\startquestion
  Compute $4\times 5$.
\stopquestion

\beginhint
\starthint
  Use the fact that $2\times 5 = 10$.
\stophint
\endhint

\beginanswer
\startanswer
  $20$.
\stopanswer
\endanswer

\endquestion

\beginquestion

\startquestion
  What is the value of $100 / 10$?
\stopquestion

\beginhint
\starthint
Remember that $10\times 10 = 100$.
\stophint
\endhint

\beginanswer
\startanswer
$10$
\stopanswer
\endanswer

\endquestion

\section{Hints}

\useblocks[hint]

\section{Answers}

\useblocks[answer]

\stoptext

Wolfgang

___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] ConTeXt with Emacs

2014-01-11 Thread Fabrice

Hello,
I use Emacs as an editor and I compile my files with LuaLaTeX by adding 
the following lines to the end of the file:


%%% Local Variables:
%%% Mode: LaTeX
%%% LaTeX-command "LuaLaTeX-shell-escape"
%%% End:

I discovered ConTeXt, and I would like to know which lines to add to the 
end of files.

Thank you.
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___