ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Sample of the Day (Example environment)
@ 1999-09-08 19:51 David Arnold
  1999-09-08 22:44 ` Hans Hagen
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: David Arnold @ 1999-09-08 19:51 UTC (permalink / raw)
  Cc: ntg-context

[-- Attachment #1: Type: text/plain, Size: 939 bytes --]

Hans,

You asked for some samples of math typesetting. If the group doesn't mind,
I'll do one a day for a while. All, if this bothers you on this list, let
me know and I'll just send them to Hans.

Contrast Context

\defineenumeration
 [example]
 [location=serried,
  text=Example,
  before=\blank,
  after=\blank,
  way=bychapter,
  style=slanted]

\startexample
Use \mat\ to sketch the conic section with equation

\startformula
r=\frac{4}{1+0.5\cos\theta}.
\stopformula

\stopexample

with AMSLatex,

\documentclass{article}

\usepackage{amsmath}

\newtheorem{example}{Example}[section]

%Special typeset of the Matlab logo
\def\mat{{\rm M}{\sc atlab}}

\begin{document}

\begin{example}
Use \mat\ to sketch the conic section with equation
$$
r=\frac{4}{1+0.5\cos\theta}.
$$
\end{example}

\end{document}

Note the typesetting of \cos\theta in this Context example. The cos gets
set in italic with not very good spacing. 

Dvi attached.

[-- Attachment #2: example.dvi --]
[-- Type: application/octet-stream, Size: 576 bytes --]

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

* Re: Sample of the Day (Example environment)
  1999-09-08 19:51 Sample of the Day (Example environment) David Arnold
@ 1999-09-08 22:44 ` Hans Hagen
  1999-09-09 10:01 ` Taco Hoekwater
  1999-09-09 13:07 ` Taco Hoekwater
  2 siblings, 0 replies; 5+ messages in thread
From: Hans Hagen @ 1999-09-08 22:44 UTC (permalink / raw)
  Cc: ntg-context

David Arnold wrote:

> \startformula
> r=\frac{4}{1+0.5\cos\theta}.
> \stopformula

Ha, you uncovered a bug in \frac, it should be (in core-mat.tex). I
didn't count the braces right when I added the \mathematics macro.
Stupid error. 

\def\frac#1#2%
  {\relax\mathematics{{{\mathstyle{#1}}\over{\mathstyle{#2}}}}}

Concerning the italic, it's what you asked for -)

  \let\mathop\normalmathop

gives you non adapting math. I can make a \setupmath command ... 

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] 5+ messages in thread

* Re: Sample of the Day (Example environment)
  1999-09-09 10:01 ` Taco Hoekwater
@ 1999-09-09  8:02   ` Hans Hagen
  0 siblings, 0 replies; 5+ messages in thread
From: Hans Hagen @ 1999-09-09  8:02 UTC (permalink / raw)
  Cc: ntg-context

Taco Hoekwater wrote:

> slanted, actually. This is an error. There is another error in this

I depends. When in math mode one wants the sin to adopt to for instance
bold math. It may however be a good idea to use \everydisplay to reset
the math environment to something \tf. 

> same example: I needed {\frac{}{}} to limitate the fraction, because
> there are to many braces in \frac's definition.

I repaired the \frac.  

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] 5+ messages in thread

* Re: Sample of the Day (Example environment)
  1999-09-08 19:51 Sample of the Day (Example environment) David Arnold
  1999-09-08 22:44 ` Hans Hagen
@ 1999-09-09 10:01 ` Taco Hoekwater
  1999-09-09  8:02   ` Hans Hagen
  1999-09-09 13:07 ` Taco Hoekwater
  2 siblings, 1 reply; 5+ messages in thread
From: Taco Hoekwater @ 1999-09-09 10:01 UTC (permalink / raw)


>>>>> "David" == David Arnold <darnold@northcoast.com> writes:

    David> Hans, You asked for some samples of math typesetting. If
    David> the group doesn't mind, I'll do one a day for a while. All,
    David> if this bothers you on this list, let me know and I'll just
    David> send them to Hans.

If it does bother someone, send them to me instead of Hans -> all this 
math extension stuff is supposed to be my problem. Hans, please don't
touch this. I'll collect problems/bugs and send them to you in one
move (for the parts that are in the ConTeXt core), while
simultaniously working on m-math.

    David> \defineenumeration [example] [location=serried,
    David> text=Example, before=\blank, after=\blank, way=bychapter,
    David> style=slanted]

    David> \startexample Use \mat\ to sketch the conic section with
    David> equation

    David> \startformula r=\frac{4}{1+0.5\cos\theta}.  \stopformula

    David> \stopexample

    David> Note the typesetting of \cos\theta in this Context
    David> example. The cos gets set in italic with not very good
    David> spacing.

slanted, actually. This is an error. There is another error in this
same example: I needed {\frac{}{}} to limitate the fraction, because
there are to many braces in \frac's definition. 

Greetings, Taco


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

* Re: Sample of the Day (Example environment)
  1999-09-08 19:51 Sample of the Day (Example environment) David Arnold
  1999-09-08 22:44 ` Hans Hagen
  1999-09-09 10:01 ` Taco Hoekwater
@ 1999-09-09 13:07 ` Taco Hoekwater
  2 siblings, 0 replies; 5+ messages in thread
From: Taco Hoekwater @ 1999-09-09 13:07 UTC (permalink / raw)
  Cc: ntg-context

>>>>> "Hans" == Hans Hagen <pragma@wxs.nl> writes:

    Hans> Taco Hoekwater wrote:
    >> slanted, actually. This is an error. There is another error in
    >> this

    Hans> I depends. When in math mode one wants the sin to adopt to
    Hans> for instance bold math. It may however be a good idea to use
    Hans> \everydisplay to reset the math environment to something
    Hans> \tf.

The only moment where you might want to change to a different math
setup is when you are inside of a bold or sans-serif section head or
something like that (but even then, you may *not* want to make the
change, for instance if you use boldface to differentiate vectors from
variables).

The sane thing to do is to have separate math font setups for separate
environments (so there will be 'mb' for math bold and maybe 'ms' for
math sans as well as the normal 'mm'). The current situation with the
redefinition of \fam0/nullification of \rm by the surrounding
environment is really not correct.

Greetings,

Taco


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

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

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-09-08 19:51 Sample of the Day (Example environment) David Arnold
1999-09-08 22:44 ` Hans Hagen
1999-09-09 10:01 ` Taco Hoekwater
1999-09-09  8:02   ` Hans Hagen
1999-09-09 13:07 ` Taco Hoekwater

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