473,761 Members | 4,511 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Fractions Simply Won't Display Properly

I've been searching in vain for a way to present typographically
correct fractions (not resorting to <sup> and <sub> tags) but have been
frustrated by the fact that the glyphs for one-half, one-eighth,
three-quarters, etc. do not display in the correct typeface (or even
consistently the same typeface) and seem totally resistant to attempt
to fix this through CSS:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Language" content="en">
<table>
<tr valign="top"><t d>&#x00bc;</td></tr>
<tr valign="top"><t d>&#x00bd;</td></tr>
<tr valign="top"><t d>&#x00be;</td></tr>
<tr valign="top"><t d>⅓</td></tr>
<tr valign="top"><t d>⅔</td></tr>
<tr valign="top"><t d>⅕</td></tr>
<tr valign="top"><t d>⅖</td></tr>
<tr valign="top"><t d>⅗</td></tr>
<tr valign="top"><t d>⅘</td></tr>
<tr valign="top"><t d>⅙</td></tr>
<tr valign="top"><t d>⅚</td></tr>
<tr valign="top"><t d>⅛</td></tr>
<tr valign="top"><t d>⅜</td></tr>
<tr valign="top"><t d>⅝</td></tr>
</table>
</body>
</html>

Any thoughts of a solution (other than using inlines like 1/2, 3/4,
etc. or other hacks)?

Jul 24 '05
33 6632
David Ross wrote:
se*******@gwi.n et wrote:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Language" content="en">
<table>
<tr valign="top"><t d>&#x00bc;</td></tr>
<tr valign="top"><t d>&#x00bd;</td></tr> [snip]<tr valign="top"><t d>⅝</td></tr>
</table>
</body>
</html>


First of all, I hope you have a </head> and <body> between the last
<meta> and the <table>.


Technically not necessary--and neither are the <head> or </body>.
However, it's still weird to include one and not the other.
Jul 24 '05 #11
In our last episode,
<11************ **********@f14g 2000cwb.googleg roups.com>,
the lovely and talented se*******@gwi.n et
broadcast on comp.infosystem s.www.authoring.html:
I've been searching in vain for a way to present typographically
correct fractions (not resorting to <sup> and <sub> tags) but have been
frustrated by the fact that the glyphs for one-half, one-eighth,
three-quarters, etc. do not display in the correct typeface (or even
consistently the same typeface) and seem totally resistant to attempt
to fix this through CSS:
You cannot fix it with CSS because it isn't CSS's fault. The
font has to have the characters. No font, of course, has
characters for all the simple fractions. Some have none. Some
have half and fourth, perhaps 3/4. You may find some that have
a few more where the denominator is some small power of two.
For that reason, it is probably a good idea to represent
fractions differently where you will have many different
fractions and not to mix the two in the same context even when
you have a few.
Any thoughts of a solution (other than using inlines like 1/2, 3/4,
etc. or other hacks)?


If you are doing mathematical texts in which fractions composed
with the solidus are not acceptable, HTML is not your best
choice.

--
Lars Eighner ei*****@io.com http://www.larseighner.com/
War on Terrorism: Okay, Unleash OUR Extreme Fundamentalists
"... all of them who have tried to secularize America, I point the finger in
their face and say, 'You helped this happen.'" --Jerry Falwell
Jul 24 '05 #12
On 29 Jun 2005 se*******@gwi.n et wrote:
I've been searching in vain for a way to present typographically
correct fractions (not resorting to <sup> and <sub> tags) but have been
frustrated by the fact that the glyphs for one-half, one-eighth,
three-quarters, etc. do not display in the correct typeface (or even
consistently the same typeface)


Your problem is not limited to fractions but it can occur with nearly
*every* character. Have a look at
http://www.unics.uni-hannover.de/nht...face-arial.gif
where the browser took the glyphs for non-Western characters from
a completely-different-looking typeface.

You should be happy if the reader's browser and fonts display
http://ppewww.ph.gla.ac.uk/~flavell/...a21.html#x2153
in some way. If you want a uniform typeface, use PDF.
Why do you want fractions, anyway? Use the metric system
http://physics.nist.gov/cuu/Units/
http://www.metric.org/
and you don't need to bother with fractions.

--
Everybody expects the German Inquisition.

Jul 24 '05 #13
On Thu, 30 Jun 2005, Andreas Prilop wrote:
Your problem is not limited to fractions but it can occur with nearly
*every* character.
Indeed.

Just as a data point here. As I commented before, the 1/8, 3/8, 5/8
and 7/8 characters are in MS's WGL4, but the others in this area are
not, as far as I can tell. By default I had Win Mozilla configured to
use "Arial".

Looking at my test page, it was clear that not only the 1/8...7/8
glyphs but also the 1/3 and 2/3 glyphs were being taken from the same
font, but the fifths and sixths were coming from somewhere else.

