ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Greek font in Footnote problem
@ 2005-01-17 12:31 Alan Bowen
  2005-01-17 15:54 ` Giuseppe Bilotta
  0 siblings, 1 reply; 7+ messages in thread
From: Alan Bowen @ 2005-01-17 12:31 UTC (permalink / raw)


I am having trouble getting Greek in footnote environment. The Greek  
appears as it should in the text body, but in a footnote all I get is  
the input. In short, ConTeXt \footnote seems to ignore the \localgreek  
command. I attach a brief test file that should produce the problem as  
well as the input file defining the Greek font in the first place.

Any suggestions would be very much appreciated.

By the way, there is no message in the log file to the effect that the  
Greek font is unavailable at a given font size. And I am using ConTeXt   
ver: 2004.10.26  fmt: 2005.1.3.

Alan
___________________________
\enableregime[mac]
\input Oxonia
\usetypescript [all] [latin-modern] [texnansi]
\setupbodyfont[reset]
\setupbodyfont[cmr, 10.5pt]

\starttext

The cat is on the mat. The cat is on the mat. \localgreek{a>utopt'ew}  
is not a compound of \localgreek{a>ut'oc} and \localgreek{>opte'uw}.  
The cat is on the mat.
%
\footnote{The etymology proposed on p.\ 136 is mistaken:  
\localgreek{a>utopt'ew} is not a compound of \localgreek{a>ut'oc} and  
\localgreek{>opte'uw}.}\ %
%
The cat is on the mat.

\stoptext
__________________________________________
% Oxonia.tex

\definebodyfont[10pt,10.5pt,11pt,12pt,14pt][rm][Gf=greeoxon sa 1.08]

\def\enablegreek{\language[greek]\catcode`~=\other\catcode`|=\other\catc 
ode`'=\other}

\def\startgreek{\par\begingroup\Gf\enablegreek}

\let\stopgreek\endgroup

\def\localgreek{\groupedcommand{\Gf\enablegreek}{}}
\define\sampi{\getglyph{greeoxon}{\char34}}
\define\digamma{\getglyph{greeoxon}{\char35}}
\define\stigma{\getglyph{greeoxon}{\char36}}
\define\koppa{\getglyph{greeoxon}{\char37}}
\define\lunars{\getglyph{greeoxon}{\char1}}
\define\lunarS{\getglyph{greeoxon}{\char13}}
\define\brcl{\getglyph{greeoxon}{\char8}}
\define\brcr{\getglyph{greeoxon}{\char9}}
\define\hbrl{\getglyph{greeoxon}{\char123}}
\define\hbrr{\getglyph{greeoxon}{\char125}}
\define\crux{\getglyph{greeoxon}{\char43}}

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Greek font in Footnote problem
  2005-01-17 12:31 Greek font in Footnote problem Alan Bowen
@ 2005-01-17 15:54 ` Giuseppe Bilotta
  2005-01-19  9:52   ` Thomas A.Schmitz
  0 siblings, 1 reply; 7+ messages in thread
From: Giuseppe Bilotta @ 2005-01-17 15:54 UTC (permalink / raw)


Monday, January 17, 2005 Alan Bowen wrote:

> I am having trouble getting Greek in footnote environment. The Greek
> appears as it should in the text body, but in a footnote all I get is
> the input. In short, ConTeXt \footnote seems to ignore the \localgreek
> command. I attach a brief test file that should produce the problem as
> well as the input file defining the Greek font in the first place.

> Any suggestions would be very much appreciated.

> By the way, there is no message in the log file to the effect that the
> Greek font is unavailable at a given font size. And I am using ConTeXt
> ver: 2004.10.26  fmt: 2005.1.3.

> Alan
> ___________________________
> \enableregime[mac]
> \input Oxonia
> \usetypescript [all] [latin-modern] [texnansi]
> \setupbodyfont[reset]
> \setupbodyfont[cmr, 10.5pt]

> \starttext

