ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [ConTeXt] Math fonts: cal etc.
@ 1999-07-05 13:28 Tobias Burnus
  1999-07-05 14:27 ` Hans Hagen
  0 siblings, 1 reply; 11+ messages in thread
From: Tobias Burnus @ 1999-07-05 13:28 UTC (permalink / raw)


Hi,

I might miss something, but how can I persude ConTeXt to use callicgraphic
letter in equations.

I can use \cal{HI THERE} \frak{And also there} \goth{I am a fraktur font again}

but using $\cal F$, $\frak F$ doesn't work.

(I would also like to use the "Ralf Smith Formal Script" font, which is also a
math font.
I think adding it (e.g. to font-rsf.tex shouldn't be difficult, but I'd like to
have some pointer.)

Tobias


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

* Re: [ConTeXt] Math fonts: cal etc.
  1999-07-05 13:28 [ConTeXt] Math fonts: cal etc Tobias Burnus
@ 1999-07-05 14:27 ` Hans Hagen
  1999-07-05 17:42   ` Tobias Burnus
  1999-07-06 12:47   ` Ed L. Cashin
  0 siblings, 2 replies; 11+ messages in thread
From: Hans Hagen @ 1999-07-05 14:27 UTC (permalink / raw)
  Cc: NTG-ConTeXt

Tobias Burnus wrote:

> I can use \cal{HI THERE} \frak{And also there} \goth{I am a fraktur font again}

No you can't, because it's a font switch and needs grouping! They are
defined as:

\definefont [frak] [Fraktur     sa \currentfontscale]
\definefont [goth] [Gothic      sa \currentfontscale]
\definefont [cal]  [Caligraphic sa \currentfontscale]

So by adapting file mappings you can have different ones. 

> but using $\cal F$, $\frak F$ doesn't work.

\def\fraktur    #1{\ifmmode\hbox\fi{\frak#1}}
\def\gothic     #1{\ifmmode\hbox\fi{\goth#1}}
\def\caligraphic#1{\ifmmode\hbox\fi{\cal #1}}

will do what you want. I can add those if needed/wanted/agreed upon. 