So I changed my Mozilla configuration to choose Code2000 instead, and,
sure enough, then they all came out in the same style. (This is not
the place to discuss whether you like that style or not, but they were
the *same*, that's my point).

I then tried "Arial Unicode MS", and again got a consistent
presentation (different, of course, from Code2000, but consistent in
itself). We know from previous discussion why "Arial Unicode MS"
would not be a good choice of font for general use (it has no real
bold or italic faces, they have to be derived from the base font), but
at least this demonstrates the principle as I was telling it before:
same HTML (under control of the author), but different browser
configuration (under control of the reader), means different visual
results.
Why do you want fractions, anyway? Use the metric system


But as you rightly say, the principle is the same for any bunch of
characters/glyphs - so the underlying principles can't be wiped aside
quite so easily as that ;-}

Jul 24 '05 #14
> I then tried "Arial Unicode MS", and again got a consistent
presentation (different, of course, from Code2000, but consistent
in itself).
What's Code2000 and how do you set it in Firefox? I know Arial Unicode
MS is common on recent iterations of Windows, but what about Mac OS X?
Can I force the browsers to do this automatically? Probably the answers
to the latter three questions are all "no".
Why do you want fractions, anyway? Use the metric system


Actually, on my website, I need to display both. The whole world
prefers metric except Americans. Unfortunately, most Americans are so
unaccustomed to the metric system that it ends up confusing them.

Jul 24 '05 #15
"Alan J. Flavell" <fl*****@ph.gla .ac.uk> wrote:
As far as HTML is concerned,
your &#number; references, such as ⅓ onwards, *are* the
correct way to represent the fraction characters.


I would question the wording "the correct way" vs. "a correct way".

And I'm not quite sure about the correctness. Surely ⅓ is correct
by HTML specifications, but it is a compatibility character, and the
document "Unicode in XML and other Markup Languages"
http://www.w3.org/TR/unicode-xml/
recommends _normalization_ for it, with the somewhat hypocritical
comment "As long as fraction slash is supported!" Here normalization
refers to Unicode normalization form KC

So it seems that both the W3C and the Unicode Consortium think that
⅓ should be replaced by 1&#x2044;3 or some equivalent way of
representing the three-character sequence U+0031 U+2044 U+0033
and browsers should take care of rendering it as a conventional
fraction (even without style sheets - and a style sheet would hardly
help here anyway). But they implicitly admit that this doesn't really
work yet.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 24 '05 #16

On Tue, 5 Jul 2005, Jukka K. Korpela wrote:
"Alan J. Flavell" <fl*****@ph.gla .ac.uk> wrote:
As far as HTML is concerned,
your &#number; references, such as ⅓ onwards, *are* the
correct way to represent the fraction characters.
I would question the wording "the correct way" vs. "a correct way".


Thanks for the correction, which I don't disagree with...
And I'm not quite sure about the correctness. Surely ⅓ is correct
by HTML specifications, but it is a compatibility character, and the
document "Unicode in XML and other Markup Languages"
http://www.w3.org/TR/unicode-xml/
recommends _normalization_ for it, with the somewhat hypocritical
comment "As long as fraction slash is supported!" Here normalization
refers to Unicode normalization form KC

So it seems that both the W3C and the Unicode Consortium think that
⅓ should be replaced by 1&#x2044;3 or some equivalent way of
representing the three-character sequence U+0031 U+2044 U+0033
and browsers should take care of rendering it as a conventional
fraction (even without style sheets - and a style sheet would hardly
help here anyway). But they implicitly admit that this doesn't really
work yet.


Right.
Jul 24 '05 #17


On Fri, 1 Jul 2005, shamshoon wrote:
I then tried "Arial Unicode MS", and again got a consistent
presentation (different, of course, from Code2000, but consistent
in itself).


What's Code2000

what's a search engine? For example
http://www.google.co.uk/search?hl=en&q=code2000

It's a font.
and how do you set it in Firefox?
If you wanted to, you'd first get the font, install it, and then select
it.
I know Arial Unicode MS is common on recent iterations of Windows,
Actually not. To the best of my knowledge it does not come with any MS
OS, but is only licensed with a number of their chargeable products, such
as MS Office etc.
but what about Mac OS X?
I think you'd need to consult a lawyer about that...
Can I force the browsers to do this automatically?
If you're speaking as a web author, then the standard answer applies: on
the web you can not "force" your readers to do ANYTHING, and it is good
that it is so.
Actually, on my website, I need to display both. The whole world
prefers metric except Americans. Unfortunately, most Americans are so
unaccustomed to the metric system that it ends up confusing them.


Then you have a particularly challenging problem, since USA users appear
to be the most likely to have a crippled font installation, and unaware
that they can or should do anything about it. That was a summary of
previous discussions here, as well as my own personal experience of
interactions with some of them.

I recall that M.Crispin (who I believe reads Japanese), author of the IMAP
protocol, somewhat sarcastically remarked that USA users don't need
anything more than us-ascii, with the implication that anything more
would only confuse them. Ho hum.

