ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Daniel Pittman <daniel@rimspace.net>
Subject: Re: "nicefrac" LaTeX package equivalent?
Date: Tue, 16 Apr 2002 00:22:18 +1000	[thread overview]
Message-ID: <871ydhoxd1.fsf@inanna.rimspace.net> (raw)
In-Reply-To: <5.1.0.14.1.20020414223846.02c93e30@server-1> (Hans Hagen's message of "Sun, 14 Apr 2002 22:47:24 +0200")

On Sun, 14 Apr 2002, Hans Hagen wrote:
> At 05:48 PM 4/11/2002 +1000, Daniel Pittman wrote:
>>I have tried to find some predefined code in ConTeXt to do the
>>equivalent of the 'nicefrace' package for LaTeX. This, basically,
> 
> hm, dunno packages that well -) 

I figured it might help if my description totally sucked. That way
people would know what I was aiming for and could check the original if
they cared that deeply about my little problems. ;)

> does this mean that one macro has a whole package?

Um, yeah, pretty much. It claims to take do a good job in math mode
also, though I don't know what values of "good" it uses in this context.

One of my main reasons for enjoying ConTeXt, not LaTeX, work so far has
been that, in ConTeXt, there are not twenty or thirty things like this
to do single macro jobs.

Ideas tend to either be solid, complete and in the distribution or
sufficiently simple to implement with the ConTeXt support code that it's
nice to write them.

[...]

>>I can do this myself using raise, lower and kern operations, but it
>>would be nicer and (presumably) much more reliable if written by
>>someone who knew more about TeX character layout than I do.
> 
> well, let me show you a couple of tricks then, see below:

Thanks for taking the time to share your knowledge. It's really very
nice of you. :)

[...]

> \def\textfrac#1#2%
>    {\dontleavehmode
>     \hbox
>       {\setbox0\hbox{/}%
>        \setbox2\hbox{\txx57}%
>        \raise\ht0\hbox{\lower\ht2\hbox{\txx#1}}%
>        \hbox to \zeropoint{\hss/\hss}%
>        \lower\dp0\hbox{\raise\dp2\hbox{\txx#2}}}}
> 
> test \textfrac{1}{2} test \textfrac{123}{456} test
> 
> Now, if you really want to see something nice, say \showmakeup before
> the calls to this macro -)

Very impressive, compared to the others -- it seems a much cleaner
layout, in the glue.

> What do others think? Which one is the nicest for default (i opt for
> the (as usual best) third one, so that one goes into core-mis.tex and
> will end up in the documentation void -)

The last looks the best for single digit figures, by far. It seems about
equivalent to the second last for the longer sequences, anyway.

Thanks,
        Daniel

-- 
An expert is a person who has made all the mistakes which can be made
in a very narrow field.
        -- Niels Bohr


  parent reply	other threads:[~2002-04-15 14:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-11  7:48 Daniel Pittman
2002-04-14 20:47 ` Hans Hagen
2002-04-15  9:02   ` Patrick Gundlach
2002-04-16 12:10     ` Hans Hagen
2002-04-17  2:59       ` Daniel Pittman
2002-04-15 14:22   ` Daniel Pittman [this message]
2002-04-15 16:38   ` James H. Cloos Jr.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871ydhoxd1.fsf@inanna.rimspace.net \
    --to=daniel@rimspace.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).