> (I would also like to use the "Ralf Smith Formal Script" font, which is also a
> math font.
> I think adding it (e.g. to font-rsf.tex shouldn't be difficult, but I'd like to
> have some pointer.)

\definefontsynonym [MathRoman]          [RalfSmith...]
\definefontsynonym [MathExtension]      [...]
\definefontsynonym [MathItalic]         [...]
\definefontsynonym [MathSymbol]         [...]

\definebodyfont
  [14.4pt,12pt,11pt,10pt,9pt,8pt,7pt,6pt,5pt,4pt]
  [mm]
  [default]

Or something like that, 

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.nl
-----------------------------------------------------------------


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

* Re: [ConTeXt] Math fonts: cal etc.
  1999-07-05 14:27 ` Hans Hagen
@ 1999-07-05 17:42   ` Tobias Burnus
  1999-07-05 18:13     ` Hans Hagen
  1999-07-06 12:47   ` Ed L. Cashin
  1 sibling, 1 reply; 11+ messages in thread
From: Tobias Burnus @ 1999-07-05 17:42 UTC (permalink / raw)
  Cc: NTG-ConTeXt

Hi Hans,

> > I can use\x03\cal{HI THERE} \frak{And also there} \goth{I am a fraktur font again}
>
> No you can't, because it's a font switch and needs grouping! They are
> defined as:

I mean: {\cal HI THERE} {\frak And also there} {\goth I am a fraktur font again}
(\cal isn't nice for in this case: it eats all spaces.)

> \definefont [frak] [Fraktur     sa \currentfontscale]
> \definefont [goth] [Gothic      sa \currentfontscale]
> \definefont [cal]  [Caligraphic sa \currentfontscale]
> So by adapting file mappings you can have different ones.
> > but using $\cal F$, $\frak F$ doesn't work.
> \def\fraktur    #1{\ifmmode\hbox\fi{\frak#1}}
> \def\gothic     #1{\ifmmode\hbox\fi{\goth#1}}
> \def\caligraphic#1{\ifmmode\hbox\fi{\cal #1}}

Maybe better:
 \definefont [fraktur]      [Fraktur     sa \currentfontscale]
 \definefont [gothic]       [Gothic      sa \currentfontscale]
 \definefont [caligraphic]  [Caligraphic sa \currentfontscale]
 \def\frak    #1{\ifmmode\hbox{\fractur     #1}\else\factur #1\fi}
 \def\goth    #1{\ifmmode\hbox{\gothic      #1}\else\gothic #1\fi}
 \def\cal     #1{\ifmmode\hbox{\caligraphic #1}\else\caligraphic #1\fi}

So the plain TeX and LaTeX style $\cal M = \{f\colon V\rightarrow V'\}$ works
(Ok I've to admit in plain TeX/LaTeX you have to type ${\cal M} = \{f\colon
V\rightarrow V'\}$)

> will do what you want. I can add those if needed/wanted/agreed upon.
I think this makes sense, especially \cal makes outside of math not that much
sense.
(so small letters), I don't know whether it is possible with Fraktur to obtain
umlauts, ligatures etc., if not I think this is also a ''math only'' candidate.

> > (I would also like to use the "Ralf Smith Formal Script" font, which is also a
> > math font. I think adding it (e.g. to font-rsf.tex shouldn't be difficult, 
> but I'd like to have some pointer.)

> \definefontsynonym [MathRoman]          [RalfSmith...]
> \definefontsynonym [MathExtension]      [...]
> \definefontsynonym [MathItalic]         [...]
> \definefontsynonym [MathSymbol]         [...]
Well it is similar to \cal, so I think this is better:
 \definefontsynonym [RalfSmithFS]         [rsfs10]
 \definefont [ralfsmithfs] [RalfSmithFS  sa \currentfontscale]
 \def\rsfs #1{\ifmmode\hbox{\ralfsmithfs #1}\else\ralfsmithfs #1\fi}

The question is: Where should we put something like this?
It might be frequently use by some users, but they only made up a small basis.
 J"org Knappen wrote about his LaTeX style:
   Physicists don't like the appearance of the standard calligraphic fonts
   when speaking about Lagrangian density, Hamiltonian density, or the measure 
   in the path integral. Fortunately, the Ralph Smith Formal Script (rsfs) 
   fonts provide the desired shapes.

Tobias


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

* Re: [ConTeXt] Math fonts: cal etc.
  1999-07-05 17:42   ` Tobias Burnus
@ 1999-07-05 18:13     ` Hans Hagen
  0 siblings, 0 replies; 11+ messages in thread
From: Hans Hagen @ 1999-07-05 18:13 UTC (permalink / raw)
  Cc: NTG-ConTeXt

Tobias Burnus wrote:

> Maybe better:
>  \definefont [fraktur]      [Fraktur     sa \currentfontscale]
>  \definefont [gothic]       [Gothic      sa \currentfontscale]
>  \definefont [caligraphic]  [Caligraphic sa \currentfontscale]
>  \def\frak    #1{\ifmmode\hbox{\fractur     #1}\else\factur #1\fi}
>  \def\goth    #1{\ifmmode\hbox{\gothic      #1}\else\gothic #1\fi}
>  \def\cal     #1{\ifmmode\hbox{\caligraphic #1}\else\caligraphic #1\fi}

The problem is that the ones I mentioned are already defined, and I want
to remain upward compatible. 

> (so small letters), I don't know whether it is possible with Fraktur to obtain
> umlauts, ligatures etc., if not I think this is also a ''math only'' candidate.

If the encoding is right, it should work, otherwise something should be
cooked up, but I fear it only works ok for a normal encoded font.  

>  \definefontsynonym [RalfSmithFS]         [rsfs10]
>  \definefont [ralfsmithfs] [RalfSmithFS  sa \currentfontscale]
>  \def\rsfs #1{\ifmmode\hbox{\ralfsmithfs #1}\else\ralfsmithfs #1\fi}
> 
> The question is: Where should we put something like this?

If you use it as caligraphic, then I would say: 

\definefontsynonym[RalfSmithFormalScript] [rsfs10]      % goes into
font-fil.tex

\definefontsynonym[Caligraphic][RalfSmithFormalScript]  % goes into a
style/preamble

So, no separate font file is needed, just a setting in the preamble of
your document (or your local cont-sys.tex file). I've added the rsfs
entry to font-fil. 

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.nl
-----------------------------------------------------------------


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

* Re: [ConTeXt] Math fonts: cal etc.
  1999-07-05 14:27 ` Hans Hagen
  1999-07-05 17:42   ` Tobias Burnus
@ 1999-07-06 12:47   ` Ed L. Cashin
  1999-07-06 13:17     ` Hans Hagen
  1 sibling, 1 reply; 11+ messages in thread
From: Ed L. Cashin @ 1999-07-06 12:47 UTC (permalink / raw)
  Cc: NTG-ConTeXt

Hans Hagen <pragma@wxs.nl> writes:

[...]
> \def\fraktur    #1{\ifmmode\hbox\fi{\frak#1}}
> \def\gothic     #1{\ifmmode\hbox\fi{\goth#1}}
> \def\caligraphic#1{\ifmmode\hbox\fi{\cal #1}}
> 
> will do what you want. I can add those if needed/wanted/agreed upon. 

I have only used "if" a little, but is the "fi" really supposed to go
*before* the hbox like that?  If it is, then why is it there instead
of after the hbox as I'd expect?

-- 
--Ed Cashin							
  ecashin@coe.uga.edu


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

* Re: [ConTeXt] Math fonts: cal etc.
  1999-07-06 12:47   ` Ed L. Cashin
@ 1999-07-06 13:17     ` Hans Hagen
  1999-07-06 15:03       ` Ed L. Cashin
  0 siblings, 1 reply; 11+ messages in thread
From: Hans Hagen @ 1999-07-06 13:17 UTC (permalink / raw)
  Cc: NTG-ConTeXt

Ed L. Cashin wrote:
> 
> Hans Hagen <pragma@wxs.nl> writes:
> 
> [...]
> > \def\fraktur    #1{\ifmmode\hbox\fi{\frak#1}}
> > \def\gothic     #1{\ifmmode\hbox\fi{\goth#1}}
> > \def\caligraphic#1{\ifmmode\hbox\fi{\cal #1}}
> >
> > will do what you want. I can add those if needed/wanted/agreed upon.
> 
> I have only used "if" a little, but is the "fi" really supposed to go
> *before* the hbox like that?  If it is, then why is it there instead
> of after the hbox as I'd expect?

imagine not being in hmode: 

\ifmmode -> false -> fast read until \fi -> {\frak#1}

but in mmode: 

\ifmmode -> true -> start reading h specs until { expanding everything
-> meet \fi which ends the \if so ok -> see { -> \hbox{\frak#1} 

alternatively you can say: 

\ifmmode\expandafter\hbox\fi{\frak#1}

or when in mmode: 

expandtoken after \hbox being \fi -> so end the \if -> take the \hbox ->
etc etc 

It had to do with the fact that \fi is a signal, not expending to
anything to be typeset or read as keyword. In principle such a \fi can
even go after the { when suitable! 

If yoy want to see a real dirty one (there are some more), take a look
at \doifnumberelse. 

Hans 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.nl
-----------------------------------------------------------------


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

* Re: [ConTeXt] Math fonts: cal etc.
  1999-07-06 13:17     ` Hans Hagen
@ 1999-07-06 15:03       ` Ed L. Cashin
  1999-07-06 15:13         ` Hans Hagen
  0 siblings, 1 reply; 11+ messages in thread
From: Ed L. Cashin @ 1999-07-06 15:03 UTC (permalink / raw)
  Cc: NTG-ConTeXt

Hans Hagen <pragma@wxs.nl> writes:

> imagine not being in hmode: 
> 
> \ifmmode -> false -> fast read until \fi -> {\frak#1}
> 
> but in mmode: 
> 
> \ifmmode -> true -> start reading h specs until { expanding everything
> -> meet \fi which ends the \if so ok -> see { -> \hbox{\frak#1} 

OK.  I see now.  Thank you!

> alternatively you can say: 
> 
> \ifmmode\expandafter\hbox\fi{\frak#1}

Hmm.  That's the same as the earlier one, but with "expandafter".
What is the purpose of expandafter there--I know what it is supposed
to do, but isn't expandafter superfluous here, since
"\ifmmode\hbox\fi{\frak#1}" works? 

-- 
--Ed Cashin							
  ecashin@coe.uga.edu


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

* Re: [ConTeXt] Math fonts: cal etc.
  1999-07-06 15:03       ` Ed L. Cashin
@ 1999-07-06 15:13         ` Hans Hagen
  1999-07-06 15:37           ` Ed L. Cashin
  0 siblings, 1 reply; 11+ messages in thread
From: Hans Hagen @ 1999-07-06 15:13 UTC (permalink / raw)
  Cc: NTG-ConTeXt

Ed L. Cashin wrote:
> > \ifmmode\expandafter\hbox\fi{\frak#1}
> 
> Hmm.  That's the same as the earlier one, but with "expandafter".
> What is the purpose of expandafter there--I know what it is supposed
> to do, but isn't expandafter superfluous here, since
> "\ifmmode\hbox\fi{\frak#1}" works?

Indeed, bu tmaybe it makes you feel more comfortable -)

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.nl
-----------------------------------------------------------------


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

* Re: [ConTeXt] Math fonts: cal etc.
  1999-07-06 15:13         ` Hans Hagen
@ 1999-07-06 15:37           ` Ed L. Cashin
  0 siblings, 0 replies; 11+ messages in thread
From: Ed L. Cashin @ 1999-07-06 15:37 UTC (permalink / raw)
  Cc: NTG-ConTeXt

Hans Hagen <pragma@wxs.nl> writes:

> Ed L. Cashin wrote:
> > > \ifmmode\expandafter\hbox\fi{\frak#1}
> > 
> > Hmm.  That's the same as the earlier one, but with "expandafter".
> > What is the purpose of expandafter there--I know what it is supposed
> > to do, but isn't expandafter superfluous here, since
> > "\ifmmode\hbox\fi{\frak#1}" works?
> 
> Indeed, bu tmaybe it makes you feel more comfortable -)

It does!  :)  Thanks for the TeX lesson--sorry for going a little
off-topic. 

-- 
--Ed Cashin							
  ecashin@coe.uga.edu


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

* Re: [ConTeXt] Math fonts: cal etc.
  1999-07-07  8:42 Gilbert van den Dobbelsteen
@ 1999-07-07 21:39 ` Hans Hagen
  0 siblings, 0 replies; 11+ messages in thread
From: Hans Hagen @ 1999-07-07 21:39 UTC (permalink / raw)
  Cc: Context List

Gilbert van den Dobbelsteen wrote:

> Perhaps we could collect such snippets and organize them in a littke booklet
> (titled: `tips of the trade' or something like that).

I can add them to my collection of off-topics (short articles some
published some not yet). Remind me to show you this document -) Ha nice
title page. 

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.nl
-----------------------------------------------------------------


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

* Re: [ConTeXt] Math fonts: cal etc.
@ 1999-07-07  8:42 Gilbert van den Dobbelsteen
  1999-07-07 21:39 ` Hans Hagen
  0 siblings, 1 reply; 11+ messages in thread
From: Gilbert van den Dobbelsteen @ 1999-07-07  8:42 UTC (permalink / raw)


>
>It does!  :)  Thanks for the TeX lesson--sorry for going a little
>off-topic.

Well, I enjoyed it very much. I already knew these aspects, but they tend to
surprise me when I see them in TeX code. I guess M4 has similar stuff.

Perhaps we could collect such snippets and organize them in a littke booklet
(titled: `tips of the trade' or something like that).

Gilbert.


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

end of thread, other threads:[~1999-07-07 21:39 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-07-05 13:28 [ConTeXt] Math fonts: cal etc Tobias Burnus
1999-07-05 14:27 ` Hans Hagen
1999-07-05 17:42   ` Tobias Burnus
1999-07-05 18:13     ` Hans Hagen
1999-07-06 12:47   ` Ed L. Cashin
1999-07-06 13:17     ` Hans Hagen
1999-07-06 15:03       ` Ed L. Cashin
1999-07-06 15:13         ` Hans Hagen
1999-07-06 15:37           ` Ed L. Cashin
1999-07-07  8:42 Gilbert van den Dobbelsteen
1999-07-07 21:39 ` Hans Hagen

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