all the best.
Jul 24 '05 #18
On Tue, 5 Jul 2005, Alan J. Flavell wrote:
I recall that M.Crispin (who I believe reads Japanese), author of the IMAP
protocol, somewhat sarcastically remarked that USA users don't need
anything more than us-ascii, with the implication that anything more
would only confuse them.


However, © ® seem to be widely used even in US-ASCII land.
http://www.google.com/search?q=copyr...:microsoft.com

--
Evil® is a registered trademark of the President of the United States.

Jul 24 '05 #19
> On Fri, 1 Jul 2005, shamshoon wrote:
Actually, on my website, I need to display both. The whole world
prefers metric except Americans. Unfortunately, most Americans are so
unaccustome d to the metric system that it ends up confusing them.

Alan J. Flavell wrote:
Then you have a particularly challenging problem, since USA users appear
to be the most likely to have a crippled font installation, and unaware
that they can or should do anything about it. That was a summary of
previous discussions here, as well as my own personal experience of
interactions with some of them. I recall that M.Crispin (who I believe reads Japanese), author of the IMAP
protocol, somewhat sarcastically remarked that USA users don't need
anything more than us-ascii, with the implication that anything more
would only confuse them. Ho hum.


I'm American, and I agree with that...

While trying to make my pages present themselves as best I could I found
that quite a few compromises needed to used. So, ultimately, I gave up
on trying to suppoort Netscape 4.xx this allowed me to used entity
references as defined in HTML 4.01 please see my tables...

http://software.seaplusplus.net/code...eferences.html

So, I have settled on the scheme for equations (which exhibit fractions
on steroids) ;-) used in...

http://library.seaplusplus.net/physi...elativity.html

Just search on the equals sign to see the treatment of the equations. I
am very anxious to hear any feedback on this scheme.

Thank you...

Rich
Jul 24 '05 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
9249
by: karp | last post by:
Lets say I have the following class in order to add two fractions, class Fraction{ public: Fractions::Fraction(int numer = 0, int denom = 1) { valeurNumerateur = numer; valeurDenominateur = denom; }
0
1429
by: Mori | last post by:
Hi, How do I hold fractions in a string so I can display them and print them out? Say I want to display "2½" (that's 2 and a half if this doesn't display either), but it displays "2?½" (that's 2 follow by uppercase A with a squiggle on top, thenfollowed by a half). It's not just halfs I want to display either, it's eighths and three
2
7050
by: Mori | last post by:
Hi, Can someone supply a code example of displaying a string with a fractional part, say 5 and 7 16ths. I cannot find an example of how to use the Encoding object (if that is what you use). thanks, Mori
2
1641
by: Just Me | last post by:
I need a numerical updown control that displays fractions. If the increment is 1/16 it would display 1/16, 1/32, 3/16, 1/4... I thought I might inherit from a NumericalUpDown control and place a label on top of the display and put the text in that. Sounds kind of kluged. Anyone have a better approach?
15
14624
by: farah727rash | last post by:
Hi everyone, I have this problem and I don't know what's wrong with my program. I am trying to enter my two variables height and weight as fraction numbers. I declared them as float and also as double, but the program aborts when I input a fraction instead of decimal/integer number. Could someone tell me where the problem is, and what I need to do to correct my code? Thanks a lot in advance, Farah. #include <iostream> using namespace...
4
3380
by: Bob | last post by:
Hi All, Was wondering if in C# there is an elegant way of displaying and or calculating fractions. The case: we have an app that measures/slices dices etc and all our internal measures and counters are in metric measures ... (its a manufacturing tool) For display purposes this is fine for Australia/Europe/Asia .. however the US company likes to see the measures in feet/inches .. no real problem here.
1
1636
by: Semajthewise | last post by:
Here it is cleaned up a little more. Here's what this code does. It will take 2 fractions and add, subtract, multiply, or divide them. The user enters the fractions to be calculated into two textboxes. These can be entered as a whole number and a proper fraction, whole number and an improper fraction, just a proper/inproper fraction, or just a whole number. Form build Requirements: using Microsoft Visual Studio.NET 2003 single form...
5
5625
by: gubbachchi | last post by:
Hi all, How to convert the fractions into decimals and vice versa in php. I have a form, where the user will enter fractions in the text boxes such as "1 1/2", "1 1/4" and so on. I need to store all these values in mysql database after converting it into decimal value, and again fetch the value from database and re-convert it into fractions and display it to the user in a different php page. So what is best solution for this. Can anyone...
0
1245
by: Paddy | last post by:
(From: http://paddy3118.blogspot.com/2008/09/python-fractions-issue.html) There seems to be a problem/difference in calculating with the new fractions module when comparing Python 26rc2 and 30rc1 I was reading the paper "Interval Arithmetic: Python Implementation and Applications" and thought to try the first example function f(x,y), which needs more precision than Python floating point provides (on my Windows PC), to calculate a...
0
9554
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10136
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9989
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9811
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8814
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7358
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5266
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3913
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3509
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.