> The cat is on the mat. The cat is on the mat. \localgreek{a>utopt'ew}
> is not a compound of \localgreek{a>ut'oc} and \localgreek{>opte'uw}.
> The cat is on the mat.
> %
> \footnote{The etymology proposed on p.\ 136 is mistaken:  
> \localgreek{a>utopt'ew} is not a compound of \localgreek{a>ut'oc} and
> \localgreek{>opte'uw}.}\ %
> %
> The cat is on the mat.

> \stoptext
> __________________________________________
> % Oxonia.tex

> \definebodyfont[10pt,10.5pt,11pt,12pt,14pt][rm][Gf=greeoxon sa 1.08]

> \def\enablegreek{\language[greek]\catcode`~=\other\catcode`|=\other\catc
> ode`'=\other}

enablegreek relies on catcode changes, so it cannot work inside
commands. It should be redefined to make use of e-TeX's
\scantoken feature so that it can re-parse its input.

-- 
Giuseppe "Oblomov" Bilotta

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Greek font in Footnote problem
  2005-01-17 15:54 ` Giuseppe Bilotta
@ 2005-01-19  9:52   ` Thomas A.Schmitz
  2005-01-19 12:05     ` Re[2]: " Giuseppe Bilotta
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas A.Schmitz @ 2005-01-19  9:52 UTC (permalink / raw)



On Jan 17, 2005, at 4:54 PM, Giuseppe Bilotta wrote:

> enablegreek relies on catcode changes, so it cannot work inside
> commands. It should be redefined to make use of e-TeX's
> \scantoken feature so that it can re-parse its input.
>
> -- 
> Giuseppe "Oblomov" Bilotta
>
Giuseppe,

I'll be too bust the next three weeks to look into this, but would love 
to correct my quick and dirty hack. Can you give me a hint where I can 
learn more about \scantoken and how I can implement it for my Greek 
stuff?

Thanks

Thomas

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re[2]: Greek font in Footnote problem
  2005-01-19  9:52   ` Thomas A.Schmitz
@ 2005-01-19 12:05     ` Giuseppe Bilotta
  2005-01-20 23:01       ` Alan Bowen
  2005-01-21 19:29       ` h h extern
  0 siblings, 2 replies; 7+ messages in thread
From: Giuseppe Bilotta @ 2005-01-19 12:05 UTC (permalink / raw)


Wednesday, January 19, 2005 Thomas A.Schmitz wrote:


> On Jan 17, 2005, at 4:54 PM, Giuseppe Bilotta wrote:

>> enablegreek relies on catcode changes, so it cannot work inside
>> commands. It should be redefined to make use of e-TeX's
>> \scantoken feature so that it can re-parse its input.

> Giuseppe,

> I'll be too bust the next three weeks to look into this, but would love
> to correct my quick and dirty hack. Can you give me a hint where I can
> learn more about \scantoken and how I can implement it for my Greek
> stuff?

Ehehehe. The reason why I was so generic in my answer is
precisely the same :)

Something like

\def\localgreek#1{\scantokens{\Gf\enablegreek#1}}

could work.

-- 
Giuseppe "Oblomov" Bilotta

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Re[2]: Greek font in Footnote problem
  2005-01-19 12:05     ` Re[2]: " Giuseppe Bilotta
@ 2005-01-20 23:01       ` Alan Bowen
  2005-01-21 19:29       ` h h extern
  1 sibling, 0 replies; 7+ messages in thread
From: Alan Bowen @ 2005-01-20 23:01 UTC (permalink / raw)


Guiseppe and Thomas—

A quick run though with my test file indicates that
	\def\localgreek#1{\scantokens{\Gf\enablegreek#1}}
will work in the body text, but only if one enters the Greek code using 
double braces as follows:
		{\localgreek{Greek code}}
With single braces either the Greek turns on and stays on thereafter or 
the breathings get messed up with initial spaces.

Still no Greek in the footnotes, though.

Alan

On Jan 19, 2005, at 7:05 AM, Giuseppe Bilotta wrote:

> Wednesday, January 19, 2005 Thomas A.Schmitz wrote:
>
>
>> On Jan 17, 2005, at 4:54 PM, Giuseppe Bilotta wrote:
>
>>> enablegreek relies on catcode changes, so it cannot work inside
>>> commands. It should be redefined to make use of e-TeX's
>>> \scantoken feature so that it can re-parse its input.
>
>> Giuseppe,
>
>> I'll be too bust the next three weeks to look into this, but would 
>> love
>> to correct my quick and dirty hack. Can you give me a hint where I can
>> learn more about \scantoken and how I can implement it for my Greek
>> stuff?
>
> Ehehehe. The reason why I was so generic in my answer is
> precisely the same :)
>
> Something like
>
> \def\localgreek#1{\scantokens{\Gf\enablegreek#1}}
>
> could work.
>
> -- 
> Giuseppe "Oblomov" Bilotta
>
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Greek font in Footnote problem
  2005-01-19 12:05     ` Re[2]: " Giuseppe Bilotta
  2005-01-20 23:01       ` Alan Bowen
@ 2005-01-21 19:29       ` h h extern
  2005-01-22  8:18         ` Thomas A.Schmitz
  1 sibling, 1 reply; 7+ messages in thread
From: h h extern @ 2005-01-21 19:29 UTC (permalink / raw)


Giuseppe Bilotta wrote:
> Wednesday, January 19, 2005 Thomas A.Schmitz wrote:
> 
> 
> 
>>On Jan 17, 2005, at 4:54 PM, Giuseppe Bilotta wrote:
> 
> 
>>>enablegreek relies on catcode changes, so it cannot work inside
>>>commands. It should be redefined to make use of e-TeX's
>>>\scantoken feature so that it can re-parse its input.
> 
> 
>>Giuseppe,
> 
> 
>>I'll be too bust the next three weeks to look into this, but would love
>>to correct my quick and dirty hack. Can you give me a hint where I can
>>learn more about \scantoken and how I can implement it for my Greek
>>stuff?
> 
> 
> Ehehehe. The reason why I was so generic in my answer is
> precisely the same :)
> 
> Something like
> 
> \def\localgreek#1{\scantokens{\Gf\enablegreek#1}}
> 
> could work.

more precisely:

\starttext

\def\rescan#1{\scantokens{#1}} [\rescan{oeps}]

\def\rescan#1{\scantokens{#1\ignorespaces}} [\rescan{oeps}]

\stoptext

and therefore:

    \def\localgreek#1{\rescan{\Gf\enablegreek#1}}



-----------------------------------------------------------------
                                           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
-----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Greek font in Footnote problem
  2005-01-21 19:29       ` h h extern
@ 2005-01-22  8:18         ` Thomas A.Schmitz
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas A.Schmitz @ 2005-01-22  8:18 UTC (permalink / raw)


First: thanks to Giuseppe and Hans for their suggestions! As soon as I  
have a bit more time, I will look into the \scantokens command and try  
and correct my Greek modules. However, I had a couple of minutes today,  
and it looks like the solution to Alan's problem is much simpler. In  
your sample, Alan, if you replace

\setupbodyfont[cmr, 10.5pt]

with

\setupbodyfont[cmr, 10pt] %or 11 pt or 12 pt

the file compiles cleanly, with Greek in the footnotes where it should  
appear. So, for the time being, it doesn't seem to be a problem with  
the catcode changes. If I'm not mistaken, this would have given weird  
characters, but the problem was that the font change was not done at  
all.

So: I had already mailed off-list to Alan that I thought the problem  
was with defining the new bodyfont. And I think this is right. In my  
definition for  the Greek fonts, I have this line:

\definebodyfont[4pt,5pt,6pt,7pt,8pt,9pt,10pt,10.5pt,11pt,12pt,14pt,14.4p 
t,16pt,18pt,20pt,22pt][rm][Gf=greeoxon sa 1.08]

So I would assume the following:

1. When the body font of the document is 10, 11 or 12 pt, the footnote  
body font is in one of the predefined sizes, i.e. 8, 9, 10, whatever.
2. When the body font is a weird number like 10.5, ConTeXt (or is it  
eTeX itself?) recalculates the size for  the footnote, which will be an  
even weirder number. Accordingly, the definitions in my file won't work  
anymore.

Thusly: I looked at the source to find out by which factor the font in  
the footnotes is scaled, but couldn't find out. So my questions: how is  
this font size calculated? Or is it possible to give a "blanket"  
declaration for font sizes in my file (there is something like <-> in  
LaTeX which means "all sizes," if memory serves right).

Thanks for the help!

Best

Thomas

On Jan 21, 2005, at 8:29 PM, h h extern wrote:

> Giuseppe Bilotta wrote:
>> Wednesday, January 19, 2005 Thomas A.Schmitz wrote:
>>> On Jan 17, 2005, at 4:54 PM, Giuseppe Bilotta wrote:
>>>> enablegreek relies on catcode changes, so it cannot work inside
>>>> commands. It should be redefined to make use of e-TeX's
>>>> \scantoken feature so that it can re-parse its input.
>>> Giuseppe,
>>> I'll be too bust the next three weeks to look into this, but would  
>>> love
>>> to correct my quick and dirty hack. Can you give me a hint where I  
>>> can
>>> learn more about \scantoken and how I can implement it for my Greek
>>> stuff?
>> Ehehehe. The reason why I was so generic in my answer is
>> precisely the same :)
>> Something like
>> \def\localgreek#1{\scantokens{\Gf\enablegreek#1}}
>> could work.
>
> more precisely:
>
> \starttext
>
> \def\rescan#1{\scantokens{#1}} [\rescan{oeps}]
>
> \def\rescan#1{\scantokens{#1\ignorespaces}} [\rescan{oeps}]
>
> \stoptext
>
> and therefore:
>
>    \def\localgreek#1{\rescan{\Gf\enablegreek#1}}
>
>
>
> -----------------------------------------------------------------
>                                           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
> -----------------------------------------------------------------
>
>
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-01-22  8:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-17 12:31 Greek font in Footnote problem Alan Bowen
2005-01-17 15:54 ` Giuseppe Bilotta
2005-01-19  9:52   ` Thomas A.Schmitz
2005-01-19 12:05     ` Re[2]: " Giuseppe Bilotta
2005-01-20 23:01       ` Alan Bowen
2005-01-21 19:29       ` h h extern
2005-01-22  8:18         ` Thomas A.Schmitz